is it possible to simulate a mouse click to get objects at a programmed point?

Solution Partner Genius Solution Partner Genius
Solution Partner Genius

Hi

 

I want to know how to do the equivalent of a mouse click to retieve objects at an x, y, z point that I specifiy in the code. The mouseevents custom macro supplied with Solid Edge achieves this with a mouse click, but how do I do this if I want to specify the point rather than getting it from a mouse click?

 

 

1 REPLY

Re: is it possible to simulate a mouse click to get objects at a programmed point?

Siemens Valued Contributor Siemens Valued Contributor
Siemens Valued Contributor

If you're using VB, this will let you click anywhere on the screen (not necessarily in the SE window).

It could be a solution if you don't find what you're looking for.

 

<DllImport("user32.dll")>

Private Shared Sub mouse_event(dwFlags As UInteger, dx As UInteger, dy As UInteger, dwData As UInteger, dwExtraInfo As Integer)

End Sub

 

<Flags()>

Public Enum MouseEventFlags As UInteger

MOUSEEVENTF_ABSOLUTE = &H8000

MOUSEEVENTF_LEFTDOWN = &H2

MOUSEEVENTF_LEFTUP = &H4

MOUSEEVENTF_MIDDLEDOWN = &H20

MOUSEEVENTF_MIDDLEUP = &H40

MOUSEEVENTF_MOVE = &H1

MOUSEEVENTF_RIGHTDOWN = &H8

MOUSEEVENTF_RIGHTUP = &H10

MOUSEEVENTF_XDOWN = &H80

MOUSEEVENTF_XUP = &H100

MOUSEEVENTF_WHEEL = &H800

MOUSEEVENTF_HWHEEL = &H1000

End Enum

mouse_event(MouseEventFlags.MOUSEEVENTF_LEFTDOWN, x_coordinate, y_coordinate, 0, 0)

mouse_event(MouseEventFlags.MOUSEEVENTF_LEFTUP, x_coordinate, y_coordinate, 0, 0)

 

Siemens PLM Software, Inc.
Project Test Engineer (Automation)