Shortcut to Close Global Form

Shortcut to Close Global Form

JoãoASilva
Advocate Advocate
3,894 Views
5 Replies
Message 1 of 6

Shortcut to Close Global Form

JoãoASilva
Advocate
Advocate

Hello!

 

I have a Global Form with all my macros.

I've created an iLogic external rule to launch it.

Then, a VBA code to run the external rule.

Lastly, in the Customize menu, I've assigned "Ctrl+\" to fire the VBA code.

 

Sooo.....I press "Ctrl+\" and the Global Form pops up ¯\_(ツ)_/¯

(most likely i'll change it later to a mouse button, so I can achieve the minimum effort possible 😅)

 

Now I would like to press "Ctrl+\" again and close the form. (could be a different keystroke combination)

I'm currently looking into having a case in the iLogic Rule to close the form.

Problem is, I don't know how to do this, nor if it is possible.

João Silva

Mechanical Engineer

 

0 Likes
Accepted solutions (1)
3,895 Views
5 Replies
Replies (5)
Message 2 of 6

A.Acheson
Mentor
Mentor

Close form  for ilogic global forms is not supported.  You can open the form but not close it. I have tried the various posts but it fails to work.

 

 

https://forums.autodesk.com/t5/inventor-forum/ilogic-to-close-hide-an-open-form/td-p/3934785

 

While we are on this subject, if you are switching documents you will need to close the form and reopen to have it act on the active document. There is no API support to switch the form  to active document by code.

 

 

Is vb.net or ilogic your primary 🛠

Attached picture is a toolbox 🧰 form  I use. No keyboard shortcuts or very little macros. 

All ilogic/vb.net, pull and drag the rules in as buttons. 

If this solved a problem, please click (accept) as solution.‌‌‌‌
Or if this helped you, please, click (like)‌‌
Regards
Alan
0 Likes
Message 3 of 6

JoãoASilva
Advocate
Advocate

Hi @A.Acheson ,

 

To bad to hear that it can't be closed.

I've looked into the links you provided and, for me, closing the form after launching a rule is not an option.


My Global Form works well even if I switch documents, no need to close and reopen.

Probably it's the way I have my iLogic Rules set up.

I'm also using Inventor 2021.2.2.

 

I primarly use iLogic as my tool.

I only use the integrated VBA to call iLogic rules, and have the ability to create a button.

^Prior to the Global Form, I had multiple buttons on the main ribbon of the document, under "User Commands".

 

Also, this is my current Global Form:

JoãoASilva_0-1616663412448.png

João Silva

Mechanical Engineer

 

Message 4 of 6

MjDeck
Autodesk
Autodesk
Accepted solution

@JoãoASilva , I don't think it's impossible to do, but it's not easy. You could use UI automation to make sure that the dialog has keyboard focus. Then send the key combination Alt-F4 to the dialog.


We should be able to provide an iLogic function for this in a future release. This is internal issue number INVGEN-51787.


Mike Deck
Software Developer
Autodesk, Inc.

Message 5 of 6

JoãoASilva
Advocate
Advocate

Hi @MjDeck ,

 

Altough the workaround seems plausible, I'm not well-versed enough to do that 😅

I'll wait for an update so I can use an iLogic function.

 

Thank you!

João Silva

Mechanical Engineer

 

0 Likes
Message 6 of 6

Yijiang.Cai
Autodesk
Autodesk

This has been implemented within Autodesk Inventor 2024. Please review the Inventor 2024 What's New article here. For more information regarding how you may leverage the feature, and please review this page. Thanks!

Thanks,
River Cai

Inventor Quality Assurance Team
Autodesk, Inc.
Email: River-Yijiang.Cai@autodesk.com