(entget entity-name [application-list])


Determine the DXF data of an entity.


This function retrieves the entity list from the drawing database. The list is assigned to a variable, and then is taken apart, using functions like car, cdr,and assoc.

The entity list returned is composed of element pairs called dotted pairs because a dot separates each half. In each pair, the first number represents the code number for a characteristic of the element; the second number is the data associated with the code.

Example

As an example, let's draw a line and assign it the following variable values:

:Line

>Start point: 0,0

>Close/Undo/<Next point>: 5,5

:Change

Select entities: Pick line

Properties/<Change point>: P

(Color/Elev/LAyer/LType/ltScale/Thickness)? C

New color <BYLAYER>: 5

New Layer <0>: Electric

New Linetype <BYLAYER>: Continuous

Using the settings above, the following example applies:

Function Returns Code
(setq myline (entget (entlast))) ((-1 . <Entity name: 1fe0558>)
  (0 . "LINE") 0=Entity type
  (5 . "2B") 5=Handle
  (100 . "AcDbEntity")  
  (8 . "Electric") 8=Layer name
  (62 . 5) 62=Color number
  (6 . "CONTINUOUS") 6=Linetype name
  (100 . "AcDbLine")  
  (10 0.0 0.0 0.0) 10=x,y,z-coords
  (11 5.0 5.0 0.0) 11=Other x,y,z-coords
  (210 0.0 0.0 1.0)) 210=x,y,z-extrusion

NOTES

    • Entget does not return all information about an entity. Missing is dotted pair data about the entity's properties when they do not differ from default values: color, linetype, thickness, attributes-follow flag, and the entity handle.
    • While the data returned by entget is very similar to DXF format, there is one primary difference: x,y,z coordinates are returned by entget as a single value, rather than the separate values in DXF. Thus, you only see group code 10 with entget, instead of DXF group codes 10 (x-coordinate), 20 (y-coordinate), and 30 (z-coordinate).

Tell me about...

(entdel entity-name)

(entlast)

(entmake [entity-list])

(entmod entity-list)

(entsel [prompt])

(entupd entity-name)

LISP Compatibility

Programming Overview of LISP (LISt Processing) Language