Sparx Systems Forum
Enterprise Architect => Automation Interface, Add-Ins and Tools => Topic started by: bilon on March 28, 2020, 03:11:37 am
-
Is there any way how to call a procedure in model script from a procedure in excel VBA?
-
Not really.
EA's API doesn't expose scripts, and it doesn't have any function to execute scripts (let alone parts of scripts)
What you could do (if you really want this) is query the database to get the script code, stitch it together (interprete the !INC statements) and then feed it into a ScriptController class.
Then you can execute procedures defined in the scripts.
I do something similar in EA-Matic, for which you can find the code here: https://github.com/GeertBellekens/Enterprise-Architect-Toolpack/tree/master/EAScriptAddin (https://github.com/GeertBellekens/Enterprise-Architect-Toolpack/tree/master/EAScriptAddin)
Geert
-
It looks pretty complex. I'm definitely not going to use it. Thanks anyway!