BeginDocumentClose - Save confirmation messagebox

BeginDocumentClose - Save confirmation messagebox

cincir
Enthusiast Enthusiast
1,300 Views
3 Replies
Message 1 of 4

BeginDocumentClose - Save confirmation messagebox

cincir
Enthusiast
Enthusiast

Hi everyone

I am handling BeginDocumentClose event of a Document but before my code executes MessageBox pops up asking me if a want to save my changes. Any idea how can i suppress it? Because i am asking use to end the process for this Document and if the user chooses No i am Vetoing the close so no need to Save changes.

0 Likes
1,301 Views
3 Replies
Replies (3)
Message 2 of 4

Anonymous
Not applicable

Okay Here's a possible trick: 

 

VBA Command way... meaning you just use .SendCommand(blah blah blah)


I took the idea from here... Forum Topic - Close without save

 

1st solution
(command "._VBASTMT" "ThisDrawing.Application.ActiveDocument.Close(vbFalse)")

2nd solution
(command "_.vbastmt" "thisdrawing.close vbfalse")

 

or Vb.NET

 

-But then you have to VBA enabled... hmmm that might not work for you.

 

Or close the document before Autocad can. 

 

Sean has some stuff on this: 

 

http://through-the-interface.typepad.com/through_the_interface/2007/03/closing_all_ope.html

 

Hmm... see code & methods would be ... ah ...

 

Methods:

Document.CloseAndDiscard 
Document.CloseAndSave
DocumentCollection.CloseAll

Something along those lines. 

 

Why are you using the begindocumentclose event anyhow? 

 

Is any of this along the lines of what you're looking for? Best of luck. 🙂

 

Cheers.

 

 

 

0 Likes
Message 3 of 4

cincir
Enthusiast
Enthusiast

🙂 although none of them is working for me , the way you wrote them may help making my mood 🙂

 

thanks anyway. here is a brief explanation ;

 

i am executing a command that shows a paletteset and allow user to make modifications by the commands on paletteset. if the user clicks the close button on my paletteset there is no problem. but if the user clicks the x button of document i want to ask user if he/she wants to exit modification process that i am serving. but the autocads save changes messagebox first pops up then mine. it makes an ignoring step when the user refuses to close my modification process.

 

i think it is clearer now.

😉

0 Likes
Message 4 of 4

cincir
Enthusiast
Enthusiast

But i can use the "DBMOD" variable and store its current value and if i can set it to no modifications made constant then no popup . if it can be set ofcourse. but i think i got the qlue. 

 

thanks.

 

bad news autocad invokes dialog before BeginDocumentClose event. i better try to set DBMOD in CommandWillStart event.

0 Likes