-
We have an option to select a unit system (IModelApp.quantityFormatter.setActiveUnitSystem). Is it possible to customize the distance units further? |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
Hi, can I ask how you are currently using the quantity formatter? Is this for a frontend viewer that utilizes different published measure tools, or are you utilizing custom formatProps and constructing formattingSpec and parsingSpec objects for use outside of those tools? |
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
-
I see that the formatSpecs from Problem with the above is you would need to know the QuantityType to override, which I don't think
We also have a React component that lets you configure how quantities are formattted easily, propagating these updates across the measurement tools (Also code example of introducing the component) |
Beta Was this translation helpful? Give feedback.
I see that the formatSpecs from
MeasurementSelectionSet.global.measurements
come from IModelApp.quantityFormatter.getFormatterSpecByQuantityType. If that's the case, you could customize within your app to utilizesetOverrideFormat
. This code example at the bottom of the page is one example - A user retrieves the formatProps for a QuantityType, adds a property to the props, and overrides the format inside of iModelApp's quantityFormatter. The formatter will emit a onChange event, which should tell MeasurementSelectionSet to also update things.Problem with the above is you would need to know the QuantityType to override, which I don't think
MeasurementSelectionSet.global.measurements
provi…