AnsweredAssumed Answered

How to use the ReorderFeature with API?

Question asked by Yong Ning on Aug 1, 2015

0.jpg

 

 

follow code is false

e.g. SwModel.ReorderFeature SwFeatArr(1).Name, SwFeatArr(0).Name

 

code is

 

Private Sub ll1()

   Dim SwApp As SldWorks.SldWorks, SwModel As ModelDoc2

      Set SwApp = Application.SldWorks

      Set SwModel = SwApp.ActiveDoc

   Dim SwFeat As Feature, SwFeatArr(1) As Feature

      Set SwFeat = SwModel.FirstFeature

      nn = 0

      Do While Not SwFeat Is Nothing

         If SwFeat.GetTypeName = "DrSheet" Then

             Debug.Print SwFeat.Name, SwFeat.GetTypeName

             Set SwFeatArr(nn) = SwFeat

             nn = nn + 1

         End If

         Set SwFeat = SwFeat.GetNextFeature

      Loop

      Stop

     

      SwModel.ReorderFeature SwFeatArr(1).Name, SwFeatArr(0).Name

      Stop

End Sub

Attachments

Outcomes