Are you saying that if something goes wrong in your extension (e.g., a
software bug), the user should not be able to save the file at all ?????????
You're kidding right?
--
http://www.caddzone.com
AcadXTabs: MDI Document Tabs for AutoCAD
Supporting AutoCAD 2000 through 2010
http://www.acadxtabs.com
Email: string.Format("{0}@{1}.com", "tonyt", "caddzone");
wrote in message news:6286027@discussion.autodesk.com...
Thanks Tony - that helps a lot! The trouble I am having now relates to
canceling the save. If my custom routine fails, I don't want to save the
drawing. I have tried sending an escape character using SendCommand and also
subscribing to the DocumentLockModeChanged and using the 'Veto' method -
neither strategy seems to work. Here's my code so far (simplified of
course): {code} bool _cancelSave = false; void Database_BeginSave(object
sender, DatabaseIOEventArgs e) { string[] input = { "SAVE", "SAVEAS",
"QSAVE", "CLOSE" }; List validCommands = new List(input); if
(validCommands.Contains(MdiActiveDocument.CommandInProgress)) { if
(!doWork()) _cancelSave = true; /* Or we could send escape: * String esc =
Convert.ToChar(Keys.Escape).ToString(); * SendCommand(esc, false); */ } }
void DocumentManager_DocumentLockModeChanged(object sender,
DocumentLockModeChangedEventArgs e) { if (cancelSave) e.Veto(); _cancelSave
= false; } {code} Again - any thoughts would be greatly appreciated!