Message 1 of 10
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Is there any options to stop current command from execution.
Solved! Go to Solution.
Is there any options to stop current command from execution.
Solved! Go to Solution.
try :
CommandManager.StopActiveCommand()
StopActiveCommand() causing application crash
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:
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 !
I want to stop save command
for this you should use;
ApplicationEvents.OnSaveDocument( DocumentObject As Document, BeforeOrAfter As EventTimingEnum, Context As NameValueMap, HandlingCode As HandlingCodeEnum )
No. StopActiveCommand() is not stopping the save operation in OnSaveDocument event.
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.
OnSaveDocument event will not stop the save operation. How to cancel the operation inside OnsaveDocument event?
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.