• Industries
  • Products
  • Buy
  • Services & Support
  • Communities
  • Discussion Groups

    AutoCAD Civil 3D

    Reply
    *Expert Elite*
    Posts: 6,207
    Registered: ‎11-18-2006

    Expression Bug

    113 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
    Please use plain text.
    *Jeff Mishler

    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
    Please use plain text.
    Employee
    Matt.Anderson
    Posts: 2,842
    Registered: ‎05-13-2005

    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
    Business Consultant
    Global Services
    Autodesk, Inc.

    Please use plain text.