Functions that update properties are prefixed with vla-put and use the following syntax:
vla-put-center changes the center point of a circle.For example,
_$ (setq myCenter (vla-get-center myCircle))
The center point is returned in a variant of type safearray. The safearray contains three doubles (X, Y, and Z coordinates).
$ (setq centerpt (vlax-safearray->list
(17.8685 5.02781 0.0)
Converting the center point from a variant safearray to a list makes it easier to modify the coordinates.
_$ (setq newXaxis (- (car centerpt) 1))
newXaxis.The result is saved in variable
_$ (setq newcenter (list newXaxis (cadr centerpt)
(16.8685 4.52594 0.0)
newcenter.The constructed list is saved in variable
_$ (vla-put-center myCircle (vlax-3d-point newcenter))
vlax-3d-point to convert the new center point list into the data type required by vla-put-center.Note that this command uses
The AutoCAD drawing window shows the result:
vla-update function:Note that changing an object's property may not immediately affect the display of the object in the AutoCAD drawing. AutoCAD delays property changes to allow you to change more than one property at a time. If you need to update the drawing window explicitly, issue the
acRed instead of specifying a numeric index value:Sometimes you can use pre-defined constants to update an object's property. For example, to set the fill color of a circle to red, you can use the constant
(vla-put-color myCircle acRed)
The ActiveX and VBA Reference lists any predefined constants under the entry describing the property. You can use these constants in VLISP ActiveX function calls.