Sparx Systems Forum
Enterprise Architect => Automation Interface, Add-Ins and Tools => Topic started by: Modesto Vega on February 14, 2025, 05:14:24 am
-
I am sure this has been covered before in this forum but cannot find a relevant post.
Does anybody have a script to add a tag to all elements of a certain type in package?
-
Having looked at this in more detail, for this type of element, a database table, Sparx EA does not add a tag, it creates an object property.
From a scripting point of view, is this the same as adding a tag?
-
Well, you have to find the elements you want to add the tagged value to by finding all elements in the selected package. And then you can use the EaScriptLib functions TVGetElementTaggedValue and TVSetElementTaggedValue from JScript-TaggedValue.
-
Having looked at this in more detail, for this type of element, a database table, Sparx EA does not add a tag, it creates an object property.
From a scripting point of view, is this the same as adding a tag?
Yes, a part of the object properties are tagged values.
The script would be very basic
- Loop all elements
- for each element loop tagged values to see if the tagged value already exists
- if it doesn't exist, add a new tagged value
- if it does exist set the value
- update the tag
- next element
Geert
[/list]
-
Thank you Geert, will give it a try when available.