2012

Table Of Contents
The following is a valid point that contains arithmetic expressions as its
components:
[2*(1.0+3.3),0.4-1.1,2*1.4]
The following example uses the Endpoint object snap and the vector [2,0,3]
to calculate a point that is offset from a selected endpoint:
end + [2,,3]
The calculated point is offset 2 units in the X direction and 3 units in the Z
direction relative to the selected endpoint.
See also:
Use the Command Line Calculator
Use AutoLISP Variables
You can use AutoLISP variables within arithmetic expressions. The variables
must be one of the following types: real, integer, or 2D or 3D point (vector).
This example defines a point located 5 units in the X direction and 1 unit in
the Y direction from the point stored in AutoLISP variable A.
A+[5,1]
If you enter an AutoLISP variable with a name containing a character with
special meaning in CAL, such as +, -, *, or /, enclose the variable name in
apostrophes ('), for example:
'number-of-holes'
Assigning Values to AutoLISP Variables
To assign a value to an AutoLISP variable, precede the arithmetic expression
with the variable name and the equal sign (=). Later, you can use the value of
this variable for other calculations.
This example saves the values of two expressions in AutoLISP variables P1 and
R1.
Command: cal
>> Expression: P1=cen+[1,0]
>> Select entity for CEN snap: Select a circle or an arc
Command: cal
166 | Chapter 2 Commands