Hi,
I think you want to create two command "STEP1" (It's Joining all) & "STEP2" (It's Exploding all), if so then.......
For command "STEP1"
You can not use "layfrz" like this way "(command "layfrz")" within a code ...... it will give error....
Try this way to "Freeze" the picked layer.....(Blue one)
(defun C:STEP1()
(setq CLay (getvar "CLAYER"))
(princ "\nSelect object on layer to freeze Or press enter to end (layfrz) command & move to next..")
(while (setq EntName (car (entsel)))
(setq EntList (entget EntName))
(setq Lay (cdr (assoc 8 EntList)))
(if (and (= Lay CLay)(/= Lay "0"))
(command ".LAYER" "T" "0" "U" "0" "ON" "0" "S" "0" "")
)
(if (= Lay "0")
(princ "\nCannot freeze layer 0.")
(command ".LAYER" "F" Lay "")
)
);while
(command "pedit" "multiple" "all" "" "Y" "join" "0.0000" "")
(if (setq Sel (ssget "_X" (list'(0 . "*POLYLINE")'(-4 . "&=")'(70 . 1)(cons 410 (getvar 'CTAB)))))
(command "_.chprop" Sel "" "_color" "_colorbook" "DIC COLOR GUIDE(R) PART II" "DIC 2630" "")
)
)
For command "STEP2"
You can not use "overkill" like this way "(command "-overkill" "all" "" "done")" within a code ...... it will give a message "Command: -overkill Unknown command "-OVERKILL". Press F1 for help."...
Try this way to "overkill" .....(Blue one)
(defun C:STEP2()
(setq timesexplode 10)
(repeat timesexplode
(setvar "qaflags" 1)
(command ".explode" (ssget "_X" ) "")
(setvar "qaflags" 0)
); explode 10 times (found this on the forums...
(command "_change""_all""""p""e""0""");puts all 2d geometry on elevation 00
(load "overkillsup")
(acet-overkill2 (list (ssget "X") 0.000001 nil nil nil nil))
(command "-purge" "all" "" "no");purge all
(alert "Don't forget to check over your work once more.")
(command "laythw")
)
To find out more about overkill check this.....
https://forums.autodesk.com/t5/autocad-forum/how-do-i-call-overkill-in-a-lisp-function/td-p/2185688
Debashis Bhunia
Co-Founder of Geometrifying Trigonometry(C)
________________________________________________
Walking is the First step of Running, Technique comes Next....