AutoCAD

Meet my friend Cal Q. Lator

15 Sep, 2004 By: Bill Fane

This built-in AutoCAD function does some amazing things


It was a warm, sunny afternoon. Captain LearnCurve was trying to figure out how to make his Hobie Cat go faster. Suddenly a thought sprang out. Captain LearnCurve screamed, "At last! I have a topic for this month's column! I'll show my readers how to figure things out with AutoCAD's built-in calculator!"

Have you ever needed to use a calculator while working in AutoCAD? I know you have, because I've seen many of you using one. Well, put away your pocket calculator because AutoCAD has one built in. Unfortunately, many users don't realize that the Command of the Month even exists because you can't invoke it via a menu or a toolbar button.

Go Figure
Okay, let's fire it up. Type in Cal at the Command prompt and the Command prompt shows Cal's standard prompt:

Expression

This is inviting you to enter an arithmetic expression. I can't show you any fancy screen shots, because there are no dialog boxes, wizards, or menu picks associated with this command. Instead, you type in your desired mathematical expression using a fairly obvious syntax, press Enter, and Calculator returns your answer. For example, if you type

	(2+3)/(2.3*5)

and press Enter, Cal adds 2 plus 3 then divides that by the result of multiplying 2.3 times 5. It then displays the answer, 0.434703, and finally returns to the Command prompt.

The basic syntax is simple: As expected, you use +, -, and / to add, subtract, and divide. The only minor anomalies are that you use * instead of X to indicate multiplication and the caret ^ to indicate exponentiation (raising to a power).

The usual mathematical rules of precedence apply: The system evaluates expressions in parentheses first, starting with the innermost ones, then exponentiation, then multiplication/division, then addition/subtraction. It evaluates operators of equal precedence from left to right.

The usual range of trigonometric functions is available, including SIN, COS, TANG, and the inverse functions ASIN, ACOS, and ATAN. Note that "tangent of an angle" is TANG, not TAN, because that would conflict with the TANgent object snap. By default, the trig functions work in decimal degree values, but I'll cover this later.

The base-10 logarithmic functions LOG, EXP10 are available, while LN and EXP provide the natural log functions. SQ and SQRT return the square and square root.

ROUND returns the number rounded up or down to the nearest integer, and TRUNC simply drops the decimal portion and returns the integer portion. ABS returns the absolute value.

Two interesting functions are R2D and D2R. They convert an angle in radians to degrees and vice versa. I'll leave it to you to figure out which does which.

The general syntax of any of the preceding mathematical functions is

	function(value)

For example, SIN(30) returns 0.5, because the sine of 30


AutoCAD Tips!

Lynn Allen

Autodesk Technical Evangelist Lynn Allen guides you through a different AutoCAD feature in every edition of her popular "Circles and Lines" tutorial series. For even more AutoCAD how-to, check out Lynn's quick tips in the Cadalyst Video Gallery. Subscribe to Cadalyst's Tips & Tricks Tuesdays free e-newsletter and we'll notify you every time a new video tip is available. All exclusively from Cadalyst!
Follow Lynn on Twitter Follow Lynn on Twitter


Latest News from Cadalyst Partners
Feed
Friday Fun - Travel MacGyver Creates a Delta Margarita   24 May, 2013

I travel by air a fair amount of time over the years and have fancied myself a bit of a travel related...More>>Read all Between the Lines blog posts>>

Feed
Load ‘Em Up! Stackers, Conveyors, and Advanced Assembly   23 May, 2013

Mineral resources come out of the ground and are then processed into energy, fertilizer, steel, and so on. We all kind of knew that already. But...More>>Read more PTC Creo blog posts>>

Feed
Excel Hyperlinks & Document Management Tricks   22 May, 2013

Do you have to keep track of a lot of different folders and files? Do you wish you peers could open the correct Revit file? Are you tired of having...More>>Read more BIMbuilder blog posts>>

Feed
Can spatial aptitude tests help predict your success as an engineer?   24 May, 2013

Do you enjoy taking these tests?  I know I...More>>Read more SolidWorks Blog posts>>

Feed
Sunglass.io Launches Library, Brings 400+ Suppliers to the Collaboration Platform   24 May, 2013

Here’s a quandry. How many supplier-certified parts and assemblies do you need to make your 3D viewing experience via the web worth it? What if...More>>Read more SolidSmack blog posts>>

Poll
What type of input device (besides the keyboard) do you use at your primary CAD workstation?
Standard mouse
Trackball mouse
Programmable mouse
3D navigation device
Pen/tablet
Multiple devices
Submit Vote




Considering Wide Format Printing Solutions?
Four FREE White Papers Available:






Subscribe Cadalyst Newsletters