MouseClick Coords - in process

MouseClick Coords - in process

NachoShaw
Advisor Advisor
428 Views
2 Replies
Message 1 of 3

MouseClick Coords - in process

NachoShaw
Advisor
Advisor

Hey

 

i can get mouseclick coords when im using a select event but i need something different. While in an Inventor command, lets say, sketching a line, Id like to capture the mouse down on each sketch line point and record its X,Y. Im not sure if its possible with the SelectEvent but i am using VB.Net so have the potential to a different method?

 

Thanks

Nacho
Automation & Design Engineer

Inventor automation Programmer (C#, VB.Net / iLogic)
Furniture, Sheet Metal, Structural, Metal fab, Tradeshow, Fabrication, CNC

EESignature


Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.


0 Likes
429 Views
2 Replies
Replies (2)
Message 2 of 3

WCrihfield
Mentor
Mentor

I previously used InteractionEvents.MouseEvents.OnMouseClick event to capture mouse click position, like this:

Sub Main
	Dim oIntEv As InteractionEvents = ThisApplication.CommandManager.CreateInteractionEvents
	Dim oMouseEv As MouseEvents = oIntEv.MouseEvents
	AddHandler oMouseEv.OnMouseClick  ,AddressOf oMouseEv_OnMouseClick 
	oIntEv.Start
End Sub

Sub oMouseEv_OnMouseClick(oMBtn As MouseButtonEnum, oShiftState As ShiftStateEnum, oMPos As Inventor.Point, oViewPos As Point2d, oView As Inventor.View)
   MsgBox("Model Position = " & oMPos.X & " cm x " & oMPos.Y & " cm (from model origin)" & vbCrLf & _
  "View Position = " & oViewPos.X & " x " & oViewPos.Y & " (from top left corner of view)", , "MOUSE POSITION")
End Sub

If this solved your problem, or answered your question, please click ACCEPT SOLUTION.
Or, if this helped you, please click (LIKE or KUDOS) 👍.

If you want and have time, I would appreciate your Vote(s) for My IDEAS 💡or you can Explore My CONTRIBUTIONS

 

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

0 Likes
Message 3 of 3

NachoShaw
Advisor
Advisor

Thanks for the reply.

 

I'll try it although i think its the same or similar to what i have been using in the past. I dont think it will continue to provide mouse click coords if i invoke a command like sketch line though. I was thinking that maybe it would need to be a second thread running with a separate process because a command usually cancels any active process for the selected command

Nacho
Automation & Design Engineer

Inventor automation Programmer (C#, VB.Net / iLogic)
Furniture, Sheet Metal, Structural, Metal fab, Tradeshow, Fabrication, CNC

EESignature


Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.


0 Likes