setPropertyValue


(setpropertyvalue  ename  property  value)
or
(setpropertyvalue  collectionName  index  property  value) unsupported in BricsCAD !

This function sets the new value for the specified property of the object or entity ename.

Arguments

ename  (classic entity name) object or entity ename to query for the given property
property  (string) the name of the property to test; property name is always case-insensitive
value  (any Lisp value) the new value to be applied

Return

T if successful, NIL otherwise

Example

(setpropertyvalue  (entlast)  "Color"  "ByLayer")
(setpropertyvalue  (entlast)  "Color~Native"  "ByLayer")

(setpropertyvalue  (entlast)  "Color"  "5")
(setpropertyvalue  (entlast)  "Color~Native"  "5")

(setpropertyvalue  (entlast)  "Color"  "28,227,188")
(setpropertyvalue  (entlast)  "Color~Native"  "28,227,188")

Hint

the specified "ident" can be used to uniquely specify the property, as same-named properties can exist in multiple contexts;
the ident always uses the format "Name~Context"

Remarks

applying a property to an object or entity, where the property is not valid for, will trigger a Lisp error
(see (ispropertyvalid) function)

applying a value for a read-only property will trigger a Lisp error;
(see (ispropertyreadonly) function)

when in doubt, use (vl-catch-all-apply ...) error catcher



©  Bricsys NV. All rights reserved.