28 Replies Latest reply on Aug 22, 2018 11:33 AM by Christian Chu

    Inserting Formulas/Equations in Custom Property Tab Builder - Custom Tab

    John Stoltzfus

      Here we use an Excel Spreadsheet to calculate our Cutlist and the information is inserted manually.  What I suggested we try to do is create a Part Template file and use the Custom Properties that are already in SolidWorks rather then having someone retype Descriptions, Part and Assembly information.  Plus use the Bounding Box information to update our Cutlist accordingly, so that when we choose certain custom properties that the length and thicknesses are calculated automatically.  All of our Panels are processed in our Rogh Mill, where they cut the boards to length and rip the boards to width, run them through a Glueing Machine and then they put them in a Clamp Carrier to dry.  To process the order they need the finish size of the panel and they add 1/2" to the width and 3/4" to the length, so the Cut List spreadsheet was supposed to take the inserted size and calculate the final cut size to our Mill Department, plus panels need to be a little thicker for final sanding.

       

      We do have (9) Part ID designations and depending on the choice it could change the final thickness, width and length, plus we take the Bounding Box thickness and add 1/4" and then divide then total by 1/4" and round up one, this tells the Mill Dept which Quarter Size of Lumber they need to start with.

       

      So my question is...

       

      Can I setup a Part Template file with all those formulas in the Custom Tab in the Custom Properties - see the attached Sample Part, (check the Custom Properties) and the Excel Spreadsheet that the one gut was putting together here.  The spreadsheet needs additional work to fully function, but the formulas are there....

       

      Attached is a sample part, the excel spreadsheet and the Custom Property Tab Builder file that I use.

       

      Thank you in advance for taking a look..

        • Re: Inserting Formulas/Equations in Custom Property Tab Builder - Custom Tab
          Frederick Law

          What I did in the other CAD system.

          I add 3 custom properties to part template: Length, Width, Height.

          Once I finish modeling the part, I set them to the dimension: =d1 or =d1+0.25.  Or add Cut Length, Cut Width, Cut Height properties.

          Sometime I add driven dimension to get the dimension I need.

          If part has flat pattern, I add sketch with projected edge to flat and add driven dimension there.

          I then use them in BOM.  Export BOM to xls when needed.

          • Re: Inserting Formulas/Equations in Custom Property Tab Builder - Custom Tab
            David Matula

            Would or could this be something that DriveWorks can handle?

            • Re: Inserting Formulas/Equations in Custom Property Tab Builder - Custom Tab
              Dave Bear

              I'd love to take a look, just as well that it's probably out of my league anyway!

               

              Dave.

              • Re: Inserting Formulas/Equations in Custom Property Tab Builder - Custom Tab
                John Stoltzfus

                Ok – here is a little twist to the tale, I noticed a post by Igor Fomenko - https://forum.solidworks.com/message/881163 and that is the direction that I’ve gone but that has issues which I’ll try to explain below.

                 

                The “Ultimate Goal” is to create an equation right in the Custom Property Tab here

                 

                 

                Not here (the Configurations Specfic Tab)

                 

                 

                 

                So what I did was saved an Excel File with the formula that we are using manually and having that open off to the side. Then I opened a new part and just drew a rectangle and extruded it, then I added the Bounding Box and a Design Table.  I copied all the stuff over from the Excel spreadsheet and closed it and did a rebuild and what happens is all of the Design Table data return goes directly to the Configurations Specific Tab and not the Customs Tab.  Sending all the information there creates issues for me downstream in our workflow, because number one, the Task Scheduler doesn’t allow you to update Configuration Specific properties, only custom properties in the Customs Tab, plus my main macro would need to be changed and I want to avoid that totally.

                 

                What I want is to be able to apply the formula required right in the Custom Tab and in my part template, the question is where do I calculate that information?  I didn’t try the equations yet, that is another option.

                 

                I was able to set it up using the design table, however the information return was only a two decimal place number instead of a three decimal place number..

                 

                So what I need is…… When I extrude a part or loft or whatever, the Bounding Box returns Thickness, Width and Length and I can use those values to create an automatic return for our Cutlists, we have one called Mill and another called TSaw and it makes a difference if the material is a PANEL, or a S4S RAZ or PLY etc, the thickness also changes if it’s a RAZ or Panel etc, this leaves enough of material for sanding after certain operations. The PART ID needs to drive most of those returns

                 

                Anytime you use a design table this way you can run into rebuild issues, where changes are made and the rebuild doesn’t work correctly, unless you edit the Design Table…

                 

                 

                 

                 

                I really want to make the changes here (if needed) - Custom Property Tab Builder

                 

                 

                 

                 

                • Re: Inserting Formulas/Equations in Custom Property Tab Builder - Custom Tab
                  David Matula

                  looks like your getting there.  Good luck.

                    • Re: Inserting Formulas/Equations in Custom Property Tab Builder - Custom Tab
                      Igor Fomenko

                      I don`t understand the situation clearly but

                      Why don`t you create several templates, one for each type of part?

                      or

                      Why don`t you use equations (may be in file) to link them to properties?

                        • Re: Inserting Formulas/Equations in Custom Property Tab Builder - Custom Tab
                          John Stoltzfus

                          Igor Fomenko  wrote:

                           

                          I don`t understand the situation clearly but

                          Why don`t you create several templates, one for each type of part?

                          or

                          Why don`t you use equations (may be in file) to link them to properties?

                          Igor Fomenko

                           

                          That is exactly what I want to do, I've tried to take the Excel formula  and change the information like the Cell names to SW Custom property names...

                           

                          Example - L3 (to SW-Bounding Box Thickness) etc.  but that don't work.  So basically what I want is if the Part ID custom property is PANEL then I need to add .004" to the thickness for final sand and if the Part ID custom Property is S4S RAZ then I need to add .031" to the thickness for final sand, otherwise everything else returns the actual SW-Bounding Box Thickness.

                           

                          The Quarter Size reads the SW-Bounding Box Thickness and adds 1/4" or .250" and divides it by .25 then rounds it "Up" to the nearest 1, so a finish board being 1.125" it takes the 1.125 and add .25 which makes it 1.375" thick and then when you divide by .25 it returns 5.5 so when you round up it would tell our Mill Department to use 6 Quarter Lumber to start their process.

                           

                          The formula from Excel - Quarter Size cell is below and the Part ID choice - PLY ASM SQUARE MOLD or PURCH and the value return is 0.

                           

                          =IF(L3>0,IF(OR(B3="PLY",B3="ASM",B3="SQUARE"),0,IF(OR(B3="MOLD",B3="PURCH"),0,IF(L3>=0.8125,IF(MROUND(L3+0.1875,0.25)/0.25=7,8,MROUND(L3+0.1875,0.25)/0.25),4))),"")

                           

                          I've tried to replace the L3 with SW-Bounding Box Thickness and the PLY and other Part IDs' with Part ID "PLY" etc and no success, which isn't surprising for me because I don't do formulas very easily, but show me one that works and I think I can take it further. 

                           

                          The ultimate plan is to have these formulas in my Part Template file so that when I extrude the model the Cutlist is starting to form..

                           

                          Thanks

                           

                          John

                            • Re: Inserting Formulas/Equations in Custom Property Tab Builder - Custom Tab
                              Dan Pihlaja

                              OK John....I did a little test.

                               

                              It turns out that you can assign your custom properties a type.  So if you assign your PartID the type "Number", then you can use that Custom Property in your Global Variables and in equations inside Global Variables.

                               

                              So, here is my suggestion:

                              Instead of a drop down menu in your Property Tab Builder, have the PartID be a set of Radio Buttons. 

                               

                              Then, inside your Custom Proerties, assign the PartID type to be "number"

                               

                              Now, you can use this in a Global Variable equation.

                               

                              In my part, I have a Custom Property that is assigned using the Property Tab Builder called "NumberRequired".

                               

                              Then, in my Global Variables, I have this:

                               

                              Then, I created a line and a dimension for its length and made it equal to Variable Test2.  Then went into my Property Tab builder and started changing the number:

                               

                              Once I change the number....after a rebuild, it updates the line.   I assume that you can do something similar. 

                               

                              So the key behind using the Custom Property field to assign your property to be a number and then use that number in your global variable equations.

                               

                              As far as Changing SW-Bounding Box Thickness.....

                              Isn't that driven by a dimension in your model already?   Why not just use your equation to update that dimension....?

                                • Re: Inserting Formulas/Equations in Custom Property Tab Builder - Custom Tab
                                  Christian Chu

                                  Thanks, @Dan

                                  I was not aware of the feature which you can link CusProp to equations without using API for it

                                  Just a new thing to learn today !

                                  • Re: Inserting Formulas/Equations in Custom Property Tab Builder - Custom Tab
                                    John Stoltzfus

                                    Dan Pihlaja - My head hurts - you see there are things I need to "See" then I can get it, but it has to be close to what I need etc and then a light will light and I'm on a roll, till then my mind is a fog for stuff like this.  I could never figure out a riddle, I doesn't matter how simple and I think that is part of my issue.

                                     

                                    Initially I did use the Radio Buttons, then I replaced it with a List and a dropdown to select the choices, I think it is because with the Radio Buttons you can't overwrite the values...

                                     

                                    The final Goal is to have everything within the Part Template file and go from there.

                                     

                                    There is one thing that I noticed that is different between Excel and SW equations and that is; In the Excel formula everything is tight together, where in the SW equation line, there are spaces and if someone could give me specific direction there, I think I could get it, plus how do you call, like the SW-Bounding Box Thickness??

                                     

                                    Dan Pihlaja - I had said "can" overwrite the values, should be "can't"....

                                      • Re: Inserting Formulas/Equations in Custom Property Tab Builder - Custom Tab
                                        Dan Pihlaja

                                        John Stoltzfus wrote:

                                         

                                        Dan Pihlaja - My head hurts - you see there are things I need to "See" then I can get it, but it has to be close to what I need etc and then a light will light and I'm on a roll, till then my mind is a fog for stuff like this. I could never figure out a riddle, I doesn't matter how simple and I think that is part of my issue.

                                         

                                        Initially I did use the Radio Buttons, then I replaced it with a List and a dropdown to select the choices, I think it is because with the Radio Buttons you can overwrite the values...

                                         

                                        The final Goal is to have everything within the Part Template file and go from there.

                                         

                                        There is one thing that I noticed that is different between Excel and SW equations and that is; In the Excel formula everything is tight together, where in the SW equation line, there are spaces and if someone could give me specific direction there, I think I could get it, plus how do you call, like the SW-Bounding Box Thickness??

                                        You can still overwrite the values (if you go into Custom Properties and do it) even with a drop down menu.  Its just that, when you hit apply again in the property tab builder, then it brings it back to what the builder is set to.

                                         

                                        Let me try something.....stay tuned

                                        • Re: Inserting Formulas/Equations in Custom Property Tab Builder - Custom Tab
                                          Dan Pihlaja

                                          OK, look at the attached part.

                                           

                                          From Property Tab Builder - 2 Properties defined.

                                           

                                          User sees this:

                                           

                                           

                                          Creates these Custom Properties inside the part:

                                           

                                          Equations from the part:

                                           

                                          So, save this part, as is, as a part template.

                                           

                                          When you use this part as a part template, you can open the Custom Properties Tab from the Task Pane and type in your Finish board thickness....then select the Part ID.   If the Part ID is "PANEL", then .004" is added to the thickness of the board.  If it is "S4S RAZ", then 0.031" is added to the thickness of the board.   If it is anything else, then 0" is added to the thickness of the board.  (all after an update, of course).

                                           

                                          This si all taken care of inside the part template and no links to outside files is created.

                                           

                                          Maybe this will help you?

                                            • Re: Inserting Formulas/Equations in Custom Property Tab Builder - Custom Tab
                                              John Stoltzfus

                                              Dan Pihlaja - That is what I'm looking for - something inside the part file that is an automatic calculation... Unfortunately I'm not at work right now, so tomorrow is going to be the test.  Within the cutlist there are other equations that I need to figure out as well. 

                                               

                                              Thank you for your time on this

                                              • Re: Inserting Formulas/Equations in Custom Property Tab Builder - Custom Tab
                                                John Stoltzfus

                                                Dan Pihlaja wrote:

                                                 

                                                 

                                                When you use this part as a part template, you can open the Custom Properties Tab from the Task Pane and type in your Finish board thickness...

                                                 

                                                My workflow is mainly to Extrude Up To either a point, line or Plane, there for in my part files there are no dimensions shown when you double click on a sketch, so I wouldn't have that option..

                                                 

                                                The process thought was to use the Bounding Box returns, such as length, width and thickness. 

                                                 

                                                  • Re: Inserting Formulas/Equations in Custom Property Tab Builder - Custom Tab
                                                    Dan Pihlaja

                                                    OK, so I am not sure how to grab the bounding box returns in excel.....BUT you wouldn't be able to modify them anyway, would you?  Those values are driven by other things....like sketches and whatnot.

                                                     

                                                    So let me get this straight in my head:

                                                    Correct me if I am wrong

                                                    You want to do the following:

                                                    1) Have a part that is controlled by an external sketch (pursuant with the skeleton sketch method)

                                                    2) Insert a bounding box for that part

                                                    3) Use the bounding box values to drive criteria (formulas) inside a design table or the global variables, or wherever, in which a check is made on the PartID and the Thickness of the part.

                                                    4) Once the check is made, you want to add .004" (for example) to the thickness of the part, if that PartID is labeled as Panel

                                                    5) However, your dilemma is that, since the part size is driven from outside the part, and the bounding box is driven by the part size....you can't just edit a dimension to change thickness....you would either have to edit the external dimension (not impossible...but would require some serious finagling) OR you would have to add material to the part.

                                                     

                                                    As far as using the Bounding box thickness in an equation or a custom property.....I don't think that it can be done.

                                                    I didn't test inside a design table.  Maybe you can.  Here are some Syntax's that I found...that may work (I tried both of these in a BOM, inside equations and inside Custom Properties with no luck):

                                                    SW-Thickness

                                                    $PRPWLD:"3D-Bounding Box Thickness"

                                                     

                                                    To show you where I found those syntax's....

                                                    SW-Thickness, I found here:

                                                     

                                                    And the other one.....apparently you can link the thickness inside a note:

                                      • Re: Inserting Formulas/Equations in Custom Property Tab Builder - Custom Tab
                                        Christian Chu

                                        John Stoltzfus

                                        I suggest to create a template with all formulas in the equations so the model will be automatically updated accordingly. then you can use a simple macro to link the equation to the CusProp

                                        EDIT: I should read thru all the messages, @igor already suggested it to you

                                        • Re: Inserting Formulas/Equations in Custom Property Tab Builder - Custom Tab
                                          John Stoltzfus

                                          Can you open 2018?

                                           

                                          The way it works right now is adding a design table into the part file, also insert the Bounding Box which will return these values -

                                           

                                           

                                           

                                          This how I'm doing it at the moment, but would have liked to have everything in the Equations, because I think the rebuild issues that you create using Design Tables, would be gone..

                                          • Re: Inserting Formulas/Equations in Custom Property Tab Builder - Custom Tab
                                            Peter Brinkhuis

                                            My approach to capturing this kind of company-specific knowledge is to create an add-in.

                                             

                                            That way you don't need an external Excel file, a custom property tab builder or a design table and you don't have to mess with these long and unclear Excel formulas.

                                              • Re: Inserting Formulas/Equations in Custom Property Tab Builder - Custom Tab
                                                John Stoltzfus

                                                Peter Brinkhuis - I would love to have something like that - but that's asking a lot from a Hick in the Sticks - I know there are a lot of better ways to do things, however this stuff is just best being figured out by people that really know how.  I enjoy doing simple Excel formulas, but today's 2nd graders are probably better then me.  Oh well, I got my needs covered temporarily, eventually someone will have a perfect solution.  Attached is a Screen Shot video that I took showing what I need to do with every part and every change, really, it's pretty lame.  I know this isn't a long term solution, therefore I don't have any issue using it for the time being..

                                                  • Re: Inserting Formulas/Equations in Custom Property Tab Builder - Custom Tab
                                                    Christian Chu

                                                    John Stoltzfus wrote:

                                                     

                                                    Peter Brinkhuis - I would love to have something like that - but that's asking a lot from a Hick in the Sticks - I know there are a lot of better ways to do things, however this stuff is just best being figured out by people that really know how. I enjoy doing simple Excel formulas, but today's 2nd graders are probably better then me. Oh well, I got my needs covered temporarily, eventually someone will have a perfect solution. Attached is a Screen Shot video that I took showing what I need to do with every part and every change, really, it's pretty lame. I know this isn't a long term solution, therefore I don't have any issue using it for the time being..

                                                    For sure my kids know iPhone's features  better than me