G Beck
G Beck

Reputation: 125

AutoLisp Entity Properties

I'm trying to understand the different categories the numbered keys represent for the different entities. I made a start on trying to decipher this myself, but is there a source that has this information that can be referenced? I don't want to have to figure out each property by hand if possible.

(defun PrintEntityKeys (/ ssBlocks lEntProps sPrintTo FileID)
    (setq ssBlocks (ssget "_X"))
    (setq sPrintTo ("C:\\Users\\[User]\\Desktop\\Autolisp Entities.txt"))
    (setq FileID (open sPrintTo))
    (foreach lEntProps ssBlocks
        (write-line (vl-prin1-to-string lEntProps) FileID)
    );foreach
    (close FileID)
    (princ "\nScript Completed\n")(princ)
);PrintEntityKeys

;; Guess work progression
; (setq *EntMake* '(
;     (-1  . "[Entity Name (Self)]")
;     (0   . "[Object Name]")
;     (1   . "[object value/caption]")
;     (2   . "[object name]")
;     (3   . "[Attribute caption/Block Name/]")
;     (4   . "[Printer Settings]")
;     (5   . "[Handle value]")
;     (6   . "[Line Style]")
;     (7   . "[Font Style]")
;     (8   . "[Layer]")
;     ;; Skip: 9
;     (10  . "[Starting XYZ coordinates]")
;     (11  . "[Ending XYZ coordinates]")
;     (12  . "[Saved view, XYZ top-right coordinates]")
;     (13  . "[Saved view, XYZ bottom-left coordinates]")
;     (14  . "[Saved view, XYZ offset-01]")
;     (15  . "[Saved view, XYZ offset-02]")
;     (16  . "[Saved view, XYZ ???]")
;     (17  . "[Saved view, XYZ ???]")
;     ;; Skip: 18-37
;     (38  . "[LWPOLYLINE, ???]")
;     (39  . "[LWPOLYLINE, ???]")
;     (40  . "[Font Height/\"VISUALSTYLE?\"/Miscellaneous]")
;     (41  . "[X Scale/Font Spacing]")
;     (42  . "[Y Scale]")
;     (43  . "[Z Scale/\"MATERIAL?\"/Miscellaneous]")
;     (44  . "[???]")
;     (45  . "[???]")
;     (46  . "[???]")
;     (47  . "[???]")
;     (48  . "[???]")
;     (49  . "[???]")
;     (50  . "[???]")
;     (51  . "[???]")
;     ;; Skip: 53-59
;     (60  . "[???]")
;     (61  . "[???]")
;     (62  . "Color index value")
;     (63  . "[???]")
;     (64  . "[???]")
;     (65  . "[???]")
;     (66  . "[???]")
;     (67  . "[???]")
;     (68  . "[???]")
;     (69  . "[???]")
;     ;;Skip 70-464
; ));setq<-list

EDIT

The response from this post, Autolisp entity data retrieval, by Mac Lee partially answer my question. However, this only covers LWPOLYLINE entities. To reiterate the original question, is there a reference source, maybe by entity type, as to the meaning of each property?

(
    (-1 . <Entity name: 7ffff706880>)  ;; Pointer to self
    (0 . "LWPOLYLINE")                 ;; Entity Type
    (330 . <Entity name: 7ffff7039f0>) ;; Point to parent
    (5 . "FFF")                        ;; Handle
    (100 . "AcDbEntity")               ;; Class
    (67 . 0)                           ;; Tilemode
    (410 . "Model")                    ;; Layout
    (8 . "0")                          ;; Layer
    (100 . "AcDbPolyline")             ;; Subclass
    (90 . 4)                           ;; Vertices
    (70 . 1)                           ;; Bitwise flag (1=Closed)
    (43 . 0.0)                         ;; Constant width
    (38 . 0.0)                         ;; Elevation
    (39 . 0.0)                         ;; Thickness
    (10 18.9133 17.6315)               ;; Vertex coordinate (OCS)

    < ... additional vertex data ... >

    (10 18.9133 12.7863)               ;; Vertex coordinate (OCS)
    (40 . 0.0)                         ;; Segment starting width
    (41 . 0.0)                         ;; Segment ending width
    (42 . 0.0)                         ;; Segment bulge
    (91 . 0)                           ;; Vertex identifier
    (210 0.0 0.0 1.0)                  ;; Extrusion (normal) vector
)

Upvotes: 0

Views: 646

Answers (2)

Lee Mac
Lee Mac

Reputation: 16015

Whilst there are several DXF groups common to all entities, it is worth noting that the DXF group numbers can mean different things for different entity types (e.g. DXF group 40 represents both text height and circle radius). As such, a general reference list by DXF group number alone does not make sense when considering all entities.

The only information that you can reliably discern from the DXF group number alone is the data type, as various ranges of DXF groups will always hold data of a predetermined type (as listed here).

In general, you can find a complete DXF reference for all entities and non-graphical objects here.

Upvotes: 1

gileCAD
gileCAD

Reputation: 2493

You can find all the values in the DXF Reference section of the AutoCAD Developper's documentation. https://help.autodesk.com/view/OARX/2023/ENU/?guid=GUID-7D07C886-FD1D-4A0C-A7AB-B4D21F18E484

Upvotes: 1

Related Questions