16 Replies Latest reply on Nov 19, 2018 1:19 AM by Fifi Riri

    MODEL PROPERTIES FROM DRAWING

    Mike Flanders

      could someone write a macro that will open the model properties tab from within a drawing? Currently I have to select an annotation, select the link button which brings up the a field asking what I want to link. I then select model and click model properties. I really wish SW would add this functionality to the software. If they have a back door why don't they just add a front door. Why sneak in? This photo illustrates what I do.

       

      MODEL PROERTIES TAB.JPG

        • Re: MODEL PROPERTIES FROM DRAWING
          Deepak Gupta

          Why you need to open up model properties tab and why can't you select from the drop down list?

            • Re: MODEL PROPERTIES FROM DRAWING
              Mike Flanders

              Only list I have ever been able to open up in the drawing was the drawings properties window. I like keeping all my data in the model side of things. I keep revision levels that match our ERP system in the model properties tab. This is actually where you wrote a macro to save a PDF of the drawing into a network location only renaming it the discription (our part#) and grabbing the an _# afterwards. That being said anytime something is being changed I make the change but may forget to change the underscore level. I want control to open this window from the drawing without going through the hoops of selecting a note, linking, etc. etc.

                • Re: MODEL PROPERTIES FROM DRAWING
                  Deepak Gupta

                  Could you add a video of your workflow? I'm curious as why the drop down list is grayed out in your picture.

                    • Re: MODEL PROPERTIES FROM DRAWING
                      Mike Flanders

                      I just left the office. I'm leaving in a business trip. When I get to hotel I'll record something. I've always known that other properties box to be grayed out. I've always had to use that back door to edit any model custom properties such as changing that one value. Or just open the part and change it but you know how we all hate the extra clicks to do something simple.

                        • Re: MODEL PROPERTIES FROM DRAWING
                          Deepak Gupta

                          Mike Flanders wrote:

                           

                          I've always known that other properties box to be grayed out. I've always had to use that back door to edit any model custom properties such as changing that one value. Or just open the part and change it but you know how we all hate the extra clicks to do something simple.

                          Well you can not change the value without doing the steps you mentioned but why you want to change during that linking stage? Also I can not think a better way than what Fifi Riri has suggested.

                            • Re: MODEL PROPERTIES FROM DRAWING
                              Mike Flanders

                              I don't want to change inside of the linking tab. This is just a backdoor I found a couple years ago to be able to open up the novel custom properties tab from within the drawing.

                                • Re: MODEL PROPERTIES FROM DRAWING
                                  Deepak Gupta

                                  Mike Flanders wrote:

                                   

                                  I don't want to change inside of the linking tab. This is just a backdoor I found a couple years ago to be able to open up the novel custom properties tab from within the drawing.

                                  So if you're not changing, then aren't you able to link directly?

                                   

                                  Link to Prop.gif

                                    • Re: MODEL PROPERTIES FROM DRAWING
                                      Mike Flanders

                                      This is exactly what I am doing. Problem is I don't want to go into the model to change the description "block" and I don't want to go through the tabs like you are in the video to change it. I was hoping a macro could force the walk through and open the model custom prolproper box.

                                        • Re: MODEL PROPERTIES FROM DRAWING
                                          Deepak Gupta

                                          Mike Flanders wrote:

                                           

                                          This is exactly what I am doing. Problem is I don't want to go into the model to change the description "block" and I don't want to go through the tabs like you are in the video to change it.

                                          But in post above you said you are not looking to change. So what exactly you want to do?

                                            • Re: MODEL PROPERTIES FROM DRAWING
                                              Mike Flanders

                                              What I meant is I'm changing the value, I just don't really to be selecting the note, then selecting the link button, then selecting the the model property circle & finally selecting the file property button just to get into my custom properties table to change the one cell.

                                               

                                              I realize I could always link this value to my drawing custom properties but I always like to keep my data/parameters/details within the model.

                                              • Re: MODEL PROPERTIES FROM DRAWING
                                                Mike Flanders

                                                I believe SW should add in the ability to select a view and see the MODEL properties of the item in that view. Makes no sense to me that they don't have this functionality. I've put in enhancement request before. I'll have to again.

                                                  • Re: MODEL PROPERTIES FROM DRAWING
                                                    Deepak Gupta

                                                    Mike Flanders wrote:

                                                     

                                                    I believe SW should add in the ability to select a view and see the MODEL properties of the item in that view. Makes no sense to me that they don't have this functionality. I've put in enhancement request before. I'll have to again.

                                                    I'm still not sure if you need to look at properties OR their values. In addition what end result you're looking for by seeing those properties or values or both?

                                                      • Re: MODEL PROPERTIES FROM DRAWING
                                                        Josh Brady

                                                        Deepak,

                                                        What Mike wants to do is edit the custom properties of a part shown in a drawing view.  But, he doesn't want to open the part in its own window.  He doesn't really care about making an annotation at all, he just wants to see the same dialog he would see from File->Properties if the part was open.  Opening the Annotation Link dialog gives you that button that will open the part's Custom Properties dialog without opening the part.  From there he can edit/add/whatever the part's custom properties.

                                                    • Re: MODEL PROPERTIES FROM DRAWING
                                                      Mike Flanders

                                                      The main reason for this is that all my old prints weren't done in the same method as the new ones. We save these in our ERP system under our part number and not the customers. We add an _1 behind it and that is the revision level in system. this is how it sees the correct one in the PDF folder. The main reason for this is that all my old prints weren't done in the same method as the new one. I have to always open up the model and add this property name with the proper _# . Its nice just going through the link button instead of always opening up the model itself. we could probably so it with a text box that pops up and I put in the Syteline revision _level and it adds it automatically to the model properties.  I'll attach your macro you did for me that when in a drawing it saves to our network location a PDF under the model properties Description "12345678" (not shown in illustration) with the added line #3 Syteline Revision "_1" . Could it be done that when we select this macro it opens up a text box that says "Syteline Revision Level" and I input an _# and it adds or overwrites the property name Line #3 with the value I input?

                                                       

                                                      property name.JPG

                                                        • Re: MODEL PROPERTIES FROM DRAWING
                                                          Fifi Riri

                                                          That was literally my previous question.

                                                          So you just need a simple macro with inputbox:

                                                          You can incorporate it in the PDF macro

                                                           

                                                          Option Explicit

                                                          Sub main()

                                                          Dim swApp As SldWorks.SldWorks

                                                          Dim swModel As SldWorks.ModelDoc2

                                                          Dim swDraw As SldWorks.DrawingDoc

                                                          Dim swView As SldWorks.View

                                                          Dim swCustProp As CustomPropertyManager

                                                          Dim myRev As String

                                                          Dim boolstatus As Boolean

                                                          Set swApp = Application.SldWorks

                                                          Set swDraw = swApp.ActiveDoc

                                                          Set swView = swDraw.GetFirstView

                                                          Set swView = swView.GetNextView

                                                          Set swModel = swView.ReferencedDocument

                                                          myRev = "_" & InputBox("Enter revision number")

                                                          Set swCustProp = swModel.Extension.CustomPropertyManager("")

                                                          boolstatus = swCustProp.Add3("Syteline Revision", swCustomInfoType_e.swCustomInfoText, myRev, swCustomPropertyAddOption_e.swCustomPropertyDeleteAndAdd)

                                                          'Dim myProp As String

                                                          'boolstatus = swCustProp.Get5("Syteline Revision", False, myProp, "", boolstatus)

                                                          'Debug.Print myProp

                                                          End Sub

                                      • Re: MODEL PROPERTIES FROM DRAWING
                                        Fifi Riri

                                        There is no build-in function to display this screen, even from the model.

                                        If you want a similar interface, you will have to create a gui with a datagridview and populate it with the custom properties of the model.

                                        If you only need to modify a specific property or create a new property, you can get away with a simple macro with some input boxes.