Author Topic: How to assign integer value to tag through API.  (Read 6064 times)

sravang

  • EA User
  • **
  • Posts: 33
  • Karma: +0/-0
    • View Profile
How to assign integer value to tag through API.
« on: November 15, 2021, 10:08:15 pm »
Hello,

I have different types of tags to be added. I am using following code to add them in c#.

 
Code: [Select]
EA.TaggedValue customAttributeTag = ele.TaggedValues.AddNew(attribute,GetPropertyType(shape,attribute,out attributeValue,""));
customAttributeTag.Value = attributeValue;
customAttributeTag.Update();

GetPropertyType returns type of tags ex: String,Integer,Float,Date etc.

In the above case it is working fine for String but in case of Integer it is throwing error of cannot convert int to string.

Any Idea about this?

Thanks,
Sravan

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13404
  • Karma: +567/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: How to assign integer value to tag through API.
« Reply #1 on: November 15, 2021, 10:39:10 pm »
Technically, the value of a tagged value is always a string.

In some cases EA will add a constraint in the GUI only to select only true/false, or integer or...

Geert