I have an issue where an addin loads once the first time Inventor is opened. If the addin is unloaded and reloaded via the Addins dialog and no documents are open it loads once. If the addin is reloaded while a file is open is reloads twice.
I came to the conclusion it is loading multiple times because the it seems to go through the Activation method of the addin twice. When is the Activation method called during loading an addin?
Solved! Go to Solution.
Solved by rjay75. Go to Solution.
I've figured it out. My addin has an automation component which exposes an api accessible from iLogic rules. During the initialization process it would rerun some rules automatically to initialize a window for a document. Since the rules depended on the addin the addin had to be referenced in the rule. It seems that if an unloaded addin is referenced through automation it would force load the addin. Since the addin hadn't completely loaded during the initialization phase it cause it to reload again.
Is there a method for the ApplicationAddinServer which can be called after an addin has fully loaded. Sort of like how a document has a Before and After during the loading phase?
In answer to my own question I see the Application.OnReady event is there just for this purpose.