Disable the built in AutoCAD "SAVEALL " command

Disable the built in AutoCAD "SAVEALL " command

gotMorris
Enthusiast Enthusiast
679 Views
3 Replies
Message 1 of 4

Disable the built in AutoCAD "SAVEALL " command

gotMorris
Enthusiast
Enthusiast

AutoCAD Mechanical 2022

 

We are needing to disable or remove the SAVEALL command as an option. This is the SAVEALL that shows up when you right click a filetab,not the EXPRESS version. I tried using the code below ,not knowing the actual command name, to veto the command. While I was debugging all I get is a series of QSAVE's. I do not want to stop the QSAVE command but I didn't see any flag indicating this came from SAVEALL. 

 

 

 

 

private void OnDocumentLockModeChanged(object sender, DocumentLockModeChangedEventArgs e)
{
if (string.Compare(e.GlobalCommandName, "SAVEALL", true) == 0)

{

e.Veto();

}
}

 

 

 

0 Likes
680 Views
3 Replies
Replies (3)
Message 2 of 4

Alexander.Rivilis
Mentor
Mentor

You can try to use MGDDBG (https://adn-cis.org/assets/gallery/AutoCAD/MgdDbg.zip) in order to check command name (if this menu item start command). You have to use Events... submenu in MGDDBG menu:

AlexanderRivilis_0-1632409886676.png

 

изображение.png

 

 

Відповідь корисна? Клікніть на "ВПОДОБАЙКУ" цім повідомленням! | Do you find the posts helpful? "LIKE" these posts!
Находите сообщения полезными? Поставьте "НРАВИТСЯ" этим сообщениям!
На ваше запитання відповіли? Натисніть кнопку "ПРИЙНЯТИ РІШЕННЯ" | Have your question been answered successfully? Click "ACCEPT SOLUTION" button.
На ваш вопрос успешно ответили? Нажмите кнопку "УТВЕРДИТЬ РЕШЕНИЕ"


Alexander Rivilis / Александр Ривилис / Олександр Рівіліс
Programmer & Teacher & Helper / Программист - Учитель - Помощник / Програміст - вчитель - помічник
Facebook | Twitter | LinkedIn
Expert Elite Member

0 Likes
Message 3 of 4

Alexander.Rivilis
Mentor
Mentor

P.S.: As far as I see there is no command with Save All menu item... So you have not veto command.

Відповідь корисна? Клікніть на "ВПОДОБАЙКУ" цім повідомленням! | Do you find the posts helpful? "LIKE" these posts!
Находите сообщения полезными? Поставьте "НРАВИТСЯ" этим сообщениям!
На ваше запитання відповіли? Натисніть кнопку "ПРИЙНЯТИ РІШЕННЯ" | Have your question been answered successfully? Click "ACCEPT SOLUTION" button.
На ваш вопрос успешно ответили? Нажмите кнопку "УТВЕРДИТЬ РЕШЕНИЕ"


Alexander Rivilis / Александр Ривилис / Олександр Рівіліс
Programmer & Teacher & Helper / Программист - Учитель - Помощник / Програміст - вчитель - помічник
Facebook | Twitter | LinkedIn
Expert Elite Member

0 Likes
Message 4 of 4

norman.yuan
Mentor
Mentor

There is indeed a command "SaveAll" available at command line, which is from Express tool). It can be easily disabled, say, by loading a Lisp command like this:

 

(defun C:SaveAll ()
	(princ "\nSaveAll command does nothing!")
	(princ)
)

 

However, the "Save All" option in the context menu when user right-clicks the drawing window's tab (or even the drawing window's top frame), it seems, does not call the "SaveAll" command from Express Tool. I guess it execute some code that actually loop through the documents and call QSAVE on each one, according to your discovery. Thus, you cannot disable it by simply redefine or undefine the command "SaveAll", nor you can handle in in DocumentLockModeChanged event by matching command name "SAVEALL".

 

Not sure since when such a context menu was made available, never used it. It seems there is not way to customize it (adding/removing items in that context menu).

 

Norman Yuan

Drive CAD With Code

EESignature

0 Likes