Book a Demo

Author Topic: Configuring Visual Studio/Eclipse for EA scripting in Java/C++  (Read 3590 times)

SystemsTinkerer

  • EA User
  • **
  • Posts: 48
  • Karma: +0/-0
    • View Profile
Configuring Visual Studio/Eclipse for EA scripting in Java/C++
« on: February 24, 2022, 11:23:26 pm »
Hi friends,

hope all is well. I have realised the default IDE, is really terrible for using script languages so can anyone provide some tips on the steps to configure a dedicated programming IDE like visual basic or eclipse so that I can write code to interact with the EA Repository/Model? Any language like C++, C# or Java would do.

Thanks,
Oz

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13495
  • Karma: +572/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Configuring Visual Studio/Eclipse for EA scripting in Java/C++
« Reply #1 on: February 25, 2022, 12:15:46 am »
You can use Visual Studio and write C#

See https://github.com/GeertBellekens/Enterprise-Architect-Toolpack for examples

Geert

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +396/-301
  • I'm no guru at all
    • View Profile
Re: Configuring Visual Studio/Eclipse for EA scripting in Java/C++
« Reply #2 on: February 25, 2022, 03:41:50 am »
I'm using Python since it has nice debugging and is pretty fast too (unless you're going to rip up some terabyte database ). Using Wingware as IDE.

q.

SystemsTinkerer

  • EA User
  • **
  • Posts: 48
  • Karma: +0/-0
    • View Profile
Re: Configuring Visual Studio/Eclipse for EA scripting in Java/C++
« Reply #3 on: February 25, 2022, 04:12:32 am »
You can use Visual Studio and write C#

See https://github.com/GeertBellekens/Enterprise-Architect-Toolpack for examples

Geert

Hi Geert & q,

Thank you for your input.

Isn't there a set path configurations to be made before I can do any coding to communicate with EA? For instance,  I came across somewhere, a recommendation to include the path of EA.tbl file I am not sure where to do that in visual studio.

Also, Geert, is there a very simple example in C#/C++ that can be used just to get started. The default examples that come with EA library run to many lines of code...

Thanks again,
Oz

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13495
  • Karma: +572/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Configuring Visual Studio/Eclipse for EA scripting in Java/C++
« Reply #4 on: February 25, 2022, 04:56:10 am »
In order to use the API in a C# project you need to reference the EA.interop.dll (found in the program files folder)

You can connect to the currently running EA instance using

Code: [Select]
            object obj = Marshal.GetActiveObject("EA.App");
            var eaApp = obj as global::EA.App;
            var repository = App.Repository;

You then have a hold of the Repository object, where it all starts. See https://sparxsystems.com/enterprise_architect_user_guide/15.2/automation/repository3.html

Geert

SystemsTinkerer

  • EA User
  • **
  • Posts: 48
  • Karma: +0/-0
    • View Profile
Re: Configuring Visual Studio/Eclipse for EA scripting in Java/C++
« Reply #5 on: February 26, 2022, 05:05:11 am »
Geert - many thanks for clarifying this further. :)

Best,
Oz