To explain: The dictsearch gives the DXF list of the entile MLeaderStyle dictionary. This contains an item (3 . "StyleName") followed by an item (350 . <Entity name: ###>) for each entry in that dictionary. The 350 code refers to the entity which defines the style, the 3 code is the name of that entry - and in this case the same as the name of the style.
Now the "advanced" idea is how I extract only the names from that entire DXF list:
- The vl-remove-if-not removes all items from a list if a predicate function returns nil for that item.
- The lambda is an unnamed function. I could have declared it as a normal defun, but that would be too much typing. It simply checks if the car of the item is 3.
- The mapcar performs a function on each item in the list. In this case it cdr's each item.
So the dictsearch list might be something like this:
((-1 . <Entity name: 7ffffbb31c0>) (0 . "DICTIONARY") (5 . "4B4") (102 .
"{ACAD_REACTORS") (330 . <Entity name: 7ffffbb18b0>) (102 . "}") (330 . <Entity
name: 7ffffbb18b0>) (100 . "AcDbDictionary") (280 . 0) (281 . 1) (3 . "AR-LDR")
(350 . <Entity name: 7ffffb1fe40>) (3 . "ARLDR") (350 . <Entity name:
7ffffb0be00>) (3 . "DETREF-A") (350 . <Entity name: 7ffffb0be10>) (3 .
"Standard") (350 . <Entity name: 7ffffb28a20>) (3 . "Xref$0$RSA-ARROW-2") (350
. <Entity name: 7ffffb1fe50>))
Then the list returned through the vl-remove-if-not becomes this:
((3 . "AR-LDR") (3 . "ARLDR") (3 . "DETREF-A") (3 . "Standard") (3 .
"Xref$0$RSA-ARROW-2"))
And finally the mapcar returns this:
("AR-LDR" "ARLDR" "DETREF-A" "Standard" "Xref$0$RSA-ARROW-2")