Stopping active command

Stopping active command

prakash.muthu
Advocate Advocate
1,730 Views
9 Replies
Message 1 of 10

Stopping active command

prakash.muthu
Advocate
Advocate

Is there any options to stop current command from execution. 

0 Likes
Accepted solutions (1)
1,731 Views
9 Replies
Replies (9)
Message 2 of 10

marcin_otręba
Advisor
Advisor

try :

 

CommandManager.StopActiveCommand()

 

Hi, maybe you want to check my apps:


DrawingTools   View&ColoringTools   MRUFolders

Message 3 of 10

prakash.muthu
Advocate
Advocate

StopActiveCommand() causing application crash

0 Likes
Message 4 of 10

bradeneuropeArthur
Mentor
Mentor

Which command do you try to stop then?

 

public sub main()
dim a as application
set a as thisapplication

a.CommandManager.StopActiveCommand
End Sub

seems normally to work well....

Regards,

Arthur Knoors

Autodesk Affiliations & Links:
blue LinkedIn LogoSquare Youtube Logo Isolated on White Background


Autodesk Software:Inventor Professional 2025 | Vault Professional 2024 | Autocad Mechanical 2024
Programming Skills:Vba | Vb.net (Add ins Vault / Inventor, Applications) | I-logic
Programming Examples:
Drawing List!|
Toggle Drawing Sheet!|
Workplane Resize!|
Drawing View Locker!|
Multi Sheet to Mono Sheet!|
Drawing Weld Symbols!|
Drawing View Label Align!|
Open From Balloon!|
Model State Lock!
Posts and Ideas:
My Ideas|
Dimension Component!|
Partlist Export!|
Derive I-properties!|
Vault Prompts Via API!|
Vault Handbook/Manual!|
Drawing Toggle Sheets!|
Vault Defer Update!

! For administrative reasons, please mark a "Solution as solved" when the issue is solved !


 


EESignature

0 Likes
Message 5 of 10

prakash.muthu
Advocate
Advocate

I want to stop save command

0 Likes
Message 6 of 10

marcin_otręba
Advisor
Advisor

for this you should use;

 

ApplicationEvents.OnSaveDocument( DocumentObject As Document, BeforeOrAfter As EventTimingEnum, Context As NameValueMap, HandlingCode As HandlingCodeEnum ) 

Hi, maybe you want to check my apps:


DrawingTools   View&ColoringTools   MRUFolders

0 Likes
Message 7 of 10

prakash.muthu
Advocate
Advocate

No. StopActiveCommand() is not stopping the save operation in OnSaveDocument event.

0 Likes
Message 8 of 10

marcin_otręba
Advisor
Advisor

I didn't mean that you should use StopActiveCommand inside save event. you should use onsavevent instead of StopActiveCommand.

Then you can determine if event is handled, if yes then save will not occur.

Hi, maybe you want to check my apps:


DrawingTools   View&ColoringTools   MRUFolders

0 Likes
Message 9 of 10

prakash.muthu
Advocate
Advocate

OnSaveDocument event will not stop the save operation. How to cancel the operation inside OnsaveDocument event?

0 Likes
Message 10 of 10

marcin_otręba
Advisor
Advisor
Accepted solution

 

 

pplicationEvents.OnSaveDocument( DocumentObject As Document, BeforeOrAfter As EventTimingEnum, Context As NameValueMap, HandlingCode As HandlingCodeEnum )

 first run your code before save - you can determin it by BeforeOrAfter  paramter.

then f you want to brake save operation change parameter HandlingCode  to keventhandled or keventcancelled.

 

Hi, maybe you want to check my apps:


DrawingTools   View&ColoringTools   MRUFolders