Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations IDS on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Equation evaluation order

Status
Not open for further replies.

ztraina

Mechanical
Jan 13, 2004
16
I am using several equations to drive the starting angles and lengths of a number of helices. I have about 6 equations that need to be evaluated in order, since the 6th uses a value generated in the 5th, and so forth.

Solidworks evaluates the equations in order, but does NOT rebuild the gemoetry after each equation (it waits until the end). This means that solidworks effectively evaluates all equations at the same time. The second equation can't reference parameters set in the first, because the parameters set in the first haven't been applied yet.

Example: If StartingAngle1 is at 90, and I apply the following equaionts:

1. StartingAngle1 = 0
2. StartingAngle2 = StartingAngle1+180

it evaluates to:

1. StaringAngle1 = 0
2. Starting Angle2 = 270 !!!! not 180


I have to rebuild again to correct StartingAngle2. help?
 
Replies continue below

Recommended for you

How about a more complex equasion? Or a one configuration design table just to fix the problem. Excel has better tools for fixing the ambiguities.

I was - and he did. So at least I didn't get coal.....
OK, OK, It's a reference to my holiday sig. "Be naughty - Save Santa a trip..."
 
I really need to be able to define a temporary variable. Is that possible?
 
What do you mean by a temporary variable?

I was - and he did. So at least I didn't get coal.....
OK, OK, It's a reference to my holiday sig. "Be naughty - Save Santa a trip..."
 
A new Example:

We start with angle1 = 0, angle2 = 90, angle3 = 180

My equations:

1. Angle1 = 90 evaluates to 90 (desired)
2. Angle2 = Angle1 + 90 evaluates to 90 (undesired, i wanted 180)
3. Angle3 = Angle 1 evaluates to 0 (undesired, i wanted 90)

If i could use temp variables, I could write a system of equations like so:

1. X = 90 evaluates to 90
2. Y = X + 90 evaluates to 180
3. Z = X evaluates to 90
4. Angle1 = X evaluates to 90 (desired)
5. Angle2 = Y evaluates to 180 (desired)
6. Angle3 = Z evaluates to 90 (desired)

evaluation of the first three variables is not dependent on the model gemoetry. After I've done all the calculation, I can set every value absolutley, with no interdependency.
 
Sounds like you need to use a DT (Design Table) Since you are wanting to not use geometry to help define something.

Regards,

Scott Baugh, CSWP [borg2]
CSWP.jpg

faq731-376
 
I agree that the better method would be DT's.

I have done a little investigation and I think I know where the problem lies, though I have not gone to the length of pinning it down in detail.

Your equations are using dimensions- in this case angular dims. When you have two lines and an angular dimension, there are a number of possibilities to how the dim is DISPLAYED. They depend on where the witness lines are placed. For example with 90, there are three quadrants that could have a 90 deg value in the dim TEXT and one that could have 270. However, mathmatically the smallest angle would be what the system would use for calculation ( since the ends are constrained by other things and there is no ambiguity. I suspect that the equation in your case is not necessarily using the actual value displayed in the TEXT of the dimension ENTITY on the sketch but the logical mathematical choice. So when you go, say, to 90+90, since the dim display (text location etc.)is already positioned, it reads 180, but infact the system says these lines are parallel so the math angle for calculation is 0.

I was - and he did. So at least I didn't get coal.....
OK, OK, It's a reference to my holiday sig. "Be naughty - Save Santa a trip..."
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor