In dxf coding group 66 is used to flag whether a block has entites (attributes) that follow, a 0 indicating none, a 1 indicating at least 1.
For example, in your data --
( (-1 . <Entity name: 7dd0a590>)
(0 . INSERT)
(330 . <Entity name: 7da62cf8>)
(5 . 182)
(100 . AcDbEntity)
(67 . 1)
(410 . Layout1)
(8 . 0)
(100 . AcDbBlockReference)
(66 . 1) <== has attributes.
(2 . A1_SHEET)
(10 0.0 0.0 0.0)
(41 . 1.0)
(42 . 1.0)
(43 . 1.0)
(50 . 0.0)
(70 . 0)
(71 . 0)
(44 . 0.0)
(45 . 0.0)
(210 0.0 0.0 1.0)
)
But how do you get them?
Block instances and attributes (or head polyline entity and vertices) utilize a scheme that is loosely based on linked lists: Have a head item, and if there are associated items, each item points to the next item unitil you reach the last item, which either points to the first item or nothing. And so it is with block inserts and attributes.
Example insert with 3 attributes --
(
(-1 . <Entity name: 7ef60ee8>)
(0 . "INSERT")
(330 . <Entity name: 7ef60cf8>)
(5 . "95")
(100 . "AcDbEntity")
(67 . 0)
(410 . "Model")
(8 . "0")
(100 . "AcDbBlockReference")
(66 . 1) ;; <== has entities that follow
(2 . "IMPLODE-00000")
(10 18.1549 14.9443 0.0)
(41 . 1.0)
(42 . 1.0)
(43 . 1.0)
(50 . 0.0)
(70 . 0)
(71 . 0)
(44 . 0.0)
(45 . 0.0)
(210 0.0 0.0 1.0)
)
(
(-1 . <Entity name: 7ef60ef0>)
(0 . "ATTRIB")
(330 . <Entity name: 7ef60ee8>)
(5 . "96")
(100 . "AcDbEntity")
(67 . 0)
(410 . "Model")
(8 . "0")
(100 . "AcDbText")
(10 17.3741 14.852 0.0)
(40 . 0.2)
(1 . "Default Value")
(50 . 0.0)
(41 . 1.0)
(51 . 0.0)
(7 . "Standard")
(71 . 0)
(72 . 0)
(11 17.3741 14.952 0.0)
(210 0.0 0.0 1.0)
(100 . "AcDbAttribute")
(2 . "ATTRIB_01")
(70 . 0)
(73 . 0)
(74 . 2)
)
(
(-1 . <Entity name: 7ef60ef8>)
(0 . "ATTRIB")
(330 . <Entity name: 7ef60ee8>)
(5 . "97")
(100 . "AcDbEntity")
(67 . 0)
(410 . "Model")
(8 . "0")
(100 . "AcDbText")
(10 17.3741 13.7294 0.0)
(40 . 0.2)
(1 . "Default Value")
(50 . 0.0)
(41 . 1.0)
(51 . 0.0)
(7 . "Standard")
(71 . 0)
(72 . 0)
(11 17.3741 13.8294 0.0)
(210 0.0 0.0 1.0)
(100 . "AcDbAttribute")
(2 . "ATTRIB_02")
(70 . 0)
(73 . 0)
(74 . 2)
)
(
(-1 . <Entity name: 7ef60f00>)
(0 . "ATTRIB")
(330 . <Entity name: 7ef60ee8>)
(5 . "98")
(100 . "AcDbEntity")
(67 . 0)
(410 . "Model")
(8 . "0")
(100 . "AcDbText")
(10 17.3741 12.5506 0.0)
(40 . 0.2)
(1 . "Default Value")
(50 . 0.0)
(41 . 1.0)
(51 . 0.0)
(7 . "Standard")
(71 . 0)
(72 . 0)
(11 17.3741 12.6506 0.0)
(210 0.0 0.0 1.0)
(100 . "AcDbAttribute")
(2 . "ATTRIB_03")
(70 . 0)
(73 . 0)
(74 . 2)
)
(
(-1 . <Entity name: 7ef60f08>)
(0 . "SEQEND") ;; <== flags "end of the list"
(330 . <Entity name: 7ef60ee8>)
(5 . "99")
(100 . "AcDbEntity")
(67 . 0)
(410 . "Model")
(8 . "0")
(-2 . <Entity name: 7ef60ee8>) ;; <== points to the block insert
)
Bla, bla, I just want the attributes!
Ok, ok. The following function, if passed the ename of a block with attributes (or heavyweight 2d/3d poly w/vertices) will return an ordered list of all the child entity names. From that point you can the perfrom entgets, entmods etc. to suit.
(defun Children ( ename / result )
(if (assoc 66 (entget ename))
(reverse
(while
(/= "SEQEND"
(cdr
(assoc 0
(entget
(setq ename
(entnext ename)
)
)
)
)
)
(setq result (cons ename result))
)
)
)
)
Example:
(children (car (entsel))
might return
( <Entity name: 7ef60ef0>
<Entity name: 7ef60ef8>
<Entity name: 7ef60f00>
)
Let me know if you want more info.
Ackkk, it's way to early for a post like this.