Using Visual LISP Functions with ActiveX Methods

AutoCAD AutoLISP & Visual LISP

 
Using Visual LISP Functions with ActiveX Methods
 
 
 

VLISP adds a set of functions to the AutoLISP language that provides access to ActiveX objects. The function names are prefixed with vla-: for example, vla-addCircle, vla-get-ModelSpace, vla-getColor. These functions can be further categorized as follows:

  • vla- functions correspond to every ActiveX method. Use these functions to invoke the method (for example, vla-addCircle invokes the Addcircle method).
  • vla-get- functions correspond to every property, enabling you to retrieve the value of that property (for example, vla-get-Color obtains an object's color property).
  • vla-put- functions correspond to every property, enabling you to update the value of that property (for example, vla-put-Color updates an object's color property).

VLISP also adds a set of ActiveX-related functions whose names are prefixed with vlax-. These are more general ActiveX functions, each of which can be applied to numerous methods, objects, or properties. For example, with the vlax-get-property function, you can obtain any property of any ActiveX object. If your drawing contains custom ActiveX objects, or if you need to access objects from other applications, such as a Microsoft Excel spreadsheet, you can use the vlax-invoke-method, vlax-get-property, and vlax-put-property functions to access their methods and properties; you'll see examples using these functions in Using ActiveX without Importing a Type Library.