getting ID of two selected sketch segments in drawing

Discussion in 'SolidWorks' started by Louis-Philippe Salin de l'Etoile, Oct 9, 2003.

  1. 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
     
    Louis-Philippe Salin de l'Etoile, Oct 9, 2003
    #1
  2. try GetSelectedObject(1), GetSelectedObject(2).
    GetSelectedObjectComponent returns the assembly Component on which the
    selection is made.
     
    Philippe Guglielmetti, Oct 9, 2003
    #2
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.