# Started with CAL command

The calculator commands in AutoCAD are used to perform different operations. These are termed as CAL commands. We can perform arithmetic as well as geometric operations using the CAL Expression.

It is also termed as the command prompt calculator.

At the command prompt, enter CAL, and then enter the CAL expression.

For command in progress, first, we need to enter the 'CAL command (apostrophe before the CAL) and then need to enter the expression to evaluate the preceding command.

We can use the CAL commands on the command prompt and the calculator in different ways, which are given below:

### Area using the calculator

We can use the calculator to find the significant area.

Let's consider an example. The example is given in the below image: To find the hatched area shown above, we need to subtract the area of a circle from the rectangle.

The steps are listed below:

• Select the outer rectangle.
• Right-click and select the Properties option.
• The dialogue box will appear as shown in the below image: • Click on the Area. The icon of the calculator will appear in front of the Area, as shown in the below image: • Click on the calculator icon. The Calculator will appear on the screen.
• We need to save this value to the memory now. To do this, click on the memory + (M+) button on the bottom of the calculator, as shown in the below image: The value is saved in the memory. Now, click on the Close button at the bottom of the calculator.

• Select the inner circle and click on the calculator icon in front of the Area, as shown in the below image: • Click on the minus (-) sign, and then click on the MR (Memory Recall) button.
The calculator will now look like the below image: • Click on the = button to get the answer.

### Calculations using CAL on command line

There are two ways to use the CAL.

1. By performing the calculations.

The steps to perform calculations are listed below:

• Enter CAL on the command line. It will look like the below image: • The operators used are listed in the below table:
Operator Description
For example, [a, b] + [x, y] + [a + x, b + y]
- Subtracts
/ Divide
^ Exponentials
* Multiplication
In combination, it also determines the scalar product. For example, a*[w, x, y]=[a*w, a*x, a*y]
( ) Group Expressions
& Vector product
pi The value of pi
Sqr () To find the square of a number. For example, sqr (4)
Sqrt () It signifies the square root of a number. For example, sqr (9)
round () It is used to round off the value to the nearest integer.
sin (angle) Sine of the angle. We can also specify cos, tan, etc. other than sin.
asin() It signifies the arcsine of a number. The value of the number inside the bracket should be between -1 and 1.
ln
log
Natural log
Base-10 log
exp
exp10
Natural exponent
Base exponent
r2d () Conversion of radian to degrees
d2r () Conversion of degrees to radians

#### Note: The value for the variable used in the above table should be enclosed within the bracket.

Let's consider some calculations.

• Type the calculation to perform, after giving CAL command on the command line, press Enter.
5^2 + 6 - 8
The output of the above calculation is shown in the below image: Similarly, we can perform any calculation.

Equation: pi + 3.5^2 + 8/2

Output: Equation: 3* [6/3 + 5*2 + 1 - 0.5, 1, 2]

Output: 2. Using the CAL within other command

The 'CAL (with apostrophe) is written on the command line for use within other commands.

Let's consider an example.

• The example is to specify the radius of a circle using the CAL in the command line.
Below are the steps:
• Type circle on the command line and specify the center point with the mouse or cursor.
• Type 'CAL on the command line and press Enter. We can also press spacebar in place of Enter.
• Write the value for the radius and press Enter. For example, let's write '3*0.95'. We can also enter single integer value. The circle will be drawn having the radius of the value mentioned in the CAL Expression.

### Units on QuickCalc display

• To specify square feet or cubic feet, we can write it as:
• cu ft or cu.ft
• sq ft or sq.ft
• We can add or subtract the value in units as well. But for the units in inches, we need to specify the (") with the value. For example, 10 inches can be written as 10".
• AutoCAD considers the dash (-) or minus sign as a separation with the imperial units. For example, to subtract 7 inches from 6 feet, the correct way to write it is 6 feet minus 7 inches (6'- 7") rather than 7 inches minus 6 feet (7"-6').
For the unit in feet, we need to specify (') with the value.
For example, 5 feet and 6 inches can be written as 5'6".
We can also write the above value of feet and inches in other ways. The ways are listed below:
• 6' (6 feet) can also be written as 72" (72 inches).
• 4 feet 6 inches can also be written as:
• 4'6"
• 4' 6" (space in between)
• 4'-6" (we can also separate the feet and inches with the dash).
• 4'-1/2"
• 4'-6-1/2"
• For subtraction, we need to include at least one space before or after the minus sign.
• If we are specifying the feet and inches together, then including the double quotes (") with the inches is optional. For example, 6' 5" (6 feet and 5 inches) can also be written as (6' 5).

### Commands in QuickCalc

We can specify commands in the calculator to perform different functions. For example, to find the center of a line or a triangle.

The commands are listed in the below table:

Command Description
(end+end)/2 Or
mee
It is used to determine the mid-point of a line or a mid-point between the two endpoints.
(end+end+end)/3 It is used to determine the mid-point of a triangle or between three endpoints.
dee (dist(end, end)) It is used to determine the distance between two endpoints.
vee It is used to determine the vector from two endpoints.
vee1 It is used to determine the unit vector from two endpoints.
ille It is used to determine the intersection of two points determined by four endpoints.
nee It is used to determine the unit vector in the XY plane and normal to the two endpoints.
rad It is used to determine the radius of the selected circle or the polyline arc.

Let's consider an example to specify the center of a line.

The steps to specify the mid-point of a line are listed below:

• Draw a line.
• At the second endpoint of a line, right-click, and select QuickCalc as shown in the below image: Do not terminate the line. The line should be in continuous form.

• Write (end + end)/2 or mee on the calculator display and press Enter.
• Specify two endpoints of a line by the cursor, as shown below: • The value of the center coordinate is displayed on the calculator, as shown in the below image: • Now click on the Apply option at the bottom of the calculator.
• The line will be automatically drawn from the center point, as shown in the below image: • We can now stretch the line according to the requirements.

### Using system variables in calculations

We can use the getvar function to read the value of the corresponding system variable.

It is written as:

getvar(variable name)

To obtain the point that is center of the view in the current viewport, we can specify a command given as:

getvar(viewctr)

### Command for Unit conversion

To convert a value to another unit, the 'cvunit' command is used.

The command in AutoCAD is written as:

cvunit(value, from _unit, to _unit)

For example, to convert 10 inches to centimeters, the command will be written as:

cvunit(10, inches, centimeter)

The output is shown in the below image: ### Feedback   