Sparx Systems Forum
Enterprise Architect => General Board => Topic started by: SystemsTinkerer 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
-
You can use Visual Studio and write C#
See https://github.com/GeertBellekens/Enterprise-Architect-Toolpack (https://github.com/GeertBellekens/Enterprise-Architect-Toolpack) for examples
Geert
-
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.
-
You can use Visual Studio and write C#
See https://github.com/GeertBellekens/Enterprise-Architect-Toolpack (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
-
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
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 (https://sparxsystems.com/enterprise_architect_user_guide/15.2/automation/repository3.html)
Geert
-
Geert - many thanks for clarifying this further. :)
Best,
Oz