Book a Demo

Author Topic: TaggedValues : add value  (Read 3704 times)

The apprentice

  • EA Novice
  • *
  • Posts: 19
  • Karma: +0/-0
    • View Profile
TaggedValues : add value
« on: April 11, 2019, 08:02:15 pm »
 
Hi I try to add a value on a taggedValue's method :
Code: [Select]
EA.Method method = (EA.Method)currentMbdClass.Methods.GetAt(0);
            foreach (EA.TaggedValue tag in method.TaggedValues)
            {
                //Do Something
            }
and I have this error : "Unable to cast COM object of type'System_ComObject' to interface type 'EA.TaggedValue'"

I don't know how to get a taggedValue from the method.

Arshad

  • EA User
  • **
  • Posts: 291
  • Karma: +21/-1
    • View Profile
Re: TaggedValues : add value
« Reply #1 on: April 11, 2019, 10:16:26 pm »
You should use MethodTag instead and not normal TaggedValue

Try
Code: [Select]
EA.Method method = (EA.Method)currentMbdClass.Methods.GetAt(0);
            foreach (EA.MethodTagtag in method.TaggedValues)
            {
                //Do Something
            }

It should do the trick.

For More Details Refer
https://sparxsystems.com/enterprise_architect_user_guide/14.0/automation/methodtag.html

HTH
Arshad

The apprentice

  • EA Novice
  • *
  • Posts: 19
  • Karma: +0/-0
    • View Profile
Re: TaggedValues : add value
« Reply #2 on: April 11, 2019, 10:54:36 pm »
It's work.
I didn't see this attribute.

Ty again.