Sparx Systems Forum

Enterprise Architect => Automation Interface, Add-Ins and Tools => Topic started by: Geert Bellekens on November 27, 2010, 01:45:57 am

Title: EA_OnPostInitialized: call openFile.. before
Post by: Geert Bellekens on November 27, 2010, 01:45:57 am
I'm creating an addin to prevent accidental stereotype creation, and the moment the model is loaded I want to create a list of the defined stereotypes.
I thought it would be a good idea to put it in the event EA_OnPostInitialized because it says the model is fully loaded at that moment, but I get an error:
EA_OnPostInitialized: Call OpenFile() or OpenFile2() before accessing other Repository members.
So if I cant use the repository yet, whats the point of this event?
Here's the code I'm using on 8.0.862
Code: [Select]
       public void EA_OnPostInitialized(EA.Repository Repository)
        {
            //make sure the list is empty when connecting
            existingStereotypes = new Dictionary<string, EA.Stereotype>();
            foreach (EA.Stereotype stereotype in Repository.Stereotypes)
            {
                existingStereotypes.Add(stereotype.StereotypeGUID, stereotype);
            }
        }
Anyone who successfully used the EA_OnPostInitialized operation?

Geert
Title: Re: EA_OnPostInitialized: call openFile.. before
Post by: alesliehughes on November 29, 2010, 10:36:56 am
Hi Geert,

I can confirm it as an issue.

Alistair
Title: Re: EA_OnPostInitialized: call openFile.. before
Post by: Geert Bellekens on November 29, 2010, 02:38:02 pm
Allright, thanks, I'll have to work around it for the moment then.

Geert