1 Reply Latest reply on Jun 18, 2014 3:58 AM by Ivana Kolin

    VBA - Traverse Assy by DocumentManager

    Checkcheck Master

      Hi there,

       

      How can I traverse an assy's components by the documentmanager, this is what I've got:

       

              Set swClassFact = CreateObject("SwDocumentMgr.SwDMClassFactory")

              Set swDocMgr = swClassFact.GetApplication(sLicenseKey)

              Set swDoc = swDocMgr.GetDocument(sDocFileName, nDocType, False, nRetVal)

              Set swCfgMgr = swDoc.ConfigurationManager

              Set RefVal = swDoc

                           

              Dim dmSearchOpt As SwDMSearchOption

              Dim numExtRefs As Integer

       

              dmSearchOpt = swDocMgr.GetSearchOptionObject

              dmSearchOpt.SearchFilters = (SwDmSearchFilters.SwDmSearchExternalReference + SwDmSearchFilters.SwDmSearchForAssembly +                SwDmSearchFilters.SwDmSearchInContextReference)

             

              numExtRefs = dmDoc.GetExternalFeatureReferences2(dmSearchOpt)

       

              Dim arrExtRefs As Variant

              arrExtRefs = RefVal.GetAllExternalReferences(dmSearchOpt)

       

      Greetings !