getting ID of two selected sketch segments in drawing

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

Reply to
Louis-Philippe Salin de l'Etoile
Loading thread data ...

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

Reply to
Philippe Guglielmetti

PolyTech Forum website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.