Share

vlax-get-property (AutoLISP)

Product Documentation
Intermediate

Retrieves a VLA-object's property

(vlax-get-property object property)

This function was formerly known as vlax-get.

Arguments

object

A VLA-object.

property

A symbol or string naming the property to be retrieved.

Return Values

The value of the object's property.

Examples

Begin by retrieving a pointer to the root AutoCAD object:

(setq acadObject (vlax-get-acad-object))
#<VLA-OBJECT IAcadApplication 00a4b2b4>

Get the AutoCAD ActiveDocument property:

(setq acadDocument (vlax-get-property acadObject 'ActiveDocument))
#<VLA-OBJECT IAcadDocument 00302a18>

The function returns the current document object.

Get the ModelSpace property of the ActiveDocument object:

(setq mSpace (vlax-get-property acadDocument 'Modelspace))
#<VLA-OBJECT IAcadModelSpace 00c14b44>

The model space object of the current document is returned.

Convert a drawing entity to a VLA-object:

(setq vlaobj (vlax-ename->vla-object e))
#<VLA-OBJECT IAcadLWPolyline 0467114c>

Get the color property of the object:

(vlax-get-property vlaobj 'Color)
256

Was this information helpful?