Author Topic: Programmatically adding new UML elements to model  (Read 4077 times)

lario

  • EA Novice
  • *
  • Posts: 8
  • Karma: +0/-0
    • View Profile
Programmatically adding new UML elements to model
« on: December 07, 2011, 03:12:40 am »
Base upon what a user adds to their UML model, I want to push into their model additional model elements.  I plan to use automation and write a plugin to support this.

I am looking for general guidance and want to make sure I am headed in the correct direction.  My plan is to interrogate the EA.Repository object and push new elements into the same object.  Is this general the correct method to add new elements to the user model?

Can you direct me to an example?

Thanks for your help.

Rouven

  • EA User
  • **
  • Posts: 48
  • Karma: +0/-0
    • View Profile
Re: Programmatically adding new UML elements to mo
« Reply #1 on: December 07, 2011, 04:14:51 am »
Hi Lario,

without meaning to sound rude: did you have a look at http://www.sparxsystems.com/uml_tool_guide/sdk_for_enterprise_architect/addandmanageelements.htm where Sparx describes samples.

Do you have any specific questions regarding this?

Cheers,
Rouven

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +396/-301
  • I'm no guru at all
    • View Profile
Re: Programmatically adding new UML elements to mo
« Reply #2 on: December 07, 2011, 05:10:20 am »
EA offers broadcast events upon element creation you can catch in order to do what you want. Search the help for EA_on*

q.

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13404
  • Karma: +567/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Programmatically adding new UML elements to mo
« Reply #3 on: December 07, 2011, 05:49:47 pm »
Lario,

I've written a small tutorial on how to write add-ins for EA:
http://geertbellekens.wordpress.com/2011/01/29/tutorial-create-your-first-c-enterprise-architect-addin-in-10-minutes/
and I have an open source EA addin framework for you to use:
https://github.com/GeertBellekens/Enterprise-Architect-Add-in-Framework and an example add-in (EA Navigator) built on top of this framework:
https://github.com/GeertBellekens/Enterprise-Architect-Toolpack
Another great source for examples is the sparx community site
If feel more comfortable in VB(A) then the Simple VBA Excel EA importer might be useful.

Geert