Results 1 to 4 of 4

Thread: Variable rounded results

  1. #1
    Member
    Join Date
    2013-03
    Posts
    2
    Login to Give a bone
    0

    Default Variable rounded results

    Hi first time posting here.
    This may be a stupid question but I can't figure it out.
    d1 = 97.097
    lisp
    (setq test (* d1 39.3700787401574)
    returns 3822.72

    on the calculator however is get
    3822.71653543307083556

    so i'm trying to work out why i'm getting the results rounded to 2 places

    lunits are ste to 2
    luprec is set to 8
    dimzin is set to 0

    the actual line of code is to pick a line place the length in meters into "d1" and display the result in a dialog box in architectural format
    i should get 318' 6-11/16"
    but because of the rounding I only get 318'6"

    regards Miles

  2. #2
    Administrator rkmcswain's Avatar
    Join Date
    2004-09
    Location
    Earth
    Posts
    9,803
    Login to Give a bone
    0

    Default Re: Variable rounded results

    It's only returning the result to the precision you have set in your settings.
    Don't worry, it's still calculating the complete answer internally.

    Try this instead:

    Code:
    (setq d1 97.097)
    (setq test (* d1 39.3700787401574))
    (rtos test 2 20)
    R.K. McSwain | CAD Panacea |

  3. #3
    Member
    Join Date
    2013-03
    Posts
    2
    Login to Give a bone
    0

    Default Re: Variable rounded results

    Thankyou
    still seems strange that it returns as 3822.72 when my units precision is set to 8.
    I did get it to work, turned out being the label length on the dcl text tile wasn't long enough (face palm)
    Miles

    Quote Originally Posted by rkmcswain View Post
    It's only returning the result to the precision you have set in your settings.
    Don't worry, it's still calculating the complete answer internally.

    Try this instead:

    Code:
    (setq d1 97.097)
    (setq test (* d1 39.3700787401574))
    (rtos test 2 20)

  4. #4
    Administrator rkmcswain's Avatar
    Join Date
    2004-09
    Location
    Earth
    Posts
    9,803
    Login to Give a bone
    0

    Default Re: Variable rounded results

    My bad, you're right. The drawing precision settings do not affect what is returned to the command line.

    But regardless, the internal data calculated and stored is accurate. Just use the tools to extract the precision you need.
    R.K. McSwain | CAD Panacea |

Similar Threads

  1. Clash Batch results show reported results
    By pauljordan in forum NavisWorks - Wish List
    Replies: 1
    Last Post: 2012-05-15, 08:35 PM
  2. rounded terrain from cad 3d faces
    By jarod.tulanowski in forum 3ds Max - General
    Replies: 2
    Last Post: 2010-10-23, 02:06 PM
  3. Add Plus/Minus to rounded dims?
    By fhunziker in forum AutoCAD Customization
    Replies: 5
    Last Post: 2007-10-17, 12:34 AM
  4. Variable height/variable count family (studs in a sloped wall)
    By DoTheBIM in forum Revit Architecture - Families
    Replies: 6
    Last Post: 2006-06-15, 02:48 PM
  5. rounded corners
    By BCrouse in forum Style Management
    Replies: 5
    Last Post: 2004-08-05, 04:46 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •