You are here:

AutoCAD/Setting decimal places in command line

Advertisement


Question
Hi Bill,
I am running R2004, and would like to know if I can set the product of a calculation in the commnad line to the same number of decimal places as the setting in UNITS.
I am using ACAD's cal. to rotate VIEW TWIST. This has to be done to the max. accuracy possible. I did set the UNITS to the max. decimal places available, but the product from the CAL. only gives me 3 decimal places. I am using my calculator now, but thought ACAD should be able to give me the accuracy that I have set in the UNITS.
Is ther a way to sort your answers by alphabetic order?

Answer
I've set my units to architectural, decimal, engineering, set precision to 0,and I cnsistently get the following:
Command: cal
>> Expression: 1/8
0.125

Command: cal
>> Expression: 123/456
0.26973684210526

So, if your quotient only goes to three places, then CAL will only show a three-place answer.

So, you view is getting twisted right.  But if you type VIEWTWIST, your going to get a rounded off number.  So, type:
(rtos (getvar "viewtwist") 2 8)
and you should get a real number that is accurate.

Keep in touch
Bill DeShawn
http://my.sterling.net/~bdeshawn  

AutoCAD

All Answers


Answers by Expert:


Ask Experts

Volunteer


Bill DeShawn

Expertise

I can address all 2-D questions and some 3-D questions. I do programming in AutoLISP if it doesn`t involve solid modeling. I can also address menu customization issues and can help you find answers to questions I can`t answer by taking your question directly to Autodesk via their newsgroups.

Experience

I used to do electronic and mechanical design for a flat panel monitor manufacturer, and now I do architectural drafting for an architect. I did and do AutoLISP and menu customization and take pride in making my lisp routines to do the work exactly the way the client likes them done.

Publications
I had a routine published in CADENCE magazine (no longer in publication and taken over by CADALYST). Some of my routines are published on my website at http://my.sterling.net/~bdeshawn

©2012 About.com, a part of The New York Times Company. All rights reserved.