UserInputEvents_OnTerminateCommand no Commandname and Context provided

UserInputEvents_OnTerminateCommand no Commandname and Context provided

h.schkorwaga
Advocate Advocate
575 Views
7 Replies
Message 1 of 8

UserInputEvents_OnTerminateCommand no Commandname and Context provided

h.schkorwaga
Advocate
Advocate

Hello together,

 

I'm trying to implement the OnTerminateCommand event from UserInputEvents  object

 

 

public void UserInputEvents_OnTerminateCommand(string CommandName, NameValueMap Context)

 

The event fires correctly BUT not for all commands the CommandName and Context are provided.

 

I recognized PartSwitchRepresentationCmd is not returned in the CommandName string from parameters. This is essential to my code I try to implement.

 

This command runs when swithing between folded sheetmetal and the flatpattern.

 

Hope you can help me. Thankks in advance.

 

BG

0 Likes
576 Views
7 Replies
Replies (7)
Message 2 of 8

CattabianiI
Collaborator
Collaborator

On my side in Inventor 2023, the event is fired correctly and CommandName is provided.
Have you tryed to monitor the event via EventWatcher?
It's available here:
%public%\Documents\Autodesk\Inventor 2023\SDK\DeveloperTools\Tools\EventWatcher\bin\Release\EventWatcher.exe
after installing developerTools:
%public%\Documents\Autodesk\Inventor 2023\SDK\developertools.msi

0 Likes
Message 3 of 8

h.schkorwaga
Advocate
Advocate

Hi,

 

result of the Eventwatcher is following:

 

 

 

UserInputEvents.OnTerminateCommand
     CommandName: ""
     Context: No context information

UserInputEvents.OnTerminateCommand
     CommandName: "PartComputeiPartRowCtxCmd"
     Context: No context information

 

 

 

First manual executed command should be "PartSwitchRepresentationCmd" - as you can see nothing is provided through event parameters

 

Second command is about switching modelstates.

It seems this command is not working with this OnTerminateCommand event (BTW same for OnActivateCommand)

 

 

 
 
0 Likes
Message 4 of 8

CattabianiI
Collaborator
Collaborator

It sounds like a bug. If you want to share a video or the data set I'll try to reproduce it.

 

0 Likes
Message 5 of 8

h.schkorwaga
Advocate
Advocate

Hi again 🙂

 

video of what the User does and what I want to capture is attached.

 

public void register()
{
     GD.InvAPP.CommandManager.UserInputEvents.OnActivateCommand += UserInputEvents_OnActivateCommand
}


public void UserInputEvents_OnActivateCommand(string CommandName, NameValueMap Context)
{
     InvHelper.PrintNameValueMap(Context, "OnActivateCommand: " + CommandName);
}

 

Not sure if this is the information you wannted to have .

 

Thank you in advance.

0 Likes
Message 6 of 8

CattabianiI
Collaborator
Collaborator

hi 🙂
1) which is your Inventor version? Including updates.
2) does it happen in any sheet metal document or just that one?
3) Do you have some third party addins? Could you temporary unload them and unload Vault and try again checking with Event Watcher?
4) I don't get what are those lines you posted above. Is it your addin? could unload that too?

0 Likes
Message 7 of 8

h.schkorwaga
Advocate
Advocate

Hi,

 

sorry for the delayed response but we had to update Inventor to the latest V2023.1.1.

 

I attached a new screenvideo

 

As you can see the button in the ribbon does ist the right way. I recognized that a doubleclick in the browser on the left side (folded part <-> flat pattern) leaves the command parameter empty - thats the bug I guess. And this is exactly what I need to capture. In an normal workflow (once converted to sheetmetal) nearly no one klick the ribbonbutton.

 

Concerning your questions:

1) as mentioned now V2023.1.1

2) every sheetmetal parts - old migrated or new created ones

3) and 4) my Add-in (only one not standard inv-addin) was deactivated for testing - same

 

Hope this infos helps analyzing the problem(?).

 

0 Likes
Message 8 of 8

CattabianiI
Collaborator
Collaborator

And I have the same behaviour with double click, now! thanks!

That's bug I think, so let's mention @johnsonshiue and see if he can confirm that double clicking on Flat Pattern / Folded Model no command name is provided in UserInputEvents.OnActivateCommand and  UserInputEvents.OnTerminateCommand

As a workaround you could use UserInterfaceEvents.OnEnvironmentChange and or UserInputEvents.OnDoubleClick and the activate command with empty parameter. Check the right order with EventWatcher and I think you can sort this problem out.

0 Likes