Sparx Systems Forum

Enterprise Architect => Automation Interface, Add-Ins and Tools => Topic started by: lario on December 07, 2011, 03:12:40 am

Title: Programmatically adding new UML elements to model
Post by: lario 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.
Title: Re: Programmatically adding new UML elements to mo
Post by: Rouven 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
Title: Re: Programmatically adding new UML elements to mo
Post by: qwerty 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.
Title: Re: Programmatically adding new UML elements to mo
Post by: Geert Bellekens 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 (http://geertbellekens.wordpress.com/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 (http://community.sparxsystems.com/)
If feel more comfortable in VB(A) then the Simple VBA Excel EA importer (http://community.sparxsystems.com/resources/scripts/simple-vba-excel-ea-importer) might be useful.

Geert