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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

toolbar button to close without saving?

Status
Not open for further replies.

vbcad

Technical User
Jul 12, 2002
159
US
I have been trying to figure out how to close the active drawing without saving. I would like to accomplish this by a single click without having to click the yes, no or cancel button on the dialog box. This has been a popular topic in the past but did not find it in the forum.
 
I have tried this already. it gives the uknown command and then the command line says "really want to discard all changes to drawing? <N>" I thought that the code would work also. It seems like it should be so simple.
 
still the same result except the dialog box asking me if i want to save or not pops up.
 
Hmmm... I've tried a number of ways and wasn't successful. Seems to me it's a rather dangerous thing to do anyway. Don't know how many times I've closed a drawing and answered "no, of course I don't" to the save yes or no button then realized I just lost all the work I'd done since last change. Usually when working 'til the late hours . ;-)
 
I NEED IT FOR REVIEW OF OTHERS DRAWINGS AND NEVER WANT TO SAVE CHANGES. IT IS A MINOR HASSLE WITH THE DIALOG BOX BUT WOULD LIKE TO FIND A WAY TO CLOSE WITHOUT SAVING. MAYBE VBA?
 
Setting CMDDIA to 0 will inhibit the dialog boxes but doesn't work for close. The point I meant to make was as it is a potentially dangerous method of closing a drawing (inadvertant loss of changes) that Autodesk make have purposely suppressed the inhibit for the close command.

VBA... probably, unfortunately I wouldn't be much help there. Sorry.
 
i have a feeling it is built into windows somehow as this is a common dialog across just about any application i can think of.
 
Hi vbcad,

Try this in your button:

Code:
(command "vbastmt" "application.ActiveDocument.Close" "False")

HTH
Todd
 
this seems to save the drawings. i know by the code it is not supposed too, however it saves the drawing in the my documents folder.(if it is a new drawing and also if it is an existing drawing it saves it in the existing directory.
 
i put this on the button and it works perfect now. thanks for the help. to be honest; i am not sure why it works now but it does.

(command "VBASTMT" "Application.ActiveDocument.Close(False)")
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top