Unit Conversion Per Attribute

Options
noahMDMi
noahMDMi Member Posts: 8
Photogenic First Comment
edited January 30 in Materials

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 AttributeDefinitions for each attribute
On each AttributeDefinition, set the desired export unit via an attribute, property, or method
Pass the AttributeDefinitions to bulk_fetch
The resulting AttributeValues have data in the desired units

Would this be possible with the current STK?

Tagged:

Best Answer

  • Andy_Grigg
    Andy_Grigg Member, Employee Posts: 26
    Name Dropper First Answer First Comment First Anniversary
    Answer ✓
    Options

    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.