gp:drawOutline function issues ActiveX calls to display the path's polyline border in AutoCAD. The following code fragment uses ActiveX to draw the border:The
;; Add polyline to the model space using ActiveX automation.
(setq pline (vla-addLightweightPolyline
*ModelSpace* ; Global Definition for Model Space
VLADataPts ; vertices of path boundary
) ;_ end of vla-addLightweightPolyline
) ;_ end of setq
(vla-put-closed pline T)
How do you make sense of this code? An essential resource is the ActiveX and VBA Reference, which describes the methods and properties accessible to ActiveX clients such as this garden path application. The âWorking with ActiveXâ section of the AutoLISP Developer's Guide explains how to translate the VBAâ¢ syntax in the ActiveX and VBA Reference into ActiveX calls in AutoLISP syntax.
vla- calls in the preceding example. The names of all AutoLISP ActiveX functions that work on AutoCAD objects are prefixed with vla-. For example, addLightweightPolyline is the name of an ActiveX method, and vla-addLightweightPolyline is the AutoLISP function that invokes this method. The vla-put-closed call updates the closed property of the pline object, the polyline drawn by vla-addLightweightPolyline.For the moment, though, you can gain a rudimentary understanding by scrutinizing the pattern of the two
The Automation objects that factor into AutoLISP ActiveX calls abide by a few standard rules: