Book a Demo

Author Topic: Lauch EA with args and run addin  (Read 2950 times)

Jonc

  • EA Novice
  • *
  • Posts: 1
  • Karma: +0/-0
    • View Profile
Lauch EA with args and run addin
« 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
« Last Edit: November 26, 2008, 01:52:10 am by Jonc »

Frank Horn

  • EA User
  • **
  • Posts: 535
  • Karma: +1/-0
    • View Profile
Re: Lauch EA with args and run addin
« Reply #1 on: November 26, 2008, 02:42:36 am »
You can launch EA with something like

Code: [Select]
EA.Repository rep = new EA.Repository()
and then open a project with

Code: [Select]
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?

Oliver F.

  • EA User
  • **
  • Posts: 573
  • Karma: +2/-1
  • Aren´t we all in the model business ?
    • View Profile
    • Karl Storz homepage
Re: Lauch EA with args and run addin
« Reply #2 on: November 26, 2008, 03:22:05 am »
Quote
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
« Last Edit: November 26, 2008, 03:22:42 am by ofels »