AnsweredAssumed Answered

don't traverse, set model?

Question asked by Yong Ning on Feb 11, 2017
Latest reply on Feb 12, 2017 by Solid Air

Follow code,  Taverse method,

           Set SwComp = vComp(ii)

           Set oSwModel = SwComp.GetModelDoc

Help me , don't traerse metho, set oSwModel = SwComp???

 

**************************************************************

Private Sub ll()

    Dim SwApp As SldWorks.SldWorks, SwModel As ModelDoc2, SwAssy As AssemblyDoc

        Set SwApp = Application.SldWorks

        Set SwModel = SwApp.ActiveDoc

        Set SwAssy = SwModel

    Dim vComp, SwComp As Component2, oSwModel As ModelDoc2

       

        vComp = SwAssy.GetComponents(True)

        For ii = 0 To UBound(vComp)

           Set SwComp = vComp(ii)

           Set oSwModel = SwComp.GetModelDoc

           Debug.Print oSwModel.GetPathName

        Next ii

End Sub

Outcomes