7 Replies Latest reply on Feb 22, 2018 9:48 AM by Scott Giffin

    Property tab builder filling Summary tab Author, Title, Subject fields

    Vilmos Geleji

      Hello fellow SolidWorkers,

       

      First time post here

      Can you please tell me how to write to the summary information, Summary tab fields (such as Author, Keywords,Comments, Title, Subject) with a custom built Property Tab?

      2018-01-15 10_01_09-SOLIDWORKS Premium 2015 x64 Edition - [NVKP16-M-024-01-012R-A.SLDPRT].png

      PropertyTabBuilder.png

      I am using SolidWorks 2015 SP5.

      In the above scenario I get an Author field added among the custom property fields, however I wish to directly edit the summary tab's Author field.

       

      In case this cannot be done with the property tab builder, can you give me an idea how to make a custom property tab (a macro?) that does have access to these fields- or do you recommend not filling the summary tab fields at all?

        • Re: Property tab builder filling Summary tab Author, Title, Subject fields
          John Stoltzfus

          There is a lot of stuff here on the Forum about Custom Property Tab Builder, Did you search?

           

          If you want go to this thread and download the excel file then look at the Custom Property Tab Builder search return....

           

          Forum SEARCH RESULTS - Over 160,000 Search Returns - Excel  (10/10/2018)  Updated - Alin Vargatu & Visualize

            • Re: Property tab builder filling Summary tab Author, Title, Subject fields
              Vilmos Geleji

              I only searched via the forum's search bar and google of course. Thanks for the outstanding excel reference. I did find a few posts like this one:

              https://forum.solidworks.com/message/289856#comment-289856

              It is not exactly the same scenario, but similar, and it does make me believe that what I am trying to do is not possible using the property tab builder, but rather by writing my own macro. Or possibly I've fallen prey to the XY problem.

               

              Back to the real problem here is my workflow:

              1. Design parts and assemblies

              2. Use the custom built property tab to populate the part's properties.

              3. Create drawing... The template has textbox with various references, including a $PRP:"SW-Title" reference (this is the reference to the Summary Information -> Summary tab -> Title: field).

              Since the $PRP:"SW-Title" field cannot be populated using the Property builder I need to either

                 3a. open up the part's Summary Information window and populate these fields there. Then what is the point of the custom property builder?

                 3b. rethink my drawing template... likely changing the $PRP:"SW-Title", to $PRP:"Custom-Tab-Title" and change the property tab builder to populate the Custom-Tab-Title field instead of the Summary Information page's Title field... But then what is the point of this field?

               

              So back to the question How do you guys fill the Summary Information page's Author and Title fields?

                • Re: Property tab builder filling Summary tab Author, Title, Subject fields
                  John Stoltzfus

                  I have that in my Custom Property Tab Builder file and it populates automatically...

                   

                  You ask in 3a why have the CPTB?  Did you know if you need to change or add custom properties while you're in the assembly file, that all you need to do is click on the part and then the custom property tab on the right side of the screen. 

                  • Re: Property tab builder filling Summary tab Author, Title, Subject fields
                    Carrie Ives

                    I don't use the properties from the Summary Information page. I add new custom properties to cover that information. I use "Description" in place of Title and "DrawnBy" in place of author. At my current position we just use DrawnBy. I have worked places where we had DesignedBy and DrawnBy both. Other custom properties I have are PIIPN (our part number), revision, status (draft/released), Approval reference number (ECN number basically), and Project.

                     

                    As you are setting this up, think about how intuitive it will be for other users. A lot of people are used to using the CPTB to fill in the properties so will enter the information there first. If you end up using a macro, make sure to train your users that they need to use the macro.

                      • Re: Property tab builder filling Summary tab Author, Title, Subject fields
                        Vilmos Geleji

                        Thanks, Carrie and John for the great responses.

                        Based on your comments I have made the decision to sacrifice a few things in favor of the property tab, took route 3b, changing all my drawing templates. And from now on, ignoring the Summary tab's fields. I hope it will go well in the long run. The only thing I noticed is now windows explorer's file property bar is also missing the title, description and tags, probably due to my empty summary tab fields:

                        2018-01-16 09_10_24-310-Hall_renovation.png

                        Well, apart from this it seems to work out well so far.

                      • Re: Property tab builder filling Summary tab Author, Title, Subject fields
                        Sergio Monti

                        I do as follows.

                        I've got the "DrawnBy" field that is already set with my name in the document template. In the office each designer has their own template with their name in.

                        The "mass" and "material" fields are set as well as shown below.

                        Once I saved the part or assembly document, I built a macro which gets the file name and put the first part in the PN the second part in the description.

                        I use the tab builder to populate the other properties, as supplier, finish, revision etc. and I set it in order to choose properties from a list, to speed up the choice.

                    • Re: Property tab builder filling Summary tab Author, Title, Subject fields
                      Scott Giffin

                      If you have the custom properties for DrawnBy and Description already filled in, the following macro would add those results to the Author and Title fields on the summary tab. Original code was by Deepak Gupta. He's the master, I'm just a humble beginner. I just added the author part to his macro. There could be more added if you wish. I think that anyone hovering over the file in windows explorer can see the summary information. Someone please correct me if I'm wrong. Tip: add a "Status" field to your custom properties and this too will show up in explorer when you hover over the file. I use it to show whether the print is in progress, ready for checking or released.

                       

                      'Precondition: Document open needing the summary information populated. Custom property fields "Description" and "DrawnBy" must already be filled in
                      'Postcondition: Summary information is filled in
                      'Gets the "Title" information from the "Description" in the custom property field
                      'Added getting the author from "DrawnBy" field in the sheet which can be populated by creating a new custom property sheet or add to the templates

                       

                      Dim swApp As Object
                      Sub main()

                          Dim swApp             As SldWorks.SldWorks
                          Dim swModel          As SldWorks.ModelDoc2
                          Dim swCustProp     As CustomPropertyManager
                          Dim val                   As String
                          Dim valout              As String
                          Dim bool                As Boolean


                          Set swApp = CreateObject("SldWorks.Application")
                          Set swModel = swApp.ActiveDoc
                          Set swCustProp = swModel.Extension.CustomPropertyManager("")

                       

                      'Gets the "Title" information from the "Description" in the custom property field
                          bool = swCustProp.Get4("Description", False, val, valout)
                          swModel.SummaryInfo(swSumInfoTitle) = valout

                       

                      'Gets the "Athhor" information from the "DrawnBy" in the custom property field

                          bool = swCustProp.Get4("DrawnBy", False, val, valout)
                          swModel.SummaryInfo(swSumInfoAuthor) = valout
                         
                          swModel.ForceRebuild3 (False)
                          swModel.Save


                      End Sub