Equation math question
Equation math question
(OP)
I freely admit that math is not my strong suit. What I would like to know is how would I use a length dimension to control a angle dimension. For example, how would I apply a formula in the Equation Editor that takes a 1" length dimension and use it to control an angle dimension so that the angle dimension equals 45 degrees and a 2" length dimension so that the angle dimension equals 60 degrees. Seems like I need some kind of formula to do this. Is there a book that contains math formulas like these?






RE: Equation math question
Deepak Gupta
SW 2010 SP4.0 & 2011 SP3.0
Boxer's SolidWorks™ Blog
RE: Equation math question
If it is linear like 1in->45deg, 2in->60deg, 3in->75deg, then the equation is y=m(x)+b or "D2@Sketch1"=15*"D1@Sketch1"+30 where D2 is angle and D1 is length.
RE: Equation math question
RE: Equation math question
This says, if length=1, angle is 45, otherwise it is sixty.
Notice the angle will be 45 ONLY IF length is exactly equal to 1.
Don't know if this exactly meets your needs or not. If statements can be nested:
=if(L<1,30,if(L=1,45,60))
This says if length is less than 1, angle is 30, if length equals 1, angle is 45, if length is greater than 1, angle is 60.
Help is available in Excel.
Equation editor in SW has an if statement available, but for complex conditions you might be better off with Excel.
Regards,
Mike
RE: Equation math question
Open Excel, go to Help > Microsoft Excel Help and type IF function in the Search field for more information.
RE: Equation math question
"D2@Sketch1"=iif("D1@Sketch1"like 1,45,iif("d1@sketch1" like 2, 60, 10))
meaning set D2 to the following...
if D1 = 1, set D2 to 45
or else
if D1 = 2, set D2 to 60
or else (if D1 is not 1 or 2), set D2 to 10
(D2 is angle, and D1 is length)
RE: Equation math question
"D2@Sketch1"=iif("D1@Sketch1"like 1,45,iif("d1@sketch1" like 2, 60, 10))
I tried to make it even simpler to see if I could just get the "if" statement to work. I came up with this:
CylinderDiameter@Sketch1" = if("CylinderDepth@Cylinder"1,2, if("CylinderDepth@Cylinder" 2,3))
I get this error message:
"Equation entered is invalid"
RE: Equation math question
Deepak Gupta
SW 2010 SP4.0 & 2011 SP3.0
Boxer's SolidWorks™ Blog
RE: Equation math question
-handleman, CSWP (The new, easy test)
RE: Equation math question
Are you creating this equation in the Equations folder (use IIF) or Design Table (use IF)?
RE: Equation math question
Everything works now. I'm creating equations in the Equation Editor.
Where can I read more about the language and the syntax used for the Equation Editor? Are there any tutorial available with plenty of examples? Thanks to everyone who offered help.
RE: Equation math question
-handleman, CSWP (The new, easy test)