Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Closing a drawing in LISP

Status
Not open for further replies.

Volk359

Technical User
Jun 30, 2004
395
US
Greetings all,

A quick way to purge bloated drawings is to wblock them and what I'd like to do is wblock them onto the original drawing then open that drawing or at the least close it. The lisp ran fine in R14 but in 2008 something's changed and it doesn't work.

I stripped out the extraneous stuff and got to bare bones:
Code:
(setvar "CMDECHO" 0)
(setvar "EXPERT" 2)
(command "QSAVE" "WBLOCK" (strcat (getvar "dwgprefix") (GETVAR "DWGNAME")) "y" "*")

That works fine but closing the drawing requires a save or no save. If I manually type in CLOSE and N at the prompt the new purged drawing is kept however if I add

Code:
(command "close" "n")

to the lisp the drawing reverts back to its old bloated self.

What is the difference between typing it in and running the same command in LISP? Is there a fix for this?

Thanks,

Keith
 
I tried it & got this message:

Command: (command "close" "n")
close Really want to discard all changes to drawing? <N>
So in this case you want a "yes" to discard changes.
 
Correct. If the changes are saved then it reverts back to the original file size and if not saved it keeps the new smaller file.

For some reason by the command line it works but not in LISP.
 
No the command line does not say "save" changes it says "discard", so you say "yes" which means do not save. or so I would interpret and at least try.
 
Ah, I see, I've been going by the dialog box, i.e yes, no or cancel. Good eye, thanks!
 
I've learned to trust my eye more than my first impression :)
You're welcome, glad to help.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top