2 Replies Latest reply on Jun 13, 2012 2:27 PM by benjamin.couillard

    How to get a collection of all components


      Hi everyone,


      I'm trying to find a way to get a collection of all components on my project without having to open all sheets.


      Here's what I've come up with so far



      Set vdapp = GetObject(,"ViewDraw.Application")

      vdapp.visible = True

      Set vdproj = vdapp.SchematicSheetDocuments.GetAvailableSchematics()

      Set vdsheets = vdapp.SchematicSheetDocuments.GetAvailableSheets(vdproj.GetItem(1))


      for Each vdsheet in vdsheets



        Set vddoc = vdapp.SchematicSheetDocuments.Open(vdproj.GetItem(1),vdsheet)

        'MsgBox vdsheet

        Set vdview = vdapp.ActiveView




        Set CompColl = vdview.query(VDM_COMP, VD_ALL)






      I would like to be able to get the collection  of components without having to load the schematic view in DxDesigner. Also, I think my method so far is kind of complicated and I think it could be improved, any tips would be appreciated.