Author Topic: List all diagrams and connectors with C# Addin?  (Read 3707 times)

jk

  • EA Novice
  • *
  • Posts: 11
  • Karma: +0/-0
    • View Profile
List all diagrams and connectors with C# Addin?
« 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

Arshad

  • EA User
  • **
  • Posts: 285
  • Karma: +19/-1
    • View Profile
Re: List all diagrams and connectors with C# Addin?
« Reply #1 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


qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +396/-301
  • I'm no guru at all
    • View Profile
Re: List all diagrams and connectors with C# Addin?
« Reply #2 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.

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13387
  • Karma: +566/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: List all diagrams and connectors with C# Addin?
« Reply #3 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/

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

jk

  • EA Novice
  • *
  • Posts: 11
  • Karma: +0/-0
    • View Profile
Re: List all diagrams and connectors with C# Addin?
« Reply #4 on: July 04, 2018, 05:47:01 pm »
Hello together,

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


BR