Sparx Systems Forum
Enterprise Architect => Automation Interface, Add-Ins and Tools => Topic started by: JanKowal on September 15, 2023, 11:00:31 pm
-
We have got a script written in JScript that utilizies the EA's API like Repository.GetPackageByGuid() etc. What we want to do is to execute the script from an external application that is written in Python that uses Win32 API to communicate with EA. We can not rewrite the primary script to work in Python. Is it possible? We are fine tho to execute the script not necessarily from Python but PowerShell or Java instead.
-
Yes, I do that all time.
eaApp = win32com.client.Dispatch("EA.App")
eaRep = eaApp.Repository
q.
-
Yes, I do that all time.
eaApp = win32com.client.Dispatch("EA.App")
eaRep = eaApp.Repository
q.
Yes, we got the same code, but what is the exact function call for script execution? I could not find any documentation on this matter.
-
I run Python scripts usually from Wingware. From inside EA you can't. Except you find a way to issue system calls from VB os tha J-stuff.
q.
-
I am not looking for a way to execute a Python script, but for a Python function that allows me to execute an existing script. So perfect situation would be something like
eaRep.ExecuteScript("scriptName")
after dispatching EA.App and fetching Repository object.
-
I am not looking for a way to execute a Python script, but for a Python function that allows me to execute an existing script. So perfect situation would be something like eaRep.ExecuteScript("scriptName")
after dispatching EA.App and fetching Repository object.
EA doesn't expose scripts in the API at all.
Although it is possible to run EA scripts without the help of EA, it's not a simple task at all.
I had to write quite a bit of code to pull that of in EA-Matic.
I guess you could do the same in Python, but it will probably take more time than rewriting the scripts in Python directly.
Geert
-
Well, yes. With an add-in it's easy. I did that to call external Python scripts. Worked nicely.
q.