Converting AutoLISP Data Types to ActiveX Data Types

AutoCAD AutoLISP & Visual LISP

 
Converting AutoLISP Data Types to ActiveX Data Types
 
 
 

When adding a circle to a drawing, you must specify the center point of the circle and the radius of the circle. In the definition for the AddCircle method in the ActiveX and VBA Reference, these arguments are referred to as Center and Radius. Center is defined as a variant (three-element array of doubles), and Radius is listed as a double:

RetVal = object.AddCircle (Center, Radius)

Elements

Center

Variant (three-element array of doubles); input only. A 3D WCS coordinate specifying the circle's center.

Radius

Double; input only. The radius of the circle. Must be a positive number.

The reference explains what these parameters are used for, but the data types indicated for these parameters may be unfamiliar to LISP users. Variants are essentially self-defining structures that can contain different types of data. For example, strings, integers, and arrays can all be represented by variants. Stored along with the data is information identifying the type of data. This self-defining feature makes variants useful for passing parameters to ActiveX servers, because it enables servers based on any language to understand the data value.