entmake

AutoCad AutoLISP Functions

 
entmake
 
 
 

Creates a new entity in the drawing

(entmake [elist])

The entmake function can define both graphical and nongraphical entities.

Arguments

elist

A list of 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

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.

Examples

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

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

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

Notes on Using entmake

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
See Also