Prevent undo operation when undo more than one entity ?

Prevent undo operation when undo more than one entity ?

Anonymous
Not applicable
392 Views
1 Reply
Message 1 of 2

Prevent undo operation when undo more than one entity ?

Anonymous
Not applicable

When use undo ,we can undo one or many operation at the same time .But i need to prevent undo that relate to many operation .

See command :

Command: _.undo

Current settings: Auto = On, Control = All, Combine = Yes, Layer = YesEnter the number of operations to undo or [Auto/Control/BEgin/End/Mark/Back] <1>: 1

 

One operation is undone .

 

but when see other command :

Command: _.undo

Current settings: Auto = On, Control = All, Combine = Yes, Layer = YesEnter the number of operations to undo or [Auto/Control/BEgin/End/Mark/Back] <1>: 2

 

Two operations are undone.

 

I need to prevent that command from executing .

I found the solution use documentLockModeChanged to lock command ,but when i type or press Undo ,it lock .I only want to lock undo if it relate to 2 operations .How can i do it ?Below is code example

 

void MyDocManagerReactor::documentLockModeChanged(AcApDocument * param2, AcAp::DocLockMode myPreviousMode, AcAp::DocLockMode myCurrentMode, AcAp::DocLockMode currentMode, const ACHAR * pGlobalCmdName)

{if(pGlobalCmdName[0] != L'#' && IsFilteredCommand(pGlobalCmdName)

){       

Acad::ErrorStatus es=veto();

}AcApDocManagerReactor::documentLockModeChanged (param2, myPreviousMode, myCurrentMode, currentMode, pGlobalCmdName) ;

}

 

 

0 Likes
393 Views
1 Reply
Reply (1)
Message 2 of 2

fenton_webb
Autodesk
Autodesk

Can you explain why you need to do that please?

 

Thanks
Fenton Webb

Autodesk Developer Network




Fenton Webb
AutoCAD Engineering
Autodesk

0 Likes