07-24-2023, 08:15 AM
I'm a beginner with Enterprise Architect and I need to write a little program to select all "Activity" type in a Enterprise Architect project to set a particular value of "Alias" property (not the same but following a particular logic).
I think to do this with the Scripting tool, but I had some difficulties to access to any activity object by scripting.
I found the link [1] "Enterprise Architect Object Model" but I could not solve my question.
Below is attached the project tree.
Here there is some javascript code i tried:
var elem as EA.Element;
elem = Repository.GetTreeSelectedObject();
elem.Alias = "Hi at all";
But this code has 2 problems:
1) it needs to select the activity with the mouse pointer;
2) after running the code the "Alias" field of the activity is empty.
[![enter image description here][2]][2]
[1]:
[2]:
I think to do this with the Scripting tool, but I had some difficulties to access to any activity object by scripting.
I found the link [1] "Enterprise Architect Object Model" but I could not solve my question.
Below is attached the project tree.
Here there is some javascript code i tried:
var elem as EA.Element;
elem = Repository.GetTreeSelectedObject();
elem.Alias = "Hi at all";
But this code has 2 problems:
1) it needs to select the activity with the mouse pointer;
2) after running the code the "Alias" field of the activity is empty.
[![enter image description here][2]][2]
[1]:
[2]: