AnsweredAssumed Answered

VBA - Traverse Assy by DocumentManager

Question asked by Checkcheck Master on Jun 17, 2014
Latest reply on Jun 18, 2014 by Ivana Kolin

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 !

Outcomes