Book a Demo

Author Topic: Creating Diagrams using EA API in C# or Java  (Read 3111 times)

hshahid

  • EA User
  • **
  • Posts: 25
  • Karma: +0/-0
    • View Profile
Creating Diagrams using EA API in C# or Java
« on: September 29, 2010, 08:04:51 pm »
Hi Everyone,

Is there any way that I can create diagrams by using EA-API, in C# or Java, and can view my changes in the running instance of EA on the runtime. For now, I am able to connect to a .eap file, when my EA project is closed, I want that I can access my project on runtime.

If there are any sample codes or any generic module which you can share for creating sample diagrams by having EA instance running. Please let me share.

best regards,
Hamid.

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Creating Diagrams using EA API in C# or Java
« Reply #1 on: September 29, 2010, 09:33:55 pm »
You can indeed connect to the running instance (the first one started).
I use this code (C#):
Code: [Select]
           //connect to the currently running instance
            //if multiple instances are running it will connect to the instance that was first started.
            object obj = Marshal.GetActiveObject("EA.App");
            EA.App eaApp = obj as EA.App;
            wrappedModel = eaApp.Repository;

Geert

hshahid

  • EA User
  • **
  • Posts: 25
  • Karma: +0/-0
    • View Profile
Re: Creating Diagrams using EA API in C# or Java
« Reply #2 on: September 29, 2010, 10:59:20 pm »
Thanks Greet!