Modifies the definition data of an object (entity)
(entmod elist)
entmod function updates database information for the entity name specified by the -1 group in elist. The primary mechanism through which AutoLISP updates the database is by retrieving entities with entget, modifying the list defining an entity, and updating the entity in the database with entmod. The entmod function can modify both graphical and nongraphical objects.
TheArguments
entget function.
A list of entity definition data in a format similar to that returned by theentmod accepts integer values and converts them to floating point. Similarly, if you supply a floating-point value for an integer entity field (such as color number), entmod truncates it and converts it to an integer.
For entity fields with floating-point values (such as thickness),Return Values
entmod returns the elist supplied to it. If entmod is unable to modify the specified entity, the function returns nil.
If successful,Examples
The following sequence of commands obtains the properties of an entity, and then modifies the entity.
en1 variable to the name of the first entity in the drawing:
Set theCommand: (setq en1 (entnext))
<Entity name: 2c90520>
ed to the entity data of entity en1:
Set a variable namedCommand: (setq ed (entget en1))
((-1 . <Entity name: 2c90520>) (0 . "CIRCLE") (5 . "4C") (100 . "AcDbEntity") (67 . 0) (8 . "0") (100 . "AcDbCircle") (10 3.45373 6.21635 0.0) (40 . 2.94827) (210 0.0 0.0 1.0))
ed from layer 0 to layer 1:
Changes the layer group inCommand: (setq ed (subst (cons 8 "1") (assoc 8 ed) ed ))
((-1 . <Entity name: 2c90520>) (0 . "CIRCLE") (5 . "4C") (100 . "AcDbEntity") (67 . 0) (8 . "1") (100 . "AcDbCircle") (10 3.45373 6.21635 0.0) (40 . 2.94827) (210 0.0 0.0 1.0))
en1 entity in the drawing:
Modify the layer of theCommand: (entmod ed)
((-1 . <Entity name: 2c90520>) (0 . "CIRCLE") (5 . "4C") (100 . "AcDbEntity") (67 . 0) (8 . "1") (100 . "AcDbCircle") (10 3.45373 6.21635 0.0) (40 . 2.94827) (210 0.0 0.0 1.0))
Restrictions on Using entmod
entmod function can make:
There are restrictions on the changes theentmod to modify an entity within a block definition, the modification affects all instances of the block in the drawing.
You can change an entity's space visibility field to 0 or 1 (except for viewport objects). If you useentmod on vertex entities, you should read or write the polyline entity's header. If the most recently processed polyline entity is different from the one to which the vertex belongs, width information (the 40 and 41 groups) can be lost.
Before performing anentdel, entget, entmake, entnext, and handent functions. In the AutoLISP Developer's Guide, refer to Modifying an Entity and Entity Data Functions and the Graphics Screen.
The