entmake (AutoLISP)

 
 
 

Creates a new entity in the drawing

Supported Platforms: Windows and Mac OS

Signature

(entmake [elist])
elist

Type: List

Entity definition data in a format similar to that returned by the entget function. The elist argument must contain all of the information necessary to define the entity. If any required definition data is omitted, entmake returns nil and the entity is rejected. If you omit optional definition data (such as the layer), entmake uses the default value.

The entity type (for example, CIRCLE or LINE) must be the first or second field of the elist. If entity type is the second field, it can be preceded only by the entity name. The entmake function ignores the entity name when creating the new entity. If the elist contains an entity handle, entmake ignores that too.

Return Values

Type: List

If successful, entmake returns the entity's list of definition data. If entmake is unable to create the entity, it returns nil.

Completion of a block definition (entmake of an endblk) returns the block's name rather than the entity data list normally returned.

Remarks

The entmake function can define both graphical and nongraphical entities.

You cannot create viewport objects with entmake.

A group 66 code is honored only for insert objects (meaning attributes follow). For polyline entities, the group 66 code is forced to a value of 1 (meaning vertices follow), and for all other entities it takes a default of 0. The only entity that can follow a polyline entity is a vertex entity.

The group code 2 (block name) of a dimension entity is optional for the entmake function. If the block name is omitted from the entity definition list, AutoCAD creates a new one. Otherwise, AutoCAD creates the dimension using the name provided.

For legacy reasons, entmake ignores DXF group code 100 data for the following entity types:

  • AcDbText
  • AcDbAttribute
  • AcDbAttributeDefinition
  • AcDbBlockBegin
  • AcDbBlockEnd
  • AcDbSequenceEnd
  • AcDbBlockReference
  • AcDbMInsertBlock
  • AcDb2dVertex
  • AcDb3dPolylineVertex
  • AcDbPolygonMeshVertex
  • AcDbPolyFaceMeshVertex
  • AcDbFaceRecord
  • AcDb2dPolyline
  • AcDb3dPolyline
  • AcDbArc
  • AcDbCircle
  • AcDbLine
  • AcDbPoint
  • AcDbFace
  • AcDbPolyFaceMesh
  • AcDbPolygonMesh
  • AcDbTrace
  • AcDbSolid
  • AcDbShape
  • AcDbViewport
NoteIn AutoCAD 2004 and later releases, the entmod function has a new behavior in color operations. DXF group code 62 holds AutoCAD Color Index (ACI) values, but code 420 holds true color values. If the true color value and ACI value conflict, AutoCAD uses the 420 value, so the code 420 value should be removed before attempting to use the code 62 value.

Examples

The following code creates a green circle (group code 62 is for color, 3 is for green), centered at (4,4) with a radius of 1. The optional layer and linetype fields have been omitted and therefore assume default values.

(entmake '((0 . "CIRCLE") (62 . 3) (10 4.0 4.0 0.0) (40 . 1.0)))
((0 . "CIRCLE") (62 . 1) (10 4.0 4.0 0.0) (40 . 1.0))