Book a Demo

Author Topic: Attribute TaggedValues  (Read 3800 times)

TT-Modeler

  • EA Novice
  • *
  • Posts: 3
  • Karma: +0/-0
    • View Profile
Attribute TaggedValues
« on: November 04, 2009, 05:26:32 am »
Hi,

I have successully created elements, attributes, and added tagged values to an element but adding tagged values to an attribute is throwing an error. Has anyone had any success doing this?

Details:
Visual Studio 2008 / C#
Enterprise Architect Version 7.5.848
Interopt.EA v2.0.50727

Code:
attributeElement = (EA.Attribute)tableElement.Attributes.AddNew(attributeName, "string");
attributeElement.Update();

EA.TaggedValue attributeTaggedValue =
   (EA.TaggedValue)attributeElement.TaggedValues.AddNew("test", "string");

The annoying error:
"Unable to cast COM object of type 'System.__ComObject' to interface type 'EA.TaggedValue'.
This operation failed because the QueryInterface call on the COM component for the interface with IID '{EF08950B-949E-435F-84A3-A59E3106C3BF}'
failed due to the following error: No such interface supported (Exception from HRESULT: 0x80004002 (E_NOINTERFACE))."

Thanks in advance

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: Attribute TaggedValues
« Reply #1 on: November 04, 2009, 08:22:32 am »
Look for EA.AttributeTag (or similar).  It is not an EA.TaggedValue.

TT-Modeler

  • EA Novice
  • *
  • Posts: 3
  • Karma: +0/-0
    • View Profile
Re: Attribute TaggedValues
« Reply #2 on: November 04, 2009, 11:00:19 am »
Thanks.  Works like a charm now.

Sorry, I missed that the previous was very similar to mine.