Top level Interaction event

Top level Interaction event

Anonymous
Not applicable
580 Views
4 Replies
Message 1 of 5

Top level Interaction event

Anonymous
Not applicable

Hi all, 

 

I am trying to create an add in which allows the user to click with a key (CTRL or similar) a drawing view and then drag to manipulate the scale of that view. 

 

I believe I know how to do this by creating an instance of an interactionEvent  and then a selectEvent and using the onSelect, onPreSelect etc methods.

 

InteractionEvents requires me to prompt the user to select a view and stops other processes until i stop the interaction. However I want this to run seamlessly so you just click (with CTRL or similar) on a view and drag for scale rather than having to press a button on the ribbon or similar to start the interaction.

 

So I guess I am looking for the top level interaction which inventor uses to do its event processing? or is there another way to tackle this problem?

 

I'v done something similar in the past which was just a loop and acting when the select set had an object type i wanted however this method seems dirty and doesn't give me access to pre-selecting objects, I think events will work better.

 

currently I'm thinking of writing the addin in VB.net but happy to use another language if it makes this easier.

 

Thanks

 

0 Likes
581 Views
4 Replies
Replies (4)
Message 2 of 5

NachoShaw
Advisor
Advisor
Hi
I personally wouldn't do that as a key can be pressed accidentally but, you could fire the event on a keyless

Wouldn't it be better to add it to the right click menu?

Nacho

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
Message 3 of 5

Anonymous
Not applicable

Yeah my thoughts exactly,

 

I'd prefer not to have to create an instance of the interaction event, and instead use the top level events which inventor would be using. 

 

right click menu is always an option if i can't find a solution or a short key etc

0 Likes
Message 4 of 5

Jef_E
Collaborator
Collaborator

KeyboardEvents Object

KeyboardEvents Object

Description

The KeyboardEvents object supports a set of events that can be received by the client when a key on the keyboard is pressed while the InteractionEvents object has been started AND the InteractionDisabled flag is set to False.

Properties

Name Description
Application Returns the top-level parent application object. When used the context of Inventor, an Application object is returned. When used in the context of Apprentice, an ApprenticeServer object is returned.
Parent Gets the parent object from whom this object can logically be reached.
Type Returns an ObjectTypeEnum indicating this object's type.

Events

Name Description
OnKeyDown Event that occurs when the user presses a button on the keyboard. Only the keys specified in the enumerator are handled through this event. The input signifies the hardware key that was actually depressed.
OnKeyPress Event that occurs when the user presses and releases an ANSI key on the keyboard. The ANSI value of the key pressed is returned.
OnKeyUp Event that occurs when the user releases a button on the keyboard . Only the keys specified in the enumerator are handled through this event. The input signifies the hardware key that was actually depressed.


Please kudo if this post was helpfull
Please accept as solution if your problem was solved

Inventor 2014 SP2
0 Likes
Message 5 of 5

Anonymous
Not applicable
Hi Jef_E that's not quite what I'm after,
I basically don't want to have to start an interaction event,
Instead I guess I want to use the top level interaction event which is always running or similar

Cheers
0 Likes