3 Replies Latest reply on Nov 16, 2012 11:31 PM by Artem Taturevych

    Changing Multiple Detail View Labels

    Trevor Wunn

      I often get drawings that are super old and have tons of detail and section views, to the point that sometimes I end up with section zy-zy or similar. I was considering making a macro that would step through the design tree in the drawing and relabel all the sections and details successively starting with A.

       

      I have two questions; is this feasable and is there an easier way to do this.

       

      Any help would be greatly appreciated.


      Thanks,

       

      Trevor

        • Re: Changing Multiple Detail View Labels
          Artem Taturevych

          Please check the attachment. I would strongly recommend to make a backup of your data when testing the macro. This macro does not support double labels. So if the quantity of views on the sheet is more than number of letters in English alphabet it fails.

           

          Let me know if this is an issue - I could update the macro.

          ______________________

          Regards,

          Artem Taturevych

          Application Engineer at Intercad

          http://intercad.com.au/

          Tel: +61 2 9454 4444

            • Re: Changing Multiple Detail View Labels
              Trevor Wunn

              Thanks a ton Artem! This works exactly as I needed.

               

              I would like to point out to anyone who downloads this for use, you do need to edit the code just a little bit.

              There are parenthesis missing from around the GetNextName function/string located in the case section.

               

              swSectionView.SetLabel (GetNextName)

               

              swDetailedView.SetLabel (GetNextName)

                • Re: Changing Multiple Detail View Labels
                  Artem Taturevych

                  Hi Trevor,

                   

                  Glad to help. Just a clarification. I assume you are using SolidWorks 2013, isn't it? There is  major change with SolidWorks 2013 and the VB7 is now using for macros. VB6 was used before.

                   

                  There are some differences between VB7 and VB6. One of them is usage of parenthesis. In VB6 you should not put the parenthesis when calling the function unless you are assigning the return value.

                   

                  For example

                   

                  swSectionView.SetLabel (GetNextName) is incorrect in VB6 and you should use

                   

                  swSectionView.SetLabel GetNextName

                   

                  but this one is correct:

                   

                  Dim status as Integer

                  status = swSectionView.SetLabel (GetNextName)

                   

                  In VB7 you should use parenthesis everytime.

                   

                  Excuse me I'm still on SolidWorks 2012 that's why missed this because this is working for me and for all who are not on SolidWorks 2013.

                   

                  Anyways this is very good point to make it work on SolidWorks 2013. And this information may be useful for other members.

                  ______________________

                  Regards,

                  Artem Taturevych

                  Application Engineer at Intercad

                  http://intercad.com.au/

                  Tel: +61 2 9454 4444