getting ID of two selected sketch segments in drawing

Oct 09, 2003 1 Replies

I'm trying to write a VBA program that gets the ID of two selected sketch segments in a drawing but can't figure out the logic of it...



Set swApp = Application.SldWorks Set swDraw = swApp.ActiveDoc Set swSelMgr = swDraw.SelectionManager



now, swSelMgr.GetSelectedObjectCount() returns 2, which is great!



But how can I access each segment individually? I tried swSelMgr.GetSelectedObjectsComponent2(1), but it returns nothing!



Thanks for any help!



Louis-Philippe Salin de l'Etoile PBI


try GetSelectedObject(1), GetSelectedObject(2). GetSelectedObjectComponent returns the assembly Component on which the selection is made.

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required