Sparx Systems Forum
Enterprise Architect => Automation Interface, Add-Ins and Tools => Topic started by: Dieter Goetz on December 02, 2015, 12:09:32 am
-
Hi,
how can I read tagged values from parameter using the EA SDK?
This code will threw an exception:
//parameter is of type EA.parameter and existing
//Min is also existing
EA.TaggedValue tagValue = parameter.TaggedValues.GetByName("Min");
The same line of code for other EA elements is working.
-
The getByName does not work for all collections. Try iterating instead. Also note that there might be more than one TV with the same name!
q.
-
Iterating will not work neither. The return can not casted to a tagged value.
EA.TaggedValue tagValue;
for (short i = 0; i < parameter.TaggedValues.Count; i++)
{
tagValue = parameter.TaggedValues.GetAt(i);
}
-
How about something like:
EA.ParamTag tag;
for (short i = 0; i < parameter.TaggedValues.Count; i++)
{
tag = parameter.TaggedValues.GetAt(i);
}
-
Great, EA.ParamTag is working. Thanks a lot,