Community
Inventor Programming - iLogic, Macros, AddIns & Apprentice
Inventor iLogic, Macros, AddIns & Apprentice Forum. Share your knowledge, ask questions, and explore popular Inventor topics related to programming, creating add-ins, macros, working with the API or creating iLogic tools.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

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

3 REPLIES 3
Reply
Message 1 of 4
liminma8458
411 Views, 3 Replies

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

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 2.1; Windows 10 pro 64 bit version 21H2; Office 2013 32 bit
3 REPLIES 3
Message 2 of 4
A.Acheson
in reply to: liminma8458

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
Message 3 of 4
liminma8458
in reply to: A.Acheson

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 2.1; Windows 10 pro 64 bit version 21H2; Office 2013 32 bit
Message 4 of 4
A.Acheson
in reply to: liminma8458

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

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report