Sparx Systems Forum

Enterprise Architect => Automation Interface, Add-Ins and Tools => Topic started by: jk on July 03, 2018, 09:36:58 pm

Title: List all diagrams and connectors with C# Addin?
Post by: jk on July 03, 2018, 09:36:58 pm
Hello,

I use Enterprise Architect and i am a newbie in creating AddIns for EA with C#.
After trying and modifying the EA-CSAddin for Visual Studio from the sparxsystems website, I had a little success, the first "hello-world" AddIn works.  :)

The first question is:
Do you know where I can find some other small (and not too complicated) C# examples to learn more about the powerful AddIn functionality?
In my opinion the "Automation Guide" is very detailled but I miss some examples.
Otherwise I still have a problem with understanding the "hierarchy" of the different usable classes like "Repository", "Element", "Diagram" and "Connector" and I am not able to use these for my specific project (AddIn).

I have a existing EA-project and would like to check with an AddIn, which ports inside of ANY diagrams are connected with other inputs/outputs -> "consistency check". Is it possible to list via C# all existing connectors and then check the connection between them?
Another topic is to write a AddIn, which can copy the currently activated Diagram in the clipboard but NOT in svg-type. It should be in typical image-type to paste it in another tool.

I hope you can help me to improve my yet not existing knowledge in developing C# Addins for EA. :-)


Thank you very much
Title: Re: List all diagrams and connectors with C# Addin?
Post by: Arshad on July 03, 2018, 10:31:40 pm
Hi jk

Inside EA  there is plenty of sample scripts in both VBs and Jscripts which almost handle every information's.
There is also many online tools for converting VBs into C# codes.

If the hello world works through addin then its quite easy to refer scripts and build your c# code.



Arshad

Title: Re: List all diagrams and connectors with C# Addin?
Post by: qwerty on July 03, 2018, 11:38:15 pm
Look at github projects from  Geert Bellekens and Helmut Ortmann. You should find lots of examples there.

q.
Title: Re: List all diagrams and connectors with C# Addin?
Post by: Geert Bellekens on July 03, 2018, 11:52:03 pm
Next to my code on Github I also wrote a few articles that might help you: https://bellekens.com/writing-ea-add-ins/ (https://bellekens.com/writing-ea-add-ins/)

The thing is that "not too complicated" examples don't really exist in the wild.
Everything starts simple, but then you start refactoring out duplicate code, building a framework of reusable wrappers, and before you know it you have a codebase of 100.00 lines of sometimes quite complicated code  :-\

Geert
Title: Re: List all diagrams and connectors with C# Addin?
Post by: jk on July 04, 2018, 05:47:01 pm
Hello together,

thank you for the links / ideas. So I will read it!


BR