26 Replies Latest reply on Jun 1, 2018 11:40 AM by Greg Hertvik

    Chunking Up Properties

    Michael Ferraro

      All,

       

      I have a opportunity here, that I am struggling to solve.

       

      I have a part with a sketch that has a dimensioned length attached to a construction line (that is driven). It is rounding to the nearest 32". I would like to somehow break that into to properties within the part if possible.

       

      If that length of that line was lets 92.15625 long then the Major Length would be "092" (for 92 inches) and the Minor Length would be "05" (for 5/32).


      Is there any way to do that without configurations? I can absolutely do this if I create configurations, but I was hoping to dodge making a configuration from 12.00 to 120.000 in 32 increments (3400+ configurations).

       

      I can explain what it is needed for or why I am doing it if needed.

       

      Thanks,

       

      Pencil

        • Re: Chunking Up Properties
          Nilesh Patel

          Could you attach your part and then try to explain in detail what do you mean by Major length and Minor length?

            • Re: Chunking Up Properties
              Michael Ferraro

              I can here we go.

               

              We have an ERP system that was recently implemented which caused a couple opportunities to be had. One of which is parts that get cut to length. There is only one field for "Quantity" so my thought was to put the length in the part number (in this case like SP-0001-092-05 which would stand for 92 and 5/32 long). And then the quantity could be how many I need at that length since there is not another field.

               

              What we have been doing up to this point is so that we can get the total material requirement would would just multiply the 2 numbers together and put that in the quantity field and then just make a spreadsheet on the side for the breakdown. I am trying to eliminate that step.

               

              The goal is to take the length of the part and create its part number. The resulting combination would go into a custom property called "Supplier Part Number"

               

              So here are two examples

              Length = 120"

              Major Length = 120

              Minor Length = 00

              Supplier Part Number = SP-0001-120-00

               

              Length = 92.15625"

              Major Length = 092

              Minor Length = 05

              Supplier Part Number = SP-0001-092-05

               

              Does that make sense?

                • Re: Chunking Up Properties
                  Glenn Schroeder

                  It makes sense, sort of, but I don't think you're going to be able to do that (unless maybe a macro?).  Why not just let your Supplier Part Number be SP-0001-092.15625?

                    • Re: Chunking Up Properties
                      Michael Ferraro

                      That is currently my back up plan.

                       

                      Our part number field has a 17 character limit (dumb I know). The set up I listed (SP-0001-AAA-BB) is 14 characters. The one you just listed is 17, which obviously works I was just trying to see if I could keep a small buffer in there in the event something came up and I needed to steel some more characters.

                       

                      However, I wasn't sure I knew how to keep it to be AAA.BBBBB. I thought the part number would end up being different lengths i.e.

                       

                      SP-0001-24

                      SP-0001-24.03125

                      SP-0001-24.0625

                      SP-0001-24.125

                       

                      etc.

                       

                      Is there a way to keep it to SP-0001-AAA-BBBBB?

                       

                      Thanks,

                      Pencil

                        • Re: Chunking Up Properties
                          Glenn Schroeder

                          Michael Ferraro wrote:

                           

                          That is currently my back up plan.

                           

                          Our part number field has a 17 character limit (dumb I know). The set up I listed (SP-0001-AAA-BB) is 14 characters. The one you just listed is 17, which obviously works I was just trying to see if I could keep a small buffer in there in the event something came up and I needed to steel some more characters.

                           

                          However, I wasn't sure I knew how to keep it to be AAA.BBBBB. I thought the part number would end up being different lengths i.e.

                           

                          SP-0001-24

                          SP-0001-24.03125

                          SP-0001-24.0625

                          SP-0001-24.125

                           

                          etc.

                           

                          Is there a way to keep it to SP-0001-AAA-BBBBB?

                           

                          Thanks,

                          Pencil

                           

                          You could try setting trailing zeros to "Show" at Tools > Options > Document Properties > Dimensions, but I'm not sure it would carry over.

                           

                          Jeff Mirisola  wrote a very good blog post a few years ago about trying to make file names too fancy.  I wish I could link to it, but it's no longer active.

                  • Re: Chunking Up Properties
                    Jim Steinmeyer

                    This sounds like what you are looking for is a Cut List. If you create your parts as a weldment your part number would be the shape  with the length attached. You are able to add additional properties if wanted and you can create custom shapes that would have custom descriptions for the first part of the part number if desired. Glenn Schroeder can talk more about as I do not use them as cut lists do not work for us.

                    • Re: Chunking Up Properties
                      Greg Hertvik

                      Which part are you having trouble with, creating the desired values for AAA & BB or inserting the values into a part number (or both)?

                        • Re: Chunking Up Properties
                          Michael Ferraro

                          The two options are as follows:

                           

                          SP-0001-AAA-BB

                          or

                          SP-0001-AAA.BBBBB

                           

                          I can do the 2nd one easily (with it actually looking like SP-0001-AA.BBBBB, then SP-0001-AA.BBBB, etc)

                           

                          I would LOVE if I can do the first one, but I haven't had a solution that works without configurations / code both of which I would like to dodge. I try to avoid smart numbers here whenever possible however, I can solve like 5 problems at once on this part in doing so, so its worth the investigation.

                           

                          The problem I am having is creating the AAA and BB in the first option. Once I create both of those values in a custom property I can handle the rest without issue. I just don't know how to make the AAA property or the BB property.

                            • Re: Chunking Up Properties
                              Nilesh Patel

                              Hi Michael,

                               

                              Have a look at the attached part. I can get "92" and "5". I will play around to see if I can get "092" and "05". Have a look at the custom properties and equation manager.

                               

                              Regards,

                              Nilesh

                                • Re: Chunking Up Properties
                                  Michael Ferraro

                                  o man that is awesome. That is closer than I have gotten that may just be the answer. I will do some testing but I think you may have it!

                                  • Re: Chunking Up Properties
                                    Casey Bergman

                                    Can you explain what you did for those of us still using older versions of Solidworks?

                                      • Re: Chunking Up Properties
                                        Greg Hertvik

                                        I have not opened Nilesh's part but one way to do it is through the following equations:

                                         

                                        Assume "Length" is the length of the part that we want broken down into two segments.

                                         

                                        X=int ("Length")          [returns the value left of the decimal, in this case 92]

                                        Y=("Length"-"X)*32     [returns the numerator of the fraction over 32.  You can take it a step further & add" int()" to it, for instances of decimals that don't evenly divide into 32, i.e. .105 would return 3]

                                         

                                        The trick is, and I have not been able to do it thus far, is to add the leading "0" to the number.  My attempts via a design table do not auto-update & I haven't been able to make the properties smart enough to know how many "0" it needs yet.

                                          • Re: Chunking Up Properties
                                            Michael Ferraro

                                            That is what he did. I am also trying to see if I can get the zeroes in and have been unsuccessful. I can do it with the "0"'s in the design table but since it doesn't automatically update it doesn't do me any good.

                                             

                                            So I am still trying to figure out how to do it in properties.

                                              • Re: Chunking Up Properties
                                                Greg Hertvik

                                                I GOT IT!

                                                I tried a few length combo's, you may want to try some more to stress test it, but this concept should do the trick. You also may want to add an additional variable for "int(D1@Sketch1)" as it's used several places.  I had to add 3 of those "int"s after 99.9 would turn into 100 for AAA.

                                                 

                                                I also added a Denominator variable, so the BB sizing could be done by 1/4, 1/8, 1/32, 1/10, etc. for different parts.

                                                 

                                                For those who don't want to be bothered downloading the file &/or do not have 2017, here is a picture of the variables & Properties (99 29/32" shown):

                                                 

                                                Variables.JPG

                                                 

                                                Properties.JPG

                                                 

                                                Phew!

                                                 

                                                This was a good learning exercise for myself as well.

                                                 

                                                Edit:

                                                Here's what I did:

                                                Instead of adding zero's in front of the number, I broke the number down into 1 digit parts.  There is a hidden round function not listed in SW but it can only round to a specific decimal, so I could turn 47.65 into 47.7, but couldn't turn it into 50.  To work around that, I divided the number by it's know max digits, so 47.65 would turn into .4765 before rounding.  thus we can round to .5 & then multiply by 10 to get the single digit of 5.  But in that example, we want the answer to be 4, so the int command is used.  Lastly, I would subtract the leading digit from the total number to get the next digit, i.e. 47.65-40 = 7.65 & then repeat the above processing.