Learning Curve: Quick, Calculate + 1!15 Nov, 2005 By: Bill Fane Cadalyst
Taking AutoCAD's QuickCalc feature one step further.
It was a lovely, warm fall afternoon. Captain LearnCurve and his gorgeous wife just completed the Rolls Royce Owners Club Fall Tour in their 1937 Phantom III limousine. Thirty cars met at La Conner, Washington, the previous Saturday. It took a week to proceed about 800 miles eastward over the North Cascades highway, northward into Canada for a winery and orchard tour through the Okanagan Valley in British Columbia, westward through Kamloops, Lilooet and Pemberton, then south through Whistler and into North Vancouver.
The Kamloops to Pemberton leg over the infamous Duffey Lake Road was particularly interesting. As well as including a 15% downgrade for about four miles and a "Slow to 6 MPH" corner, it also was the fuel economy run portion of the tour.
You don't often see Rolls Royce and fuel economy in the same context!
I know, but it is an easy way of assessing the mechanical condition of the cars. Now all the Captain had to do was to calculate everyone's fuel mileage, then think of a topic for this month's column.
Wait a minute! Calculate! That's it!
My previous article introduced AutoCAD 2006's new QuickCalc command. We saw its basic capabilities and how it is a significant improvement over the older 'Cal function. This time we will start with a bit of a review, and then, as threatened at the end of my previous article, we will see some of its extended functionality.
Last time we saw how QuickCalc is a pocket calculator built in to AutoCAD. We don't need to memorize the command name, however, because its icon appears several places in toolbars and in the Properties dialog box. When invoked, it pops up a tool palette that looks remarkably like a standard pocket calculator (figure 1).
Figure 1. The QuickCalc interface is intuitive to use.
Last time we saw how to use the basic arithmetic functions in the number pad area. We saw our entries appear in the input window and the results appear in the history window. We also learned how to manipulate the basic memory functions.
We ended by looking at the third button from the left in the top toolbar portion of the palette. This button will paste our results to the Command line or to any active command, so we can do calculations on the fly within any AutoCAD command.
Now let's move on to look at the other regions of the QuickCalc palette, starting with the scientific section.
If You Have To Ask...
...how much a large yacht costs, then you probably can't afford it. Similarly, if you have to ask what most of the scientific buttons do, then you probably won't be using them. The interesting bit here is how you use them.
The general format for entering any function into QuickCalc is function(argument). For example, the sine of 45 degrees would be entered as sin(45). You can type directly into the input window, or you can use the buttons. The slightly tricky bit is where you use them.
It is easy enough to apply a single function to a single or compound argument. For example, if you type the number 45 into the input window and then click the tang button, the input window displays tang(45) (note that it uses tang for tangent to distinguish it from the tangent object snap). Similarly, typing 3+45 and then clicking cos will result in cos(3+45), which is equivalent to cos(48).
So far so good, but what if you want to end up with 3+cos(45)? No problem. Simply type 3+45, then use the mouse or left arrow to locate the cursor just before the 4. The bottom line here is that there are two rules for applying the scientific functions through the buttons.
First, if the cursor is at the end of the input line, then the function is applied to the entire input line.
Second, if the cursor is located somewhere within the line, then the function is applied to everything from the cursor to the end of the line.
If you take a close look at the syntax of QuickCalc functions, you will notice that it is exactly the same as the old Command line geometry calculator 'Cal, which I covered last year. If you look it up, you will see that it supports a whole bunch of things such as radians-to-degree and back conversions, angle and linear inputs in formats other than decimal units, the creation and utilization of AutoLISP variables, the retrieval of system variables, point and vector calculations, and so on. One quickly comes to the conclusion that QuickCalc is basically 'Cal at heart but with a better interface.
But Wait, There's More!
Yes, QuickCalc includes all of 'Cal, but it also adds a couple of new features.
Let's start with the units conversion section of the palette. Its basic operation is quite intuitive, but it also has a couple of tricks up its sleeve. The intuitive part hardly needs explanation. You can choose to convert lengths, areas, volumes or angles between imperial and metric units, and the answer will appear in the converted value window.
Now comes the first trick. If you click in the converted value window, then the QuickCalc button appears at the right end of the window. Interesting. Why would we want to invoke QuickCalc from within QuickCalc? Actually, we don't. When we click on this button, the result of the conversion is automatically pasted to the input window.
There is also a simple mechanism to go the other way. When the input window is showing a simple numeric value, either by direct entry or as the result of a calculation, simply highlight any one or more characters in it. Right-click, and then select Copy.
Now move to the convert from window and left-click. The value is pasted to the value to convert window without any other Paste command required.
Now I Remember!
Okay, so you use the same specific value in many calculations. You can save it to and retrieve it from QuickCalc's built-in memory, or you can save to and retrieve from AutoLISP variables. The problem with either approach is that the memories evaporate when you close the current drawing.
QuickCalc solves this problem very nicely. It has added the variables section at the bottom. When you expand it, you see several pre-defined sample variables (figure 2).
Figure 2. The QuickCalc Variables section includes several pre-defined examples.
Ah, but you are not limited to saving simple values. Anything in the list that is preceded by the k symbol is a constant (konstant?), while those entries preceded by x are function macros. If you single-click on an entry, then the details section gives a brief explanation of the entry, while double-clicking posts it to the input window.
Reading from left to right, the four buttons in the toolbar across the top of the variables section allow you to create, edit or delete an entry or to post it to the input window. Right-clicking within the variables window brings up a context menu with two more entries; you can rename an entry or create a new category.
It is extremely easy to create a new entry. Even I was able to create the one at the bottom of the list. When you invoke the New operation, it summons a dialog box (figure 3). It is pretty much self-explanatory.
Figure 3. The Variable Definition dialog box lets you create a new variable.
The real magic of QuickCalc variables is that they are held in a separate file called CALVAR.INI. This means that they are available session after session, and you can share them with others. It is found in the folder c:\Documents and Settings\[login name]\Application Settings\Autodesk\AutoCAD r16.2\enu\support. According to Microsoft standards, this is the default location for any user-alterable customization files. The bizarre thing is that by default this folder is hidden, so it may not turn up in your listing unless you tell Windows Explorer to show hidden files and folders.
Anyway, you can create a customized variables file and then save it to a common network folder. If your users modify their AutoCAD support file search path to include this folder, then everyone will have access to all of your custom QuickCalc variables and function macros.
Although the 'Cal function still works in AutoCAD 2006, it is easy to see that you will almost always want to use QuickCalc instead.
And Now For Something Completely Different
The transmission in a Rolls-Royce Phantom III (1935-1939) is actually located under the front seat, and it is connected to the engine by an 18-inch-long jackshaft. When the clutch pedal is pressed to the floor, the clutch disk only disengages by a mere .010 inch. To avoid clutch judder when starting or clash when changing gears, it is essential that the rear motor mount is adjusted so the jackshaft is completely straight and does not apply any side bias at all onto the clutch output shaft bearing.
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 free Tips & Tools Weekly e-newsletter and we'll notify you every time a new video tip is published. All exclusively from Cadalyst!