std-entchg | ![]() |
STD-ENTCHG is the basic entity modifier. It is used to simplify (ENTMOD (SUBST ..)) constructs.
It changes the dxf group of the entity to the new <value> if it is of this type.
The types argument is either a list of accepted types or nil, then all entity types are accepted.
The argument <nr> and <value> must be either atomic or lists of equal length. Lists are used for multiple changes in one call. If they are lists then the i-th value in <nr> must match the i-th value in <value>.
Returns 1 or 0 to be able to use it in increment functions, to sum up the number of changed entities.
It may be used with entity types, entget-lists or entsel picklists.
Example
(foreach ele (std-sslist (ssget)) (setq i (+ i (std-entchg ele '("LINE") 62 7)))) (std-princ (list i " lines changed to color white")) ;;; change element to layer "0" (std-entchg ele nil 8 "0") ;;; change element to layer "0" and color to white (std-entchg ele nil '(8 62) ("0" 7))
Note
The implementation calls STD-ENTGET on ename or entsel arguments which uses an entget caching mechanism, because ENTGET is usually slow. But this speed gain may fool return values on deleted entities if you don't use STD- functions.
ele: Either an entity type, entget-list or entsel picklist.
types: A list of strings or nil
nr: A valid dxf group, an integer number or a list of numbers.
value: A value matching the nr argument, either a string, number, point or ename or a list of these.
1 on success, 0 on no change or wrong entity type.
Changes the entity. Mostly used only because of the described side-effect. The returned number is only sometimes used for the sum of changed entities.
(std-require 'STDENT)
Defined in STDENT