iLogic Activation error

iLogic Activation error

Anonymous
Not applicable
1,798 Views
10 Replies
Message 1 of 11

iLogic Activation error

Anonymous
Not applicable

Hi all,

 

When I deactivate iLogic using the API and reactivate, Inventor throw an error.

 

Here's the error:

iLogicActivationError.jpg

 

 

Here's my code:

 

private void DeactivateAndActivateiLogicTest()
        {
            // Get Inventor application 
            Inventor.Application app = System.Runtime.InteropServices.Marshal.GetActiveObject("Inventor.Application") as Inventor.Application;

            // Get iLogic addin 
            Inventor.ApplicationAddIn iLogic = ItemByName(app.ApplicationAddIns, "iLogic");

            if (iLogic != null)
            {
                // Deactivate iLogic addin
                iLogic.Deactivate();

                // Activate iLogic addin
                iLogic.Activate();
            }
        }

        private Inventor.ApplicationAddIn ItemByName(Inventor.ApplicationAddIns applicationAddIns, string displayName)
        {
            foreach (Inventor.ApplicationAddIn i in applicationAddIns)
            {
                if (i.DisplayName == displayName)
                {
                    return i;
                }
            }
            return null;
        }

 

 

By the interface, it's impossible to deactivate the iLogic addin.  Maybe I'm not supposed to deactivate it but the API allows me.

 

Someone have an explanation?

 

Pascal Langlais

0 Likes
1,799 Views
10 Replies
Replies (10)
Message 2 of 11

xiaodong_liang
Autodesk Support
Autodesk Support

Hi,

 

I copied your code to a standalone EXE. It works well. I am using Inventor 2013 + SP2.

 

 

0 Likes
Message 3 of 11

Anonymous
Not applicable

Hi Xiaodong,

 

I am using Inventor 2011 64-Bit Edition (network licence) + SP2.

 

I installed 4 hotfix but nothing changed.  I still get the same error.

 

 

Pascal

0 Likes
Message 4 of 11

xiaodong_liang
Autodesk Support
Autodesk Support

Hi Pascal,

 

Sorry I have not Inventor 2011 now. If you can always reproduce, I'd say that would be an issue with 2011. 

 

But I am curious why you need to de-activate iLogic and activate it again?

 

0 Likes
Message 5 of 11

DonStauffer99
Advocate
Advocate

Still a problem with Inventor 2018. Has anyone solved this?

0 Likes
Message 6 of 11

DonStauffer99
Advocate
Advocate

I ended up using iLogicVb.Automation.RulesEnabled instead.

0 Likes
Message 7 of 11

DonStauffer99
Advocate
Advocate

RulesEnabled didn't do what I needed. Actually, neither did deactivating iLogic. Trying to reorder User Parameters but recreating parameters and deleting the existing ones screws up references to the parameter in other parameters (replaces them with constants) and puts lines in rules that reference the deleted parameter that set it to a constant. Dependents collection is consistently empty, so no help there.

0 Likes
Message 8 of 11

Anonymous
Not applicable

Hi DonStauffer99,

 

If you try to reorder the parameter, you can take a look at one of my post to have a solution track: sort-user-parameters-by-code

 

And if you have an issue to delete a parameter, be aware that a parameter is still in use if you use it in some feature and you change an option and now the parameter is hidden (but still in use). So, you cannot delete it. You can take a look at this post: delete-user-parameter

 

 

Hope this will help you,

 

 

Pascal

 

0 Likes
Message 9 of 11

DonStauffer99
Advocate
Advocate

Trying to restart iLogic produces an error; actually, the best method I've found still produces an error and requires that Inventor be restarted to get iLogic restarted. Here's my parameter reordering subroutine:

https://drive.google.com/open?id=1jtz2AgIqhX29ervV11iRnbktTAkypppB

 

0 Likes
Message 10 of 11

DonStauffer99
Advocate
Advocate

Still a problem in Inventor 2020.

0 Likes
Message 11 of 11

JaneFan
Autodesk
Autodesk

@DonStauffer99 , Sorry for the inconvenience. The issue should be fixed in 2020.2. 




Jane Fan
Inventor/Fusion QA Engineer
0 Likes