Message 1 of 7
Some properties display as 0 instead of their actual value when extracted

Not applicable
07-09-2019
09:09 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi guys,
I'm working on this Navisworks plugin that extracts a bunch of properties from a bunch of elements in the model and writes those properties into an SQL database.
Eveything seems to be working (yay!) but some values, when extracted come out with a value of 0 (number zero) instead of their actual value. Refer to picture below for examples:
And this is how I'm extracting the properties' values:
internal static string GetPropertyValue(DataProperty property) { // Instantiate value of parameter string value; // Get value depending on its type switch (property.Value.DataType) { case VariantDataType.None: value = property.Value.ToString(); break; case VariantDataType.Double: value = property.Value.ToAnyDouble().ToString(); break; case VariantDataType.Int32: value = property.Value.ToInt32().ToString(); break; case VariantDataType.Boolean: value = property.Value.ToBoolean().ToString(); break; case VariantDataType.DisplayString: value = property.Value.ToDisplayString(); break; case VariantDataType.DateTime: value = property.Value.ToDateTime().ToString(); break; case VariantDataType.DoubleLength: value = property.Value.ToDoubleLength().ToString(); break; case VariantDataType.DoubleAngle: value = property.Value.ToDoubleAngle().ToString(); break; case VariantDataType.NamedConstant: value = property.Value.ToNamedConstant().Value.ToString(); break; case VariantDataType.IdentifierString: value = property.Value.ToIdentifierString().ToString(); break; case VariantDataType.DoubleArea: value = property.Value.ToDoubleArea().ToString(); break; case VariantDataType.DoubleVolume: value = property.Value.ToDoubleVolume().ToString(); break; case VariantDataType.Point3D: value = property.Value.ToPoint3D().ToString(); break; case VariantDataType.Point2D: value = property.Value.ToPoint2D().ToString(); break; default: value = property.Value.ToString(); break; } return value; }
Can anyone see why those anomalies are happening?
Thanks for the help!
Andrea