Simple Autolips but I consistently get an error.

Simple Autolips but I consistently get an error.

SnickerinTurtles
Enthusiast Enthusiast
2,013 Views
21 Replies
Message 1 of 22

Simple Autolips but I consistently get an error.

SnickerinTurtles
Enthusiast
Enthusiast

Hi all, 

 

I wanted a simple AutoLisp command that will Delete reg apps, purge, and then audit at the end. 

Maybe call it CUD (Clean Up Drawing). Which seems simple enough. However, when I run my lisp it works fine, but when I go to open a new dwg or another dwg file I get this error.

Capture1.JPG

Or this exact message but the "c:bb" will be replaced with something else.

This will continue as long as I have the CUD.lsp function loaded. I noticed anytime I do not have CUD.lisp loaded I never get the error when open new or other dwgs. 

 

Here is the code for CUD (Clean Up Drawing)

 

(defun CUD()

(command "-pu" "r" "*" "n") ;deletes reg apps

(command "-pu" "a" "*" "n") ;purges drawing

(command "audit" "y") ;audits drawing

(princ)

)

 

Did I miss something here?

0 Likes
2,014 Views
21 Replies
Replies (21)
Message 21 of 22

Sea-Haven
Mentor
Mentor

The ^c^c or ^c^c^p is used in pop menus it is the same as saying cancel cancel, some commands do need 2 cancels to finish

0 Likes
Message 22 of 22

Scottu2
Advocate
Advocate

Hello SnickerinTurtles,

 

I had a (remotely) similar problem.  My code would run normally because it was loaded manually to edit the routine; but, opening a new drawing would cause an error.

It turned out to be an error in an unrelated routine that failed to preload from the acad.lsp routine.

That failure stopped loading of other routines and preset variables.

 

Perhaps a simple Test if the c:bb routine is loading from the file you found by renaming the routine to c:bbx.

Restart acad

Type in bb, it should say unknown command, otherwise, some other file is defining the c:bb routine.

 

Its possible that BB is an actual autocad routine.  Use the Undefined command tell autocad to release BB from protected mode.

 

Isolate the routine

If there are any other programs preloading at startup then turn them off and only pre-load the c:cud routine

Restart acad

 

 

0 Likes