Sparx Systems Forum
Enterprise Architect => Automation Interface, Add-Ins and Tools => Topic started by: stao on June 08, 2011, 10:11:59 pm
-
Hi all
i have a very uncommon problem.
I have written an Addin which works very well.
i have the possibility to export data from the .EAP and reImport it.
(not the EA built in export and import mechanism, i use my own)
now i have a new program which should do my exports and imports via commandline arguments with EA not beeing started.
I added the DLL of my Addin and the Interop.EA.DLL as References to my new program.
I can load .eap files programmatically and run my export and import methods.
But here starts the problem, especially with the import.
For some reason the method executed by the c# code throws exceptions where the method executed in the EA Gui does not.
For instance the creation of a new class
EA.Element newClass = (EA.Element)container.Elements.AddNew(className, "EClass");
throws an "invalid type" exception.
EClass is a class from a new created uml profile, stored in my Addin.
it looks like that EA does not know uml profiles if its started by code without the gui?
//EDIT
I stepped over the (hopefully) solution
it seems that EA_OnInitializeTechnologies(EA.Repository Repository) method is not executed if EA is started externly so my mdg technology is unknown for EA.
Now i need a way to "inject" the technology file within my program.
Somenone knows how to do that?
-
Add-Ins are not loaded when EA is started from automation. I would recommend deploying your technology as a file.
-
thanks for the reply.
and when i have the file?
what can i do to inject the mdg technology?