I have multiple floor plans in a drawing one of which I need to explode 3-4 times to change the lineweight to 9mm. I have tried to put something that will repeat explode but I am having problems with plines within the blocks not exploding.
(defun c:tmp (ss)
(setq ss (ssget))
(setvar 'qaflags 1)
(repeat 3 (vl-cmdf "._explode" ss ""))
(setvar 'qaflags 0)
(vl-cmdf "chprop" ss "" "lw" "0.09" "")
)
Solved! Go to Solution.
Solved by hmsilva. Go to Solution.
I think that is what you want, try it, is minimally tested...
hope that helps
Henrique
Very nice... You saved the day. I was testing your code this morning and removed the *POYLINE,MLINE from the filter and it worked perfect for my purposes.
I have this block of a window with the glass created with mline and it just would not change the lineweight for the glass created on the left side. So my options were to remove MLINE from the filter or edit my block using just lines.
I attached the block if you would like to test. Maybe you might have a better explanation. Thanks again...
smaher12,
revised code, with mline, polyline, layer S-FL-TILE, and minimally tested with the dwg's you provide...
(defun c:test (/ ss old-echo item ss1 item1 ss2 ss3 ss4) (setq old-echo (getvar "CMDECHO")) (setvar "CMDECHO" 0) (if (setq ss (ssget '((0 . "~*TEXT")))) (progn (if (setq ss3 (ssget "_P" '((8 . "S-FL-TILE")))) (progn (command "select" ss "_r" ss3 "") (setq ss nil) (setq ss (ssget "_P")) (command "erase" ss3 "") );; progn );; if (command "chprop" ss "" "lw" "0.09" "") (if (setq ss1 (ssget "_P" '((0 . "INSERT,*POLYLINE,MLINE")))) (foreach item (mapcar 'cadr (ssnamex ss1)) (command "Explode" item) (if (setq ss4 (ssget "_P")) (progn (command "chprop" "_P" "" "lw" "0.09" "") (setq ss4 nil) );; progn );; if (while (setq ss2 (ssget "_P" '((0 . "INSERT,*POLYLINE,MLINE")))) (foreach item1 (mapcar 'cadr (ssnamex ss2)) (command "Explode" item1) (command "chprop" "_P" "" "lw" "0.09" "") );; foreach );; while (if (setq ss (ssget "_P")) (command "chprop" ss "" "lw" "0.09" "") );; if );; foreach );; if );; progn );; if (setvar "CMDECHO" old-echo) (princ) );; test
Henrique