1
Automation Interface, Add-Ins and Tools / Re: Help needed creating tagged values in EA with
« on: November 07, 2015, 12:10:38 am »
Hi Ian,
your code has just two small mistakes.
The first has been answered by Uffe.
The AddNew-function returns an object which will be your new tagged-value.
The second is, that you have not to call the Update-function of collection. You have to call the Update-function of your new tagged value.
Also the parameter of the AddNew-function are wrong. The first parameter is the name of the tagged-value (this is correct) but he second parameter is the type of your tagged-value not the value.
When I change your code, it should be corrected look like this
Jan
your code has just two small mistakes.
The first has been answered by Uffe.
The AddNew-function returns an object which will be your new tagged-value.
The second is, that you have not to call the Update-function of collection. You have to call the Update-function of your new tagged value.
Also the parameter of the AddNew-function are wrong. The first parameter is the name of the tagged-value (this is correct) but he second parameter is the type of your tagged-value not the value.
When I change your code, it should be corrected look like this
Code: [Select]
EA.TaggedValue newValue=(EA.TaggedValue)theElements.TaggedValues.AddNew("MyTagName", "string");
newValue.Value="MyTagValue";
newValue.Update()
theElements.TaggedValues.Refresh();
Jan