4 Replies Latest reply on Feb 12, 2017 11:01 AM by Solid Air

    don't traverse, set model?

    Yong Ning

      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