entmod function modifies an entity. It passes a list that has the same format as a list returned by entget but with some of the entity group values (presumably) modified by the application. This function complements entget. The primary mechanism by which an AutoLISP application updates the database is by retrieving an entity with entget, modifying its entity list, and then passing the list back to the database with entmod.The
MYLAYER.The following code fragment retrieves the definition data of the first entity in the drawing and changes its layer property to
(setq en (entnext)) ; Sets en to first entity name
; in the drawing.
(setq ed (entget en)) ; Sets ed to the entity data
; for entity name en.
(subst (cons 8 "MYLAYER")
(assoc 8 ed) ; Changes the layer group in ed.
ed ; to layer MYLAYER.
(entmod ed) ; Modifies entity en's layer in
; the drawing.
entmod can make; entmodcannot change the following:There are restrictions on the changes to the database that
Other restrictions apply when modifying dimensions and hatch patterns.
entmod. There is one exception: entmod accepts new layer names.AutoCAD must recognize all objects (except layers) that the entity list refers to. The name of any text style, linetype, shape, or block that appears in an entity list must be defined in the current drawing before the entity list is passed to
entmod creates a new layer. The attributes of the new layer are the standard default values used by the New option of the AutoCAD LAYER command.If the entity list refers to a layer name that has not been defined in the current drawing,
entmod function can modify subentities such as polyline vertices and block attributes.The
entmod to modify an entity in a block definition, this affects all INSERT or XREF references to that block. Also, entities in block definitions cannot be deleted by entdel.If you use