TheSwamp
Code Red => AutoLISP (Vanilla / Visual) => Topic started by: Lastknownuser on September 13, 2022, 05:09:20 AM
-
Hi! I want to know if its possible to find number and names of block tags in drawing, without selection. Example, I have a block called CONS_C1 with tags NUMBER, HEIGHT, LLC, EEC.
I'd like to, just by knowing name of the block, find out number of tags, and names if possible, but the number is mainly what I want.
I tried the following
(setq doc (vla-get-activedocument (vlax-get-acad-object)))
(setq testblock (vla-item (vla-get-blocks doc) "CONS_C1"))
And with
(vla-get-count testblock)
I get some something (number of tags+1), but not sure if its the best way to do what I need.
Any help welcome, thanks!
-
If I got you right, you want to get the number of certain block name inserted into your current DWG then if so here is an example.
NOTE: this works with regular blocks and not with dynamic
(if (setq ss
(ssget "_X" '
((0 .
"INSERT") (2 .
"CONS_C1")))) " >"
)
)
)
-
If I got you right, you want to get the number of certain block name inserted into your current DWG then if so here is an example.
NOTE: this works with regular blocks and not with dynamic
(if (setq ss
(ssget "_X" '
((0 .
"INSERT") (2 .
"CONS_C1")))) " >"
)
)
)
No, not really. Block is not inerted into drawing model space. I just know the name of the block, that potentially can be inserted (picture 1).
I'd like to find out number and names of that block attribute tags (not values because the block is not inserted of course). So in this case (picture 2), result would be number of tags: 4, and their names (NUMBER, HEIGHT, LLC, EEC)
-
Something like this ?
-
Something like this ?
Yes, thank you!
-
Yes, thank you!
You're welcome anytime.