Sparx Systems Forum

Enterprise Architect => General Board => Topic started by: zalbina on October 14, 2012, 09:59:55 pm

Title: TaggedValue and API
Post by: zalbina on October 14, 2012, 09:59:55 pm
Hello,

I'm trying to get tagged value from an attribute : currentAttribute.TaggedValues.GetByName("length"), but could not find an appropriate collection to save it. What is the return type of this GetByName?

Thanks.
Title: Re: TaggedValue and API
Post by: qwerty on October 15, 2012, 04:59:39 am
GetByName is not supported for all objects. Check the API doc whether it works at all for attribute tags. If not, you have to write your own GetByName.

q.
Title: Re: TaggedValue and API
Post by: Geert Bellekens on October 15, 2012, 06:42:51 pm
GetByName returns type Object, which you have to cast to whatever type is in your Collection.

So if you are using it on a collection of AttributeTag then you will have to cast it to that type.

Geert
Title: Re: TaggedValue and API
Post by: zalbina on October 16, 2012, 12:17:44 am
Thanks.