Sparx Systems Forum
Enterprise Architect => Automation Interface, Add-Ins and Tools => Topic started by: klatchy on May 30, 2004, 10:14:39 pm
-
Has anyone else encountered a InvalidCastException when trying to add tagged values to a connector?
Connector myConnector = supplierElement.Connectors.AddNew("Depends on", "Dependency");
TaggedValue t = (TaggedValue)myConnector.TaggedValues.AddNew("A-Tag", "");
C# complains that I have invalidly cast to a TaggedValue, but I am doing this for adding TaggedValues to all my elements. Maybe this isn't implemented for Connectors?
Can someone else confirm this?
Thanks,
Ian
[edit] Note to self, RTFM, Connector.TaggedValues.AddNew() returns a ConnectorTag *slap* [/edit]
-
It looks like you may have solved you own problem. As you 'note-to-self' says, you need to you the ConntectorTag class rather than the TaggedValue class. This little nuance really throw me for a loop for about an hour...'til I saw you little note.