Sparx Systems Forum
Enterprise Architect => Automation Interface, Add-Ins and Tools => Topic started by: kjourdan on August 07, 2017, 11:11:56 pm
-
Is it possibly to invoke a user script from an Add-In? I would like to add buttons to the user control for my add-in and have those buttons invoke scripts stored in the model. Is this possible?
-
Hi,
yes.
In the Open Source Navigator https://bellekens.com/ea-navigator/ (https://bellekens.com/ea-navigator/) from Geert Belleken are classes which make it easy to implement invoking Scripts in your Addin.
My Open Source hoTools uses Geerts Script classes to call Scripts from within C# Add-In.
Kind regards,
Helmut
-
See https://github.com/GeertBellekens/Enterprise-Architect-Add-in-Framework/blob/master/EAAddinFramework/EASpecific/Script.cs for more info.
this is used in the tool EA-Matic (https://bellekens.com/ea-matic/) to execute functions from scripts as a reaction to events from EA.
Just be careful not to include any of the EA specific stuff in the script you are trying to execute. So no "AS EA.Element" or no "Session.Input" only "Repository" and "!INC" are supported by these scripts.
The best way forward is to start with a very simple example using nothing then standard scripting syntax, and then extend that step by step.
Geert