×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Contact US

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!

*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

IF statement with and

IF statement with and

IF statement with and

(OP)
Hello!

I would like to combine several curves in one curve in proe.

My idea was the following:

ang=t*360

x=t
z=0

IF ang>0 AND ang=<120
y=cos(ang)
ENDIF

IF ang>120 AND ang=<200
y=sin(ang)
ENDIF


etc.

but it doesn't work bcause of the "AND"

I hope you understand the problem.

Can you help me how can I solve this?

Thanks!

RE: IF statement with and

(OP)
Just to understand my aims:

I would like to use the curve later as control function of a part in creo mechanism.
So I would like to control the motion of a part with this function which is a sum of several curves.

RE: IF statement with and

I believe the syntax for logical AND is && but I am also pretty sure you cannot use if statements in curve equations.

Hope that helps and good luck,

RE: IF statement with and

I think it is a single '&' for comparisons. I'm pretty sure it's correct that IF/ENDIF are not allowed in sketches, but am looking for support.

From a reference: (| = or, & = and, ! = not, ~ = not)
The operators |, &, !, and ~ extend the use of comparison relations by enabling several conditions to be set in a single statement. For example, the following relation returns TRUE whenever d1 is between 2 and 3, but not equal to 2.5:

d1 > 2 & d1 < 3 & d1 ~= 2.5

***
One can create a graph that covers the domain (0-200) and use evalgraph() to return a value. The graph can have sharp corners, but needs to be continuous and have unique Y values for each X value.

RE: IF statement with and

(OP)
Thanks guys for the fast answers!

Since then I moved one step forward. Now I've started to solve my problem from the other and so I started to set up a serv motor in mechanism. I can see that it is possible to define the position by several curves using an expression an a time domain however I'm really getting pissed of because of the following:

the equatation for the curve is the following:

20/pi*((3*t*360)-sin(3*t*360))

I would like to use this between zero and 120°

I made it in excel, it is a nice NON LINEAR, growing curve.
But if I write this equatation to creo with 0 < t < 1
I get a linear curve which is non sense.

I'm simply not able to understand the problem (maybe I'm too tired...).

I've already started to make the curve in excel and import the points in a tab file, which seems to work, but I'm very anxious about why is that expression a linear curve in proe.

Any ideas?

Thanks!

RE: IF statement with and

Can you use a graph feature instead?

----------------------------------------

The Help for this program was created in Windows Help format, which depends on a feature that isn't included in this version of Windows.

RE: IF statement with and

It's not an equation until there's an equals sign. What Coordinate system type is being used and what are the entire set of equations? If the curve is a straight line, there's is something wrong.

As to the range: if you want 0 < t < 1 to map to 0 < theta <120 then use theta = 120*t

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! Already a Member? Login



News


Close Box

Join Eng-Tips® Today!

Join your peers on the Internet's largest technical engineering professional community.
It's easy to join and it's free.

Here's Why Members Love Eng-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close