Inventor Customization

Inventor Customization

Reply
Mentor
163 Posts
20 Kudos
Registered: ‎02-10-2012
Post 1 of 8

SendKeys or Keystrokes Using iLogic

305 Views, 7 Replies
02-21-2012 07:05 AM

Hi All,

 

I've looked around and done some research on this and it seems possible just I can't figure out how to do it.

 

I'm looking to send keystrokes programmically using iLogic as if the keys were actually being pressed. I just want to send a simple set of keys like "QQ".

 

Does anybody know how I would do this through iLogic? Or trigger a code that would allow me to send these keys.

 

Thanks

Mitch

Valued Mentor
346 Posts
9 Kudos
Registered: ‎04-10-2010
Post 2 of 8

Re: SendKeys or Keystrokes Using iLogic

02-22-2012 10:04 AM in reply to: mehatfie

sendkey is a bad coding practice. dont use it unless you have to.

Autodesk Inventor Professional 2014
Autodesk Product Design Suite Standard 2014
Microsoft Office 2007 & 2013
Windows 7 64bit
Synergis Adept 2014
Visual Studio Express 2010
Mentor
163 Posts
20 Kudos
Registered: ‎02-10-2012
Post 3 of 8

Re: SendKeys or Keystrokes Using iLogic

02-22-2012 10:09 AM in reply to: jcneal

Thanls for the tip,

 

I'm new to programming though and have gone through the tutorials and the "My First Plug In" Guide but still have trouble understanding VB

 

I'm trying to start up the dialog box connected to a custom Add-In we use. This can normally be accessed by pressing the button in the "Add-Ins" Tab

 

OR

 

There is a short cut which can be customized through inventor for a keyboard shortcut (ie. "QQ")

 

I'm not sure how to start up the dialog box by accessing it through code. But I figure I can make the keyboard press the "QQ" a little easier

 

Again, Thanks for the help

Mitch

Mentor
163 Posts
20 Kudos
Registered: ‎02-10-2012
Post 4 of 8

Re: SendKeys or Keystrokes Using iLogic

02-24-2012 11:26 AM in reply to: mehatfie

Even if it is an improper method of programming, is there anyone who can tell me how to do this

Valued Mentor
346 Posts
9 Kudos
Registered: ‎04-10-2010
Post 5 of 8

Re: SendKeys or Keystrokes Using iLogic

02-24-2012 06:10 PM in reply to: mehatfie

under controldefinition-defaultshortcut or overrideshortcut

you can set the default shortcut assigned to the command. I use "u" to hide or open browser when I need "real" full screen. it is a small vba macro. But it should work in vb.net too.

 

good luck

Autodesk Inventor Professional 2014
Autodesk Product Design Suite Standard 2014
Microsoft Office 2007 & 2013
Windows 7 64bit
Synergis Adept 2014
Visual Studio Express 2010
Mentor
163 Posts
20 Kudos
Registered: ‎02-10-2012
Post 6 of 8

Re: SendKeys or Keystrokes Using iLogic

02-26-2012 09:55 AM in reply to: mehatfie
Hi jcneal,

Thank you for responding again, if I'm understanding correctly, what your telling me is how to change the hotkey used for a command. This I know how to do or can figure out, but I don't know how to, I guess you would say, programmically simulate as if a key was being pushed. Through research I found that it might be this sendkey, but I'm not sure how to program it to press, say, this "u" shortcut you have through a rule.

Thanks again
Mitch
Valued Mentor
346 Posts
9 Kudos
Registered: ‎04-10-2010
Post 7 of 8

Re: SendKeys or Keystrokes Using iLogic

02-26-2012 02:57 PM in reply to: mehatfie

hmm, my bad. i misunderstand your question. I mean physically press a key, not "programme" to press a key.

 

sorry i dont know how to do it.

 

just out of curious, why do you need to press keys by programme instead of purely programming?

Autodesk Inventor Professional 2014
Autodesk Product Design Suite Standard 2014
Microsoft Office 2007 & 2013
Windows 7 64bit
Synergis Adept 2014
Visual Studio Express 2010
Mentor
163 Posts
20 Kudos
Registered: ‎02-10-2012
Post 8 of 8

Re: SendKeys or Keystrokes Using iLogic

02-27-2012 05:43 AM in reply to: jcneal

I've done some research on how to try and access the button through programming. But I can't seem to find how to do so. What I found was that I need to add reference to a .dll (which I found) but also the dialog box. I did not find the dialog box as it was installed by an outside source and I can't seem to locate it.

Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Announcements
Are you interested in helping shape the future of the Autodesk Community? To participate in this brief usability study, please click here. Your time and input is greatly appreciated!