Problem with Command and Mouse

I'm programming in Visual Basic 6 and Solid Edge v18.

 

My purpose is to select a surface in the active window of Solid Edge once the user has clicked on a button on my VB form.

 

My implementation is the following:

 

I declare the Command and Mouse objects of Solid Edge in the top of VB form as follows:

 

Public WithEvents seCommand As SolidEdgeFramework.Command

Public WithEvents seMouse1 As SolidEdgeFramework.Mouse

 

In the code of the button I start the command and connect to the mouse object:

 

Set seCommand1 = SEApp.CreateCommand(seNoDeactivate)

seCommand.Start

Set seMouse = seCommand1.Mouse

seMouse.LocateMode = seLocateQuickPick

 

And finally in the code of the event MouseClick of Mouse object:

 

(Code for storing pGraphicDispatch)

seCommand.Done=True

 

The problem is that I want to finish the command once the user has clicked (select something) on the graphic window of Solid Edge, but instead of this, the command does not terminate until user has clicked (selected something) twice.

 

Does anybody know what I am doing wrong?

 

 

 

 

 

 

Posted by: Braulio Alvarez
Post date: 2/28/2007 8:56:22 PM

1 REPLY

RE: Problem with Command and Mouse

I've found the solution by moving the code for starting the command from Click event to MouseUp event.

I think the problem was that the control was not a commandbutton but a checkbox with graphical style.

 

 

Posted by: Braulio Alvarez
Post date: 3/1/2007 6:51:23 PM