Sparx Systems Forum
Enterprise Architect => Automation Interface, Add-Ins and Tools => Topic started by: Paolo F Cantoni on September 11, 2015, 01:19:37 pm
-
Is there any way to start EA and get it to execute a pre-defined script?
I'd like to be able to nominate the script, but I'll settle for Autoexec if available.
From what I can see, there's no way to run a script through the API either. Is that the case?
TIA,
Paolo
-
Hi Paolo,
There's indeed no operation in the API to run a script, but it can be done.
With my EA-Matic (http://bellekens.com/ea-matic/) I'm doing it.
All of script handling is coded in the EA Add-in Framework (https://github.com/GeertBellekens/Enterprise-Architect-Add-in-Framework), most of it in the class Script (https://github.com/GeertBellekens/Enterprise-Architect-Add-in-Framework/blob/master/EAAddinFramework/EASpecific/Script.cs)
With the EA-Matic add-in you can attach scripts to API events such as EA_FileOpen. Those scripts will then be executed just like an add-in operation would.
Geert
-
Hi Paolo,
There's indeed no operation in the API to run a script, but it can be done.
With my EA-Matic (http://bellekens.com/ea-matic/) I'm doing it.
All of script handling is coded in the EA Add-in Framework (https://github.com/GeertBellekens/Enterprise-Architect-Add-in-Framework), most of it in the class Script (https://github.com/GeertBellekens/Enterprise-Architect-Add-in-Framework/blob/master/EAAddinFramework/EASpecific/Script.cs)
With the EA-Matic add-in you can attach scripts to API events such as EA_FileOpen. Those scripts will then be executed just like an add-in operation would.
Geert
Cool, I'll see if my management is happy with that.
Can I interrogate the command line args with EA-Matic? Then I could get EA to execute a specific script (or not) on file open from the command line.
Paolo
-
Can I interrogate the command line args with EA-Matic? Then I could get EA to execute a specific script (or not) on file open from the command line.
Not with something specific to EA-Matic. Do you know if those command line args are available to an add-in?
If they are you might be able to get to them from within a script as well.
Geert