Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Cleaning drawings

4 REPLIES 4
SOLVED
Reply
Message 1 of 5
jermjmm
511 Views, 4 Replies

Cleaning drawings

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?

4 REPLIES 4
Message 2 of 5
Kent1Cooper
in reply to: jermjmm


@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" "")

Kent Cooper, AIA
Message 3 of 5
jermjmm
in reply to: Kent1Cooper

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))


Message 4 of 5
Kent1Cooper
in reply to: jermjmm


@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")))

    ....

Kent Cooper, AIA
Message 5 of 5
jermjmm
in reply to: Kent1Cooper

THANKS  that worked (I forgot about the repeat command).

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost