I have a question regarding calculating the value display string for an IECPropertyValue in ORD. I have a piece of code that retrieves the formatted value like this:
// IECPropertyValue propertyValue; var formatter = ECPropertyPane.GetPropertyValueFormatter(propertyValue.Property); return formatter != null ? formatter.ConvertToExpressionType(propertyValue).ToString() : propertyValue.NativeValue.ToString();
However, I've noticed that this approach doesn't include the unit and rounding a number when returning the value.Is there a way to calculate the value with its unit using API?
Your assistance would be greatly appreciated.Thanks
Hi Ivan,
Ivan Petrov said:Is there a way to calculate the value with its unit using API?
What is you intention? Do you want to obtain exactly what is displayed Properties dialog or to format the value in other, custom, style?
Regards,
Jan
Bentley Accredited Developer: iTwin Platform - AssociateLabyrinth Technology | dev.notes() | cad.point
Jan Šlegr I appreciate your quick response. My intention is to obtain the value exactly as it is displayed in the Properties dialog