Hey guys, I have a bit of a dilemma with a piece of code and a user needs a fix ASAP.
here's my cituation:
(setq BlocksInCtab (ssget "_X" (list (cons 0 "INSERT") (cons 410 (getvar 'CTAB)))))
I didn't know when converting a drawing from Microstation to AutoCAD, you could still have some attributed blocks. Now I need to pull these attributed blocks from the selection set 'BlocksInCtab'.
Here's the information of the blocks I need to take out of the selection set:
((-1 . <Entity name: 7824bc10>) (0 . "INSERT") (330 . <Entity name: 7e977000>)
(5 . "12") (100 . "AcDbEntity") (67 . 0) (410 . "Model") (8 . "INST") (62 . 5)
(6 . "Continuous") (100 . "AcDbBlockReference") (66 . 1) (2 . "INSTAG_2") (10
-14.9502 8.98438 0.0) (41 . 0.00208151) (42 . 0.00208151) (43 . 0.00208151) (50
. 0.0) (70 . 0) (71 . 0) (44 . 0.0) (45 . 0.0) (210 0.0 0.0 1.0))
((-1 . <Entity name: 7824bf88>) (0 . "INSERT") (330 . <Entity name: 7e977000>)
(5 . "29") (100 . "AcDbEntity") (67 . 0) (410 . "Model") (8 . "TEXT") (62 . 2)
(6 . "Continuous") (100 . "AcDbBlockReference") (66 . 1) (2 . "DETA") (10
-20.8594 16.5518 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: 7824bd38>) (0 . "INSERT") (330 . <Entity name: 7e977000>)
(5 . "27") (100 . "AcDbEntity") (67 . 0) (410 . "Model") (8 . "TEXT") (62 . 2)
(6 . "Continuous") (100 . "AcDbBlockReference") (66 . 1) (2 . "CTAG") (10
-21.9521 15.8564 0.0) (41 . 1.0) (42 . 1.0) (43 . 1.0) (50 . 3.14159) (70 . 0)
(71 . 0) (44 . 0.0) (45 . 0.0) (210 0.0 0.0 1.0))
The last two are on the same layer (coincidental), but the first is on a different layer, so selecting by layer is not a good choice.
Can I select them by name with a wildcard for the #'s at the end of the name as with the first one ??
I don't see any information in these which would allow a selection by attribute or a block with text. Can I select all blocks with text ??
And if that be the case, then this would be a really simple fix if I can select all blocks that do NOT have text.
(setq BlocksInCtab (ssget "_X" (list (cons 0 "INSERT") [color=red](cons 0 "ALL BLOCKS WITHOUT TEXT")[/color] (cons 410 (getvar 'CTAB)))))
What are your idea's, suggestions, and otherwise expertise help with this dilemma I have created for myself ??
Thank you in advance.