I've got an element with an ItemType attached. I want to get the value for a specific property of that ItemType. I can get a DgnECInstancePtr for a specific ItemType that is on the element. The issue is how to get a specific property value. I can use the DgnECInstancePtr and call GetValue(itemValue, index), but the "index" order is not reflective of the order in which those properties were defined/inserted into the ItemTypeLibrary. Further investigation reveals that there is a PropertyLayout class that may be used to obtain the "index" for a property, but the only way I see to get a PropertyValue is to use the ClassLayout class, which I'm not sure how to get...
It looks like once you have a ClassLayout, you get get a PropertyLayout...
DgnFileP activeDgnFile = ISessionMgr::GetActiveDgnFile(); ItemTypeLibraryPtr newLibrary = ItemTypeLibrary::FindByName(L"Test", *activeDgnFile); if (newLibrary.IsValid()) { ItemTypeP itemType = newLibrary->GetItemTypeByName (L"Air Tunnel"); //nullptr if not found if (itemType) { CustomItemHost host (eeh); DgnECInstancePtr itemInstance = host.GetCustomItem (newLibrary->GetName(), itemType->GetName()); if (itemInstance.IsValid()) { PropertyLayoutCP layoutCP; // to see how the properties are indexed ? ClassLayoutPtr classLayoutPtr=ClassLayout::BuildFromClass(???); classLayoutPtr->GetPropertyLayout(layoutCP,L"Status"); // ?????? } } }
So the question is how to determine the "index" for a specific property of an ItemType?
Bruce