Unit Conversion Per Attribute
I'd like the ability to control export units on a per-attribute basis, so that I could, for instance, export one of a record's attributes in inches and another attribute on that same record in centimeters.
Ideally, the workflow would be:
Create AttributeDefinition
s for each attribute
On each AttributeDefinition
, set the desired export unit via an attribute, property, or method
Pass the AttributeDefinition
s to bulk_fetch
The resulting AttributeValue
s have data in the desired units
Would this be possible with the current STK?
Best Answer
-
This is possible and is already implemented in the streamlined layer. The required unit can be set for point and range attributes using
Table.set_display_unit(attribute, unit_symbol)
. The "Fetch attribute data in bulk" example script shows this by specifying "ksi" as the unit for Young's modulus, even though the overall export is done in Metric.1