Question

I would like to create an EA Script to configure (add/edit/delete) the Defined Tag Types (Settings > UML Types > Tagged Value Types) similar to what is done manually here.

I did not found any useful information about the object storing the Defined Tag Types. Any help?

Was it helpful?

Solution

This configuration is not available in EA's API. If you want to make changes to it programmatically, you'll have to manipulate the project database directly.

The "Tagged Value Types" are stored in the t_propertytypes table. Please note that tagged value types defined in an MDG Technology are not listed here, this table only contains those that are shown in the "UML Types" dialog.

OTHER TIPS

Looks like that you can programmatically only read the Tagged Values and change their value. Apparently you cannot add/remove Tagged Values.

Here is a part of the corresponding API. To add/remove a tagged value, you have to go directly to the DB.

TaggedValue Methods:

Method Type Notes

GetAttribute(string propName) String Returns the text of a single named property within a structured Tagged Value.

Parameters:

· propName: String - the name of the property for which the text is being returned

GetLastError() String Returns a string value describing the most recent error that occurred in relation to this object.

HasAttributes() Boolean Returns true if the Tagged Value is a structured Tagged Value with one or more properties.

SetAttribute( string propName, string propValue) Boolean Sets the text of a single named property within a structured Tagged Value.

Parameters:

· propName: String - - the name of the property for which the text is being set

· propValue: the value of the property

Update() Boolean Updates the current TaggedValue object after modification or appending a new item.

If false is returned, check the GetLastError function for more information.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top