Using the Select class during a native function

Using the Select class during a native function

NachoShaw
Advisor Advisor
304 Views
1 Reply
Message 1 of 2

Using the Select class during a native function

NachoShaw
Advisor
Advisor
Hi

Can the select class be used to capture mouse points during a native function? What I mean is for example

Create a sketch
Run a routine to capture 2 mouse clicks
Create a rectangle in the sketch
Store the 2 points used for the rectangle


Thanks

Nigel

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
305 Views
1 Reply
Reply (1)
Message 2 of 2

rjay75
Collaborator
Collaborator

Use Interaction Events.

 

List<Point> pts = new List<Point>();
InteractionEvents ie;
MouseEvents me;

public void PickPoints()
{
	ie = appInventor.CommandManager.CreateInteractionEvents();
	ie.MouseEvents.MouseMoveEnabled = true;
	ie.SetCursor(CursorTypeEnum.kCursorBuiltInCrosshair);
ie.StatusBarText="Pick Points"; me = ie.MouseEvents; me.OnMouseClick += new MouseEventsSink_OnMouseClickEventHandler(me_OnMouseClick); ie.Start(); } private void me_OnMouseClick(MouseButtonEnum Button, ShiftStateEnum ShiftKeys, Point ModelPosition, Point2d ViewPosition, Inventor.View View) { if (Button == MouseButtonEnum.kLeftMouseButton) { pts.Add(ModelPosition); if(pts.Count == 2) { ie.Stop(); me = null; ie = null; } } }

 

 

0 Likes