SolidWorks BOM & equations with 3 or more variables.
SolidWorks BOM & equations with 3 or more variables.
(OP)
The following equation works in SolidWorks to set QTY to FT or just plain QTY.
={2}IF('UoM'="FT";(`Total_Length`/12)" FT";'QTY')
The following also works to put in a quantity of 0 for a property of UoM =’s “NA” or just plain QTY.
={2}IF('UoM'="NA";"0";'QTY')
Does anyone know how to combine the 2 equations to give answers to 3 properties for UoM which are FT, EA and NA.
I have searched here and the web with no luck. I could not find it in the SolidWorks help manual.
={2}IF('UoM'="FT";(`Total_Length`/12)" FT";'QTY')
The following also works to put in a quantity of 0 for a property of UoM =’s “NA” or just plain QTY.
={2}IF('UoM'="NA";"0";'QTY')
Does anyone know how to combine the 2 equations to give answers to 3 properties for UoM which are FT, EA and NA.
I have searched here and the web with no luck. I could not find it in the SolidWorks help manual.
Bradley






RE: SolidWorks BOM & equations with 3 or more variables.
RE: SolidWorks BOM & equations with 3 or more variables.
Thanks for the reply. I have been trying all kinds of syntax for nesting, with no luck at all. This is the last formula I have tried. Do you have any suggestions?
={2}IF('UoM'="EA";('UoM'="FT";(`Total_Length`/12)" FT";('UoM'="NA";'0')'QTY')
Bradley
RE: SolidWorks BOM & equations with 3 or more variables.
={2}IF('UoM'="EA";'QTY';IF('UoM'="FT";('Total_Length'/12)" FT";IF('UoM'="NA";"0";"?")
The "?" will be returned if the input is anything other than "EA", "FT" or "NA". It can be substituted by any character or left blank as "".
RE: SolidWorks BOM & equations with 3 or more variables.
RE: SolidWorks BOM & equations with 3 or more variables.
I tried to follow
explanation from SW2006 Help, but I am getting syntax errors - I suspect the sample is wrong.
I must add some years ago I was doing some programming in Basic (NOT VisualBasic), also in Assembler and in C and I do understand the following:
IF
THEN
ELSE
ENDIF
Could anybody vrite some simple IF that could be used in the SW equation - that would get me started.
Thanks in advance.
RE: SolidWorks BOM & equations with 3 or more variables.
I wish I could give you both more than one star. You helped me a great deal with this problem. Once I knew where to go (with your help) I came up with the following:
={2}IF('UoM'="EA";'QTY';IF('UoM'="FT";('Length'/12)" FT";IF('UoM'="NA";"0";'QTY')))
I changed the ? to QTY because lots of our models never got a UoM property. Also added a couple of ).
Thanks again for the help.
Bradley
RE: SolidWorks BOM & equations with 3 or more variables.
jacek0814 ... that equation works OK for me. Are you using a model with suitable sketches and dimensions.
i.e. one with at least 4 sketches and a D1 dimension in at least Sketch1 and Sketch4?
RE: SolidWorks BOM & equations with 3 or more variables.
I tried changing IF to IIF and the semi-colons to commas.
={2}IIF('UoM'="EA",'QTY',IIF('UoM'="FT",('Length'/12)" FT",IIF('UoM'="NA","0",'QTY')))
That did not work for me. SolidWorks just put the formula in QTY box. The following is working so I think I will leave it at that.
={2}IF('UoM'="EA";'QTY';IF('UoM'="FT";('Length'/12)" FT";IF('UoM'="NA";"0";'QTY')))
Thanks so much for your help.
Bradley
RE: SolidWorks BOM & equations with 3 or more variables.
RE: SolidWorks BOM & equations with 3 or more variables.
I really like this SolidWorks BOM better than Excel.
Bradley
RE: SolidWorks BOM & equations with 3 or more variables.
Finally got it working - thanks for the help.
BTW, my confusion was also that IIF - I thought that's a typo, I thought it should be IF.
Second thing - I have to use , if I use ; it reports syntax error ...
RE: SolidWorks BOM & equations with 3 or more variables.
RE: SolidWorks BOM & equations with 3 or more variables.
I tried to find this information in the SolidWorks 2007 Online User’s Guide – SP0.0.
How do you learn these things? All I found in User’s Guide is the following:
Bradley
RE: SolidWorks BOM & equations with 3 or more variables.