In assemblies files I made a macro that allows user to move zoom and rotate the display but not selecting anything using SolidEdgeFramework.Command.
The user still have acess to the command of SolidEdge (RibbonBar)
When the user click on a button in the ribbonbar or the quickaccesstoolbar the SolidEdgeFramework.Command is ended then the macro ask him if he want to end the current macro or not.
If the user choose to continue we recreate a new SolidEdgeFramework.Command then if the button is a normal command of SolidEdge everything works fine else if the button is link to a macro, after we start the new SolidEdgeFramework.Command a window popup asking to select exe or dll to execute. (See ScreenShot)
Here is a part of the code :
Dim QuitResult As MsgBoxResult = MessageBox.Show("Do you want to quit the macro ?", "Quit macro ?", MessageBoxButtons.YesNo, MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button1, MessageBoxOptions.ServiceNotification)
If QuitResult = MsgBoxResult.Yes Then
_command = _application.CreateCommand(CInt(SolidEdgeConstants.seCmdFlag.seNoDeactivate))
AddHandler _command.Terminate, AddressOf command_Terminate
_application.DisplayAlerts = True
_mouse = _command.Mouse
_mouse.EnabledMove = True
_mouse.LocateMode = SolidEdgeConstants.seLocateModes.seLocateOff
_mouse.WindowTypes = 1
_mouse.EnabledDrag = False
_mouse.DynamicsMode = 0
Do you have any ideas on how to manage this issue.
I'm a little bit confused by your code above and your notes done. In your code above you call command_Terminate() upon QuitResult is true. in your notes you're saying the command terminates as soon the user uses any button on the ribbon bar. So command_Terminate() should have been already executed. In case of QuitResult is false you assume command_Terminate() already has been executed and you create a new command without prior calling command_Terminate().