Hello All
I have an Item Type attached to an element in a model
One of the Properties in the Item Type is a string that has a pick list to choose the value with.
With C#.Net how do I programmatically change the value of the property attached to the element to a different value?
I am using the following code which will update a string property value, but will not update a value if the property has a PickList associated to it.
using Bentley.DgnPlatformNET; using Bentley.DgnPlatformNET.Elements; using Bentley.DgnPlatformNET.DgnEC; /// <summary>Edit Property Double value on Element</summary> public bool EditPropertyStringValueOnElement(Element element, string itemLibraryName, string itemTypeName, string propertyName, string value) { ItemTypeLibrary itemTypeLibrary = ItemTypeLibrary.FindByName(itemLibraryName, m_ActiveDgnFile); if (itemTypeLibrary != null) { ItemType itemType = itemTypeLibrary.GetItemTypeByName(itemTypeName); if (itemType != null) { CustomItemHost host = new CustomItemHost(element, false); if (host != null) { IDgnECInstance item = host.GetCustomItem(itemLibraryName, itemTypeName); if (item != null) { item[propertyName].StringValue = value; item.WriteChanges(); return true; } } } } return false; }
Any ideas how to update a property value when a pick list is being used?