## 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!

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

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

Hope that helps and good luck,

## RE: IF statement with and

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

Note:

You cannot use the following statements in an equation that defines a datum curve: abs, ceil, floor, else, extract, if, endif, itos, and search.

## RE: IF statement with and

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

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

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

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