Add iLogic rule to Ribbon Panel with an iLogic rule

Add iLogic rule to Ribbon Panel with an iLogic rule

ccoomes
Advocate Advocate
922 Views
5 Replies
Message 1 of 6

Add iLogic rule to Ribbon Panel with an iLogic rule

ccoomes
Advocate
Advocate

Does anyone know the ilogic code to add an ilogic rules to a ribbon panel?

 

I have looked in the API help, and searched but i cannot find how to add an ilogic rule to the ribbon through an ilogic rule.  there is help for adding macros to the ribbon panel, but as you can no longer use VBA it dosent help...

 

Thanks

0 Likes
923 Views
5 Replies
Replies (5)
Message 2 of 6

A.Acheson
Mentor
Mentor

Hi @ccoomes 

What inventor version are you using? In newer version this is standard and in older versions this can only be done through adding a vba button and calling the ilogic rule from vba. Or if you can install an app Jelte created one back in 2020. 

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

ccoomes
Advocate
Advocate

We are using IV 2023.

 

I have looked at the excellent button configurator app, but trying to do it by a simple ilogic rule as we only want to add standard nventor commands, and a single ilogic rule.

 

I understand that you can add an ilogic rule to the ribbon manually by the customse user commands, but i dont really want to do that. 

 

Thanks.

0 Likes
Message 4 of 6

WCrihfield
Mentor
Mentor

Hi @ccoomes.  I believe I have some code for that task, but I was only using it before we updated from 2022 version to 2024 version.  Back then, when you added rules to the ribbon using iLogic rules, they would only stay for that session of Inventor, they they would be gone again when you restarted Inventor.  You could use event triggers to run it when the first document opens, but must use custom code to avoid running it every time any document opens.  Plus, the code I am attaching was handling the button click events to run the rule associated with the button, instead of letting Inventor manage that.  Not sure if the special command name formatting for external iLogic rule buttons was established yet while using 2022 version.  In 2024 version, the commands for these start with "iLogic.Rule:", then if the rules are in a sub folder of a main iLogic rules directory, the name of the directory will follow, with the "\" symbol at its end, then the name of the iLogic rule file, with its file extension.  Not sure if using that command name formatting in 2022 version would have worked or not.

Attached is one version of an external iLogic rule I was using at the time.  It is quite long, and has many routines included, so it may take a while to review before trying it out.

 

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

0 Likes
Message 5 of 6

Curtis_Waguespack
Consultant
Consultant

@ccoomes wrote:

We are using IV 2023.

 

I understand that you can add an ilogic rule to the ribbon manually by the customse user commands, but i don't really want to do that. 

 

 


One option to consider is to do this manually on one machine and then export the Customization XML. That might or might not work for you, but I thought I'd mention it.

 


Steps to do this manually for external rules and global forms ( just in case it helps someone else in the future)

To create a custom icon for your iLogic Ribbon button:

  • Create a *.png file that is 16x16 pixels or 32x32 pixels
  • Place this image file in the same folder as the Rule resides in
  • Format the name to be as such:
    • <Name of the iLogic Rule or Form> . <light or dark> . <small or large> .png

 

Example:

iLogic rule name:  Create PDF

iLogic rule button image name: Create PDF.light.small.png

 

Restart Inventor if needed.

see related link:

https://forums.autodesk.com/t5/inventor-forum/inventor-2023-ilogic-rules-and-forms-on-ribbon/m-p/110...

EESignature

0 Likes
Message 6 of 6

ccoomes
Advocate
Advocate

@WCrihfield I did tihnk about that, but I will have to do some testing.  I am assuming that there will be code to load the customiasation xml?

 

If you have to restart inventor reverytime to get the icons to show, that might be a small issue though...

 

Not sure when Iwill be able to test it, but hopefully soon.

0 Likes