AutoCAD Civil 3D General Discussion

AutoCAD Civil 3D General Discussion

Reply
*Expert Elite*
Sinc
Posts: 6,207
Registered: ‎11-18-2006
Message 1 of 3 (121 Views)

Expression Bug

121 Views, 2 Replies
02-28-2009 07:47 AM
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
*Jeff Mishler
Message 2 of 3 (121 Views)

Re: Expression Bug

02-28-2009 09:06 AM 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
Employee
Matt.Anderson
Posts: 2,909
Registered: ‎05-13-2005
Message 3 of 3 (121 Views)

Re: Expression Bug

03-01-2009 08:05 PM 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
Product Manager
Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.
Need installation help?

Start with some of our most frequented solutions or visit the Installation and Licensing Forum to get help installing your software.