Hey guys I need some help. I have a lisp that isn't working the greatest. Here is what I want the lisp to do (in english form):
Set current layer to 0 turn all layers thaw all layers and unlock all layers
regen all then zoom extents
burst everything down to just entintes (no the drawings have no xrefs in them)
change everything to color by layer
audit and purge
here is the lisp:
(DEFUN C:BASECLEAN ()
(COMMAND "-LAYER" "SET" "0" "ON" "*" "THAW" "*" "UNLOCK" "*" "")
(COMMAND "REGENALL" "ZOOM" "E")
(while (ssget "X" '((0 . "INSERT")))
(sssetfirst nil (ssget "X" (list )))
(c:burst))
(COMMAND "CHANGE" "ALL" "P" "C" "BYLAYER" "")
(command "audit" "y")
(command "-purge" "all" "" "n")
(command "-purge" "all" "" "n")
)
what am I doin wrong?
Solved! Go to Solution.
Solved by Kent1Cooper. Go to Solution.
@jermjmm wrote:....
change everything to color by layer
....
(COMMAND "CHANGE" "ALL" "P" "C" "BYLAYER" "")
....
There may be other problems, but one I notice: You need to complete the object selection with an Enter [""]:
(COMMAND "CHANGE" "ALL" "" "P" "C" "BYLAYER" "")
[Or use the shorter command]:
(COMMAND "CHPROP" "ALL" "" "C" "BYLAYER" "")
Thanks for the suggestion (will implement) but it just locks up, I think there may be some blocks in my drawings that can not be exploded, how do I change this part to just repeat 4 times?
(while (ssget "X" '((0 . "INSERT")))
(sssetfirst nil (ssget "X" (list )))
(c:burst))
@jermjmm wrote:Thanks for the suggestion (will implement) but it just locks up, I think there may be some blocks in my drawings that can not be exploded, how do I change this part to just repeat 4 times?
(while (ssget "X" '((0 . "INSERT")))
(sssetfirst nil (ssget "X" (list )))
(c:burst))
I don't know about Burst, but I do know that Explode cannot work on a whole (ssget) selection set at once, unless you change the setting of the mysterious QAFLAGS System Variable [search the Discussion Group, and you'll find lots of threads about that].
You could try:
(repeat 4
(if (ssget "X '((0 . "INSERT")))
....