2 Replies Latest reply on Mar 18, 2015 3:56 AM by Peter De Vlieger

    Multiple Drawing views renaming

    Peter De Vlieger

      There have been similiar questions in the past. However none of the answers that were given were anything I, with my close to none existent knowledge of macro's, could understand enough to make what I wanted.


      If a kind soul has a moment to make this it would be greatly appreciated.


      Desired result.

      In a drawing on the first, =default sheet, (does not have to check for other sheets) to rename Drawing View1 to "Front", Drawing View 2 to "Top" and Drawing View 3 to "Side".

      There doesn't have to be error checking or other foul and full proof measures. Which means that I would expect it to be kind of easy to make.


      I tried record macro but that didn't do much.


      Thank you in advance.

        • Re: Multiple Drawing views renaming
          Keith Rice
          Dim swApp As SldWorks.SldWorks
          Dim swModel As SldWorks.ModelDoc2
          Dim swFeat As SldWorks.Feature
          Dim swSubFeat As SldWorks.Feature
          Sub main()
              Set swApp = Application.SldWorks
              Set swModel = swApp.ActiveDoc
              Set swFeat = swModel.FirstFeature
              Do While Not swFeat Is Nothing
                  Set swSubFeat = swFeat.GetFirstSubFeature
                  Do While Not swSubFeat Is Nothing
                      Select Case swSubFeat.Name
                          Case "Drawing View1"
                              swSubFeat.Name = "Front"
                          Case "Drawing View2"
                              swSubFeat.Name = "Top"
                          Case "Drawing View3"
                              swSubFeat.Name = "Side"
                      End Select
                      Set swSubFeat = swSubFeat.GetNextSubFeature
                  Set swFeat = swFeat.GetNextFeature
          End Sub



          SolidWorks API Tutorials