Sparx Systems Forum

Enterprise Architect => Automation Interface, Add-Ins and Tools => Topic started by: Modesto Vega on February 14, 2025, 05:14:24 am

Title: Adding a Tag to all elements in a package
Post 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?
Title: Re: Adding a Tag to all elements in a package
Post by: Modesto Vega on February 14, 2025, 10:32:53 pm
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?
Title: Re: Adding a Tag to all elements in a package
Post by: M1TO on February 14, 2025, 10:38:47 pm
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.
Title: Re: Adding a Tag to all elements in a package
Post by: Geert Bellekens on February 15, 2025, 02:59:02 am
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


Geert
[/list]

Title: Re: Adding a Tag to all elements in a package
Post by: Modesto Vega on February 18, 2025, 11:23:24 pm
Thank you Geert, will give it a try when available.