SLW210 发表于 2022-7-5 20:00:26

Select all or convert *X### An

I need a way to select all the *X anonymous blocks (Hatches) and either convert to regular blocks, back into a hatch or just delete them.
 
QSelect will only do it one at a time, wildcard doesn't seem to work, Filter doesn't appear to recognize anonymous blocks, either.
 
I have a lot to do, one at a time , while not impossible for one drawing, I have several .dwg I would like to do.
 
Thanks in advance.
 
Here is a drawing with one *X in it.
Anonymous Hatch.dwg

Lee Mac 发表于 2022-7-5 20:22:02

Here's some quick code to select all blocks in the active layout/viewport with block names starting "*X":

(defun c:myblksel nil   (sssetfirst nil       (ssget "_X"         (list            '(0 . "INSERT")            '(2 . "`*X*")               (if (= 1 (getvar 'cvport))                   (cons 410 (getvar 'ctab))                  '(410 . "Model")               )         )       )   )   (princ))The code could of course be modified to convert/explode/delete if necessary.
 
Lee

SLW210 发表于 2022-7-5 20:43:34

Thanks!!
 
Works a treat, I was surprised Filter didn't handle these.
 
Would have been nice to convert them, but I just mainly wanted them gone and they aren't really necessary for my current work.
 
Once again, I appreciate this.

Lee Mac 发表于 2022-7-5 20:47:55

No worries Steve, you're welcome!

VVA 发表于 2022-7-5 21:02:50

Try to use U2B or U2BM command from here (download         bgtools2.32.zip from #1)
页: [1]
查看完整版本: Select all or convert *X### An