My goal is to be able to retrieve this info using lisp. This is what I can do so far...
This drawing has a single dynamic block in it called "Label - 200 to 50x20mm"
If you select it and check out the properties, you will see that under the "Custom" heading that there is a "visibility" property which you can select to be one of the followng:
200x20mm
150x20mm
100x20mm
75x20mm
50x20mm
If you type or copy the following lisp into the command line:
(Setq Ent (entget (Setq EntName (ssname (Setq Handle(ssget)) 0))))
& then select the block and press enter, you get the following info:
((-1 . ) (0 . "INSERT") (5 . "1AA") (102 .
"{ACAD_XDICTIONARY") (360 . ) (102 . "}") (330 .
name: 7eaf9cf8>) (100 . "AcDbEntity") (67 . 0) (410 . "Model") (8 . "0") (100 .
"AcDbBlockReference") (66 . 1) (2 . "*U9") (10 -15.403 -5.69862 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))
The name of the block is some reference name like:
(2 . "*U9")
To get the real name, copy and paste the following onto the command line:
(progn
(Setq DictName (cdr (assoc 360 Ent))) ;Get the Dictionary Name from the Entity
(Setq Dict (entget DictName)) ;Get the Dictionary from the Dictionary Name
(setq Dict1 (entget (setq Dict1Name (cdr (assoc 360 Dict )))))
(setq Dict2 (entget (setq Dict2Name (cdr (assoc 360 Dict1)))))
(setq Block (entget (setq BlockName (cdr (assoc 340 Dict2)))))
(cdr (assoc 2 Block))
)
which returns:
"Label - 200 to 50x20mm"
Next I can get the attributes (1 at a time) using the following code:
(Setq Ent (entget (Setq EntName (entnext EntName))))
which returns:
((-1 . ) (0 . "ATTRIB") (330 . )
(5 . "1AB") (100 . "AcDbEntity") (67 . 0) (410 . "Model") (8 . "PARTS") (100 .
"AcDbText") (10 -20.8887 -2.19862 0.0) (40 . 3.0) (1 . "Text 1") (50 . 0.0) (41
. 0.8) (51 . 0.0) (7 . "ROMANS") (71 . 0) (72 . 1) (11 -15.403 -0.698618 0.0)
(210 0.0 0.0 1.0) (100 . "AcDbAttribute") (2 . "TEXTLINE1_1") (70 . 😎 (73 . 0)
i.e. the first attribute's name is "TEXTLINE1_1", and it contains the value of "Text 1"
run that command again (while in the command line press the up arrow key) and you get the second attributes details:
((-1 . ) (0 . "ATTRIB") (330 . )
(5 . "1AC") (100 . "AcDbEntity") (67 . 0) (410 . "Model") (8 . "PARTS") (100 .
"AcDbText") (10 -21.2316 -7.19862 0.0) (40 . 3.0) (1 . "Text 2") (50 . 0.0) (41
. 0.8) (51 . 0.0) (7 . "ROMANS") (71 . 0) (72 . 1) (11 -15.403 -5.69862 0.0)
(210 0.0 0.0 1.0) (100 . "AcDbAttribute") (2 . "TEXTLINE1_2") (70 . 😎 (73 . 0)
(74 . 2))
i.e. the second attribute's name is "TEXTLINE1_2", and it contains the value of "Text 2"
run that command again (while in the command line press the up arrow key) and you get the third (final) attributes details:
((-1 . ) (0 . "ATTRIB") (330 . )
(5 . "1AD") (100 . "AcDbEntity") (67 . 0) (410 . "Model") (8 . "PARTS") (100 .
"AcDbText") (10 -21.2316 -12.1986 0.0) (40 . 3.0) (1 . "Text 3") (50 . 0.0) (41
. 0.8) (51 . 0.0) (7 . "ROMANS") (71 . 0) (72 . 1) (11 -15.403 -10.6986 0.0)
(210 0.0 0.0 1.0) (100 . "AcDbAttribute") (2 . "TEXTLINE1_3") (70 . 😎 (73 . 0)
(74 . 2))
i.e. the third attribute's name is "TEXTLINE1_3", and it contains the value of "Text 3"
However, that is as far as I get! ! !
???????????????????????????????????????????????????????????????????????????????????
How do I obtain the current visibility state as seen in the objects properties, i.e. "100x20mm" for example?
???????????????????????????????????????????????????????????????????????????????????