Launch rules and forms from Ribbon

Launch rules and forms from Ribbon

Anonymous
Not applicable
2,453 Views
5 Replies
Message 1 of 6

Launch rules and forms from Ribbon

Anonymous
Not applicable

I know I can make a button on the ribbon for running a specific macro. But, is this possible for iLogic rules? I would love to be able to run rules and launch forms from the ribbon!?

0 Likes
2,454 Views
5 Replies
Replies (5)
Message 2 of 6

Anonymous
Not applicable
0 Likes
Message 3 of 6

Anonymous
Not applicable

Great blog post, thanks. But if I have a form or ilogic rule I want to launch, do I have to change them to macros to be able to add them to the ribbon?

0 Likes
Message 4 of 6

Anonymous
Not applicable

I am not good at iLogics, so you just only consider my opinion.

1. If you can find how to open a iLogic from a subroutine in VBA. Then you can create a button as upper link.

2. If impossible to do 1. and the code is simple, you can try to rewrite it again in VBA

3. How can you create a form in iLogic? Or you import this form from somewhere else? Maybe you can write a code to use this form iLogic.

 

0 Likes
Message 5 of 6

Anonymous
Not applicable

i would also like to fire up a form from the ribbon, can it be done yet?

0 Likes
Message 6 of 6

xiaodong_liang
Autodesk Support
Autodesk Support

Hi Stephen,

 

I assume you have known how to create an addin with ribbon interface.

 

From addin you can access iLogic. Firstly add the reference <Inventor>\Bin\Autodesk.iLogic.Automation.dll. The following is a C# code how to call a rule. Of course, if the rule calls a ilogic form, it can also work.

 

       void test()
        {
            string iLogicAddinGuid = "{3BDD8D79-2179-4B11-8A5A-257B1C0263AC}"; 
            Inventor.ApplicationAddIn addin = 
            m_inventorApplication.ApplicationAddIns.get_ItemById(iLogicAddinGuid); 

            if (addin.Activated == false) 
                addin.Activate();

            Autodesk.iLogic.Automation.iLogicAutomation _iLogicAutomation = addin.Automation;

            // assume "MyRule" will pop out the form of iLogic
            _iLogicAutomation.RunRule(m_inventorApplication.ActiveDocument, "MyRule");
        }

 

 

 

0 Likes