Entity Data4.207 | Tutorials and Sampleswrite requests to: takehiko@mit.edu last revised : 2/5/01 AutoLOADER© Set Up |
![]() |
(c:demo)
(print_entity_data entity)
(print_entity_data line_1 )
(print_entity_data nil )
( (-1 . <Entity name: 1016f950>) ; entity name (changes when a file is re-opened.) (0 . "LINE") ; entity type (0 . "CIRCLE") ; entity type (5 . "462") ; entity handle (stays the same in a re-opened file.) (40 . 60.0) ; radius for a circle (must be described in float.) (67 . 0) ; indicates model or paper space (8 . "layer1") ; layer (62 . 1) : color number (If by-layer, this is omitted. If by-block 0) (10 0.0 0.0 0.0) ; primary point (an endpoint for a line entity) (11 100.0 100.0 0.0) ; another point (the other endpoint for a line entity) )
(get_data_for_group_code group_code entity)
(get_data_for_group_code 10 line_1 )
(get_data_for_group_code 10 nil )
(change_data_for_group_code group_code entity new_value)
Notice that not all the values associated to an entity's group codes are changable. Some (such as entity type, entity handle and entity name) are read only.
(change_data_for_group_code 11 nil (list 100 200 0) )
(change_data_for_group_code 8 nil "y_layer" )
(c:get-pline-vertices)
(c:get-pline-vertices)
( (-1 . <Entity name: 1016f950>) ; entity name (changes when a file is re-opened.) (0 . "PLINE") ; entity type (8 . "layer1") ; layer ..... ; other information )Next, you can get its first vertex by issuing
(setq first-vertex (entnext pline-entity))
The result of (entget first-vertex) will then be .
( (-1 . <Entity name: 1016d580>) ; entity name of the component point (0 . "VERTEX") ; entity type is "VERTEX" (8 . "layer1") ; layer (10 10.5462 28.3899 0.0) ; DXF group code 10 gives xyz coordinates ..... )You can repeat the process to get all other vertices. For example,
(setq second-vertex (entnext first-vertex))
When you exceed the last vertex, what happens then?
(setq end-marker (entnext last-vertext))
The result of (entget end-marker) will then be
( (-1 . <Entity name: 1016d582>) ; entity name of the termination marker (0 . "SEQEND") ; entity type "SEQEND" signals the end of vertices (5 . "37") (100 . "AcDbEntity") (67 . 0) (8 . "0") (-2 . <Entity name: 1016f950>) ; DXF group code -2 points back at the pline entity )