Reply #7 I was able to craft into a routine that works exceptionally well, but it doesn't work if the tags are nested 2 or mores times deep within the block.
Even though it's ugly, it works: (At a later date, I'll have to re-write it again to clean it up.)
(defun FINDNESTEDTAGS
(nested RinCode
) lst nil
TagAtts nil
lst nil)
);progn
);if
);and
(cond; this section just puts the number attributes to 3 digits dot two digits, i.e. change 0.00 & 00.00 to 000.00 (T 1stAtt)
);cond
);strcat
);setq
);progn
);and
);progn
(cond; this section just puts the number attributes to 3 digits dot two digits, i.e. change 0.00 & 00.00 to 000.00 (T 1stAtt)
);cond
);strcat
);setq
);progn
);if
);progn
);if
);while
);progn
);if
);progn
);if
);if
);repeat
lst
)
Called using:
(setq Allblocks
(vl-remove "(0 90)" (FINDNESTEDTAGS
"EQPMTAG" 1)))
The one I posted in reply #8 also works exceptionally well, but it won't separate out the tags that are set to be invisible by the visibility parameter within the block.
I've attached another cad file showing the various types of blocks I'm dealing with. block "28_15" is a block that has a block named "28.15" inside of it. Within "28.15" is the blocks that have the tags. I didn't set these up this way and I wish they had never been set up that way, but it's what I have to work with.
The other block, "21.09" has visibility parameters. When you open up the file, the visibility parameter is set to have tag "21.09/E3" hidden.
When I run routine from reply #8, it picks up the invisible tag. When I run routine from reply #7, it doesn't pick up the tags from block "28_15"'s block "28.15".
I've re-written each of these from scratch several times and each time I get the same results. I'm don't know if it's something I'm missing, or, it's something beyond my knowledge. I simply can't seem to figure it out.
Maybe here's another way of looking at it;
In the routine _listofblockswithnestedblock, after this (if (= nested "EQPMTAG") on line 23, how would I filter out the tags that are not visible?
In the routine FINDNESTEDTAGS, how would I either change (setq ss (ssget "_X" '((0 . "INSERT"))) on line 22, to something that selects all blocks in the database, similar to (vla-get-blocks (vla-get-activedocument (vlax-get-acad-object)), or, through lines 34-67 go deeper into the block to find the tags.
One last thing, by changing the equipment tag name from "ERINTAG" to "EQPMTAG", these routine work for either type. Bonus!
I hope I'm not being a PITA. I truely appreciate everything you've done for me.
Rabbit