How to move mouse only along a specified axis using API?

How to move mouse only along a specified axis using API?

liminma8458
Collaborator Collaborator
534 Views
3 Replies
Message 1 of 4

How to move mouse only along a specified axis using API?

liminma8458
Collaborator
Collaborator

Hi, experts,

 

Normally, in MouseEvents, you can move the mouse (cursor) all around the model space and get its position information. Is it possible to limit the mouse (cursor) to only move along a specific axis, such X axis, or  Y axis, or an axis which is defined by a point and a vector?

Thanks
Limin
Inventor pro 2023 64 bit update 5.3; Windows 11 pro 64 bit version 24H2; Office 2013 64 bit

Download iCable in App Store to Create Cables Easily

0 Likes
535 Views
3 Replies
Replies (3)
Message 2 of 4

A.Acheson
Mentor
Mentor

Could you possibly give more context of your use case with either a sample code or image of the desired outcome? 

If this solved a problem, please click (accept) as solution.‌‌‌‌
Or if this helped you, please, click (like)‌‌
Regards
Alan
0 Likes
Message 3 of 4

liminma8458
Collaborator
Collaborator

Alan,

Thank you for your attention.

That will be exactly as the 3D route tool in Tube and Pipe. As below picture, you can move your mouse along an axis (normal of a circular edge, can be any orientation) and pick on any location on it. Is there any way to do that using API?

Some close example could be as API help sample [OnDrag Event - dragging a WorkPoint API Sample]. It projects a point onto XY plane.

liminma8458_0-1638284664156.png

 

 

Thanks
Limin
Inventor pro 2023 64 bit update 5.3; Windows 11 pro 64 bit version 24H2; Office 2013 64 bit

Download iCable in App Store to Create Cables Easily

0 Likes
Message 4 of 4

A.Acheson
Mentor
Mentor

The   [OnDrag Event - API Sample] looks like a monitoring event and will not allow the user to control the mouse. 

"UserInputEvents.OnDrag( DragState As DragStateEnum, ShiftKeys As ShiftStateEnum, ModelPosition As Point, ViewPosition As Point2d, View As View, AdditionalInfo As NameValueMap, HandlingCode As HandlingCodeEnum )"

 

You can move the mouse through the attached VBA rule, I am not sure if this can be done in VB.NET. Can  you integrate this into your intended workflow? Is your end goal to recreate the route along a known path using the mouse?

  1. Alternate method untested by myself, thinking aloud  could be to position points via the API and draw 2d/3d lines between the points.
  2. Alternate is to attach the route to a UCS. This can be moved along three axis but alas is not exposed to API for moving. 
  3. Attach a point to workplanes and move the work planes either manually or API. 
If this solved a problem, please click (accept) as solution.‌‌‌‌
Or if this helped you, please, click (like)‌‌
Regards
Alan
0 Likes