cancel
Showing results for
Did you mean:
cancel
Showing results for
Did you mean:

Community Tip - Stay updated on what is happening on the PTC Community by subscribing to PTC Community Announcements. X

3-Visitor

## Help: how do i get Creo to allow negative values

Am I not understnding the syntax for allowing negative values?

I get the following error

d22=asin(1.4607*sin(d21))
errorInvalid attempt to assign negative value -0.875425deg to 'D22'. Precede the symbol with '\$' to allow negative value.

but after adding \$, I get the following error

\$d22=asin(1.4607*sin(d21))
errorInvalid left side of assignment

5 REPLIES 5
23-Emerald IV
(To:dramirez)

Your syntax is correct.  The dollar sign does get placed in front of the dimension name.  More than likely the value is not be valid, regardless of the fact that it is negative.  What happens if you remove the relation and manually try setting D22 to -0.875425 deg.  Does it fail?

3-Visitor
(To:TomU)

\$d22=-.875

Still give the l'invalid left sided of assignment' error

d22 is the angle between a sketch curve and the datum.

Doess Creo therefore only allow values between 0 and 360?

I may have to figure out an if statement to convert the angle to a positive value between 0 and 360

17-Peridot
(To:dramirez)

I think you just put in the negative value... and let the dimension respond to it.

3-Visitor
(To:dramirez)

it looks like 0-360 i the limit for angles.

So I went with the following, which seems to work.

/* CORRECT SIGN CHANGES
/* d22=asin(1.4607*sin(d21))
ang4=asin(1.4607*sin(d21))
If ang4 < 0
d22 = 360+ang4
else
d22 = abs(ang4)
endif

24-Ruby II
(To:dramirez)

@dramirez wrote:

Am I not understnding the syntax for allowing negative values?

I get the following error

d22=asin(1.4607*sin(d21))
errorInvalid attempt to assign negative value -0.875425deg to 'D22'. Precede the symbol with '\$' to allow negative value.

but after adding \$, I get the following error

\$d22=asin(1.4607*sin(d21))
errorInvalid left side of assignment

Hi,

set show_dim_sign yes

use notation \$dimensionname in relations

Martin Hanák
Top Tags