Baraa Natour
Baraa Natour

Reputation: 69

Understanding the output of the entget function

I am using the entget function to get data about a polygon from the sketch in purpose of creating formula that shows how to calculate its area. Therefore I need to understand the output of entget, an example of entget output :

(
 (-1 . <Entity name: 7ef043b0>) 
 (0 . "LWPOLYLINE")
 (330 . <Entity name: 7ef01f80>) 
 (5 . "2CE") 
 (100 . "AcDbEntity")
 (67 . 0) 
 (410 . "Model")
 (8 . "0")
 (100 . "AcDbPolyline")
 (90 . 3)
 (70 . 1)
 (43 . 0.0)
 (38 . 0.0)
 (39 . 0.0)
 (10 93.1128 191.34)
 (40 . 0.0)
 (41 . 0.0)
 (42 . 0.0)
 (91 . 0)
 (10 83.1128 191.34)
 (40 . 0.0)
 (41 . 0.0)
 (42 . 0.0)
 (91 . 0)
 (10 83.1128 202.104)
 (40 . 0.0)
 (41 . 0.0)
 (42 . 0.0)
 (91 . 0)
 (210 0.0 0.0 1.0)
) 

The idea is that the number -1 ressemble a property for the polyline (its entity name by the way).

The number 10 ressembles a vertex/corner.

I cant figure out the rest of the properties.

Why do I need this? I can't differentiate between an triangle and a corner of a circle if I just used vertices/corners and their number.

Thank you for your help.

Upvotes: 1

Views: 961

Answers (1)

Lee Mac
Lee Mac

Reputation: 16015

DXF data returned by the AutoLISP entget function is an association list in which the first element of each item (the key) corresponds to a DXF group, and the associated value corresponds to the value held by that group.

Each group represents a property of the entity, with the properties becoming more specific to the type of entity being described as you traverse the DXF data list.

The DXF groups at the start of the list, such as the entity type (DXF group 0) or entity handle (DXF group 5) are common to every database object. These are followed by properties of the base class (in this case AcDbEntity) under which you will find the layer (DXF group 8) and drawing layout (DXF group 410), and finally, properties of the object class (in this case AcDbPolyline) under which you will find properties pertinent to the type of object, such as the polyline vertices (DXF group 10), number of vertices (DXF group 90) etc.

You may find a full DXF reference here. Note that this reference includes both graphical & non-graphical entities (such as layer definitions and dictonaries).

A DXF reference for the DXF groups associated with an LWPOLYLINE entity may be found within the ENTITIES section of the reference here.

You may also find my Entity List program useful when interpreting DXF data, as this program will format the data returned by the entget function into a readable output, and will include all subentities which follow the primary entity, along with any Extended Entity Data (xData) attached to such entities.


Aside, in response to the comment on your question: please note that DXF group 5 contains the entity handle, which bears no relation to the type of entity. This is purely an identifier which is unique within a drawing and persistent for the life of the drawing.

Upvotes: 1

Related Questions