Community
Civil 3D Forum
Welcome to Autodesk’s Civil 3D Forums. Share your knowledge, ask questions, and explore popular AutoCAD Civil 3D topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Expression Bug

2 REPLIES 2
Reply
Message 1 of 3
Sinc
207 Views, 2 Replies

Expression Bug

Anyone ever noticed this?


Assume we have a point with elevation 1234.56.


Using this expression:

{Point Elevation}-(TRUNC({Point Elevation}/100)*100)

returns a result of 34.56.


But using *this* mathematically-identical expression:

{Point Elevation}-(100*TRUNC({Point Elevation}/100))

returns a value of 1134.56.

(Tested in C3D 2008 & 2009.)

-- Sinc
http://www.ejsurveying.com
http://www.quuxsoft.com
Sinc
2 REPLIES 2
Message 2 of 3
Anonymous
in reply to: Sinc


Yes, I've seen this before with other expressions. It seems like the
Expression evaluator expects things in a certain order, mix that order up and
just the first item is evaluated.

 

Attached is a pic showing the results that you've discovered.

 

Whenever I create an expression now, I make sure to double & triple
check the results before accepting it for use.


style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
Anyone
ever noticed this? Assume we have a point with elevation 1234.56. Using this
expression: {Point Elevation}-(TRUNC({Point Elevation}/100)*100) returns a
result of 34.56. But using *this* mathematically-identical expression: {Point
Elevation}-(100*TRUNC({Point Elevation}/100)) returns a value of 1134.56.
(Tested in C3D 2008 & 2009.) -- Sinc http://www.ejsurveying.com
http://www.quuxsoft.com
Message 3 of 3
Matt.Anderson
in reply to: Sinc

Yes, expressions have returned odd results based on the order of operation. I haven't checked if that got fixed in v3.1 (sp2.1)
Matthew Anderson, PE CFM
Product Manager
Autodesk (Innovyze)

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Rail Community


 

Autodesk Design & Make Report