Well, this is weird. It has to be done with REFEDIT if you want the Text to remain in the drawing. But REFEDIT is very finicky about how you select the Block. You can't just give it an entity name, but it wants a pick. I tried having it select by the insertion point, where there always seems to be something drawn to pick on, but you have a lot with coinciding insertion points, so it was something seeing the wrong one. So I tried Isolating each one. That works for over a hundred of them, but it hangs up when it gets to the Block named Bcement1120, asking again for selection. I don't see anything about that one that's different from others in a way that should cause this. It even leaves the drawing in a weird state regarding object selection and highlighting. I tried turning off Undo recording, I tried freezing the "freez" Layer just in case, I tried getting rid of that particular Block but it just hangs up on the next one. In case you or anyone wants to try whether the same happens for them, here's the latest iteration:
(defun C:UNCT ; = Un-Nest Cement Text
(/ ss n blk)
(if (setq ss (ssget "_A" '((0 . "INSERT") (2 . "Bcement*"))))
(progn ; then
(command
"_.layer" "_thaw" "*" "_on" "*" ""
"_.regen"
); command
(repeat (setq n (sslength ss)); then
(setq blk (ssname ss (setq n (1- n))))
(command
"_.isolateobjects" blk ""
"_.-refedit"
(getpropertyvalue blk "Position")
"_ok" "_all" "_no"
"_refset" "_remove" (ssget "_A" '((0 . "TEXT") (8 . "Cement_Total") (1 . "CT=*"))) ""
"_.refclose" "_save"
"_.unisolateobjects"
); command
); repeat
); progn
); if
(prin1)
)
Kent Cooper, AIA