entmod
(entmod data)
The entmod function allows the modification of a basic entity or complex block definition in the current drawing database.
Arguments
ata contains the defining data of the entity to be modified.
The entity to be modified must exist in the current drawing.
Before modifying the entity, entmod tests the validity of the arguments for Layer name, LineColor, LineStyle, and TextStyle.
- If a Layer name is supplied that has not yet been defined, entmod creates that Layer with the same Color and LineStyle values as the default values of Layer 0.
- An invalid Color value leads to the cancellation of the function, which returns nil.
- A LineStyle or TextStyle not yet defined leads to the cancellation of the function, which then returns nil.
The name of the entity to be modified must be provided in the first element of the list (group = -2). Otherwise entmod cancels and returns nil.
The reference (handle) of the entity cannot be changed. The same is true for other internal fields like the entity name (group = -1).
Modifying a main (non-complex) entity causes automatically a redrawing of the changed entity on the screen.
If the modified entity is a sub-entity (for example, a vertex of a PolyLine or a BlockAttribute of an Insert entity), the display of the complex object needs to be refreshed (redrawn) on the screen with the entupd function.
Return Value
If the function succeeds, it returns the entity information list; otherwise, the function nil.
: (setq x (entget (car (entsel))))
: (setq x (subst (cons 62 1) (assoc 62 x) x))
: (entmod x)
entupd