×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Equation evaluation order

Equation evaluation order

Equation evaluation order

(OP)
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?

RE: Equation evaluation order

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..."

RE: Equation evaluation order

(OP)
I really need to be able to define a temporary variable. Is that possible?  

RE: Equation evaluation order

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..."

RE: Equation evaluation order

(OP)
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.

RE: Equation evaluation order

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..."

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources