-OVERKILL command string

-OVERKILL command string

frankie_rankin
Participant Participant
391 Views
7 Replies
Message 1 of 8

-OVERKILL command string

frankie_rankin
Participant
Participant

Hi,

I am currently attempting to write some LISP code to carry out the -OVERKILL, -PURGE, AUDIT and SPELL commands in this specific order in an attempt to make an easy way to clean up drawings in AutoCAD 2023.

Unfortunately, I am having some issues with the -OVERKILL command, specifically simulating the enter key after object selection. I have attempted to use " " and ";" to no effect.

If anyone has any tips on how to get this to work that would be great! I have copied my attempt at coding this below for anyone to check out.

Thank you!

 

(defun c:CLEANUP ( / )
(princ "\nStarting drawing cleanup...")

(command "-OVERKILL" "ALL" ";" "D")
(princ "\nNo objects to clean with OVERKILL.")

(command "-PURGE" "ALL" "*" "N")

(command "AUDIT" "Y")

(command "SPELL")

(princ "\nCleanup complete.")
(princ)
)

 

0 Likes
Accepted solutions (1)
392 Views
7 Replies
Replies (7)
Message 2 of 8

-didier-
Advisor
Advisor

Bonjour @frankie_rankin 

 

Try with this syntax : 

(command "-overkill" "_all" "" "" )

Tell me if it works on your pc please

 

Amicalement

Éternel débutant.. my site for learning : Programmer dans AutoCAD

DA

EESignature

0 Likes
Message 3 of 8

frankie_rankin
Participant
Participant

Hello @-didier- 

 

I have attempted to use that syntax and unfortunately it doesn't seem to work.

it appears to get up to "_all" before being unable to continue.

0 Likes
Message 4 of 8

Kent1Cooper
Consultant
Consultant
Accepted solution

@-didier- wrote:

....

(command "-overkill" "_all" "" "" )

....


That works for me.  Could there be a language-version or undefinition problem?  Try "_.-overkill" .  Are there any messages?

Kent Cooper, AIA
Message 5 of 8

paullimapa
Mentor
Mentor

works fine on my 2023.1.8

_.PNG

 


Paul Li
IT Specialist
@The Office
Apps & Publications | Video Demos
0 Likes
Message 6 of 8

Sea-Haven
Mentor
Mentor

Works for me Bricscad.

 

"" is the equivalent of pressing Enter in a lot of code.

 

(command "line" pt1 pt2 "")

 

0 Likes
Message 7 of 8

-didier-
Advisor
Advisor

Bonjour @frankie_rankin 

 

I am surprised by what you are writing about the non-functioning of the line of code.

What reassures me are the answers of the other members who confirm my version.

Try again please.

 

Amicalement

Éternel débutant.. my site for learning : Programmer dans AutoCAD

DA

EESignature

0 Likes
Message 8 of 8

frankie_rankin
Participant
Participant

Hi @Kent1Cooper 

I just made the change you suggested and it worked right away!

thank you all for your help with this, it's really appreciated

0 Likes