Sparx Systems Forum
Enterprise Architect => Automation Interface, Add-Ins and Tools => Topic started by: Jonc on November 26, 2008, 01:51:50 am
-
Hi everyone,
Firstly, I would like to apologize my english, it's not my native language. Now we can focus on my question.
I'm trying to make a WinForm application (not an addin) who can
- launch EA : ok
- open a project after the openning of the program : non ok
- and launch my Addin with elementGUID for attribute. : non ok
I'm just asking if it's possible and if you can help me.
Thanks a lot, and again, excuse my poor english
-
You can launch EA with something like
EA.Repository rep = new EA.Repository()
and then open a project with
rep.OpenFile(filename)
As to launching your AddIn, I'm not sure what you mean. If the AddIn is registered, EA will load it at startup anyway.
If you mean you want to call a function from your AddIn, and even call it with parameters, I don't think you can do this with the EA automation API. But why don't you put your function into a DLL so you can call it from your WinForms application as well as from your AddIn?
-
As to launching your AddIn, I'm not sure what you mean. If the AddIn is registered, EA will load it at startup anyway.
He is propably refering to calling it externally from the outside.
In that case opening the repository via the EARepository.OpenFile method will load up an EA process. However this will require to fetch the GUID of the element you want to process.
A different approach is to start your external program from inside the EA Tools menu and give it the GUID as a parameter.
See the online help for information regarding automation integration, both options are described there.
HTH
Oliver