10 Replies Latest reply on Mar 30, 2015 3:35 PM by Florimond Laporte

    Note with release version

    Florimond Laporte

      Hi there!

       

      Is there a way to get an automatic note (link property I guess) on a drawing template (in the title block for instance) with the Solidworks release version? (e.g. 2015 SP2).

       

      Cordially,

       

      Florimond

        • Re: Note with release version
          Glenn Schroeder

          I'm pretty sure there isn't any "out of the box" way to do this, but someone may be able to write a macro to do it.  I'd suggest moving this Discussion to the API section of the forum.  (Click on Move under Actions near top right to move a Discussion.)

           

          • Re: Note with release version
            Deepak Gupta

            Any specific reason you want to do that? The reason I'm asking is that a model/drawing made in say 2013 and saved/updated to 2015 will not reflect the correct scenario.

              • Re: Note with release version
                Florimond Laporte

                Hello Deepak,

                 

                We put the SW version on our drawing so when we share a drawing made in 2015 to a partner that would use a previous version, we understand why it does not open. It is not mandatory, but nice to have.

                 

                Currently this information is on our drawing templates and we need to think to update the templates when we update SW version. Therefore an automation of this would prevent any mistake/forgetting.

                  • Re: Note with release version
                    Deepak Gupta

                    Florimond Laporte wrote:

                     

                    We put the SW version on our drawing so when we share a drawing made in 2015 to a partner that would use a previous version, we understand why it does not open. It is not mandatory, but nice to have.

                     

                    If they can't open it then how would they know as which version it was made on. I don't want to argue but just trying to understand, so that we can try to move this need as enhancement request.

                      • Re: Note with release version
                        Florimond Laporte

                        This is a proper question Deepak, and you are right in your assumption. Let just say that I send a drawing to a partner, they reply that they cannot open it. Then I look at the drawing and I see that it is made in a version more recent then the one our partner have.

                         

                        Or they have the pdf upfront and already know that it they ask for the solidwork model/drawing, it won't work for them.

                         

                        If I am the only one doing this, I say there is no need for an ER, but I am just asking around if there is a way to do this elegantly. Updating manually the template is not such a burden.

                  • Re: Note with release version
                    Keith Rice

                    The attached macro will replace the text in a selected note with the SolidWorks version in format you specified above. You can read instructions on how to assign this to macro shortcut here. After that button is created you can assign a keyboard shortcut. Otherwise you will need to run it via Tools-->Macros-->Run.

                     

                    Here is the code:

                     

                    Sub main()
                        Dim swApp As SldWorks.SldWorks
                        Dim swModel As SldWorks.ModelDoc2
                        Dim swSelMgr As SldWorks.SelectionMgr
                        Dim swNote As SldWorks.Note
                        Dim vSplit As Variant
                        
                        Set swApp = Application.SldWorks
                        Set swModel = swApp.ActiveDoc
                        Set swSelMgr = swModel.SelectionManager
                        Set swNote = swSelMgr.GetSelectedObject6(1, -1)
                        
                        vSplit = Split(swApp.RevisionNumber, ".")
                        swNote.SetText CStr(1992 + vSplit(0)) & " SP" & vSplit(1)
                    End Sub
                    

                     

                    Keith

                    SolidWorks API Training