AutoCAD 2002 Bible

Скачать в pdf «AutoCAD 2002 Bible»


(setq vla-line (vlax-ename->vla-object (entlast))) J


visual LISP returns the following:


#<VLA-OBJECT IAcadLine 03612b14>


As you can see by the return value of vlax-ename->vla-object, the value of the variable vla-line contains a vla-object. At this point, you can visually inspect the variable by selecting it and choosing View О Inspect. Although you see the line’s property in a dialog box, you can also “dump” its property and values to the Console by using the vlax-dump-object Visual LISP function as follows:


(vlax-dump-object vla-line) J


This causes Visual LISP to display the following:


; IAcadLine: AutoCAD Line Interface ; Property values:


;    Angle (RO) = 5.49779


; Application (RO) = #<VLA-OBJECT IAcadApplication 00e2f13c>


;    Color = 256


;    Delta (RO) = (10.0 -10.0 0.0)


; Document (RO) = #<VLA-OBJECT IAcadDocument 022b2f84>


; EndPoint = (15.0 -5.0 0.0)


;    Handle (RO) = «2C»


; HasExtensionDictionary (RO) = 0


; Hyperlinks (RO) = #<VLA-OBJECT IAcadHyperlinks 03613c34>


;    Layer = «0»


;    Length (RO) = 14.1421


;    Linetype = «ByLayer»


;    LinetypeScale = 1.0


;    Lineweight = -1


;    Normal = (0.0 0.0 1.0)


;    ObjectID (RO) =    21327200


;    ObjectName (RO)    =    «AcDbLine»


; OwnerlD (RO) = 21327096 ; PlotStyleName = «ByLayer»


; StartPoint = (5.0 5.0 0.0)


;    Thickness = 0.0


;    Visible = -1


T


You ’ll probably have to resize the window to see all these properties. Notice the similarities between the “named” properties shown here, such as EndPoint and StartPoint, and the line’s group codes that you retrieve using AutoLISP. As you can see, one of the advantages of using an ActiveX-enabled object is that ActiveX exposes more information to the programmer than standard AutoLISP. One of the benefits of using ActiveX is its interface. Previously, you queried and modified a line object’s start point and endpoint by using the 10 and 11 group codes. Using ActiveX to query the start point and endpoint is very straightforward. However, ActiveX returns these points in a data type called a variant that you need to convert to the familiar coordinate format.

Скачать в pdf «AutoCAD 2002 Bible»