You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I believe a Bentley Open Roads .dgn has a unit of measure associated with it.
When that dgn is sync'd to an iTwin/iModel does the unit of measure get saved with the iModel?
If so, is there a way (API call or ECSQL query) to get the units associated with an iModel?
We are using the PresentationManager and I do understand how I can specific the activeUnitSystem to get my display values in a specific units.
My task is to retrieve the actual UOM so I can properly run calculations on the data (which is always in metric) and display the result in the proper UOM.
I see the following paragraph in the Quantity Formatter docs, but I'm not sure where the ui-test-app can be found:
It is possible to retrieve Units from schemas stored in IModels. The new SchemaUnitProvider can now be created and used by the QuantityFormatter or any method in the core-quantity package that requires a UnitsProvider. Below is an example, extracted from ui-test-app, that demonstrates how to register the IModel-specific UnitsProvider as the IModelConnection is created. This new provider will provide access to a wide variety of Units that were not available in the standalone BasicUnitsProvider.
// Provide the QuantityFormatter with the iModelConnection so it can find the unit definitions defined in the iModel
const schemaLocater = new ECSchemaRpcLocater(iModelConnection);
await IModelApp.quantityFormatter.setUnitsProvider (new SchemaUnitProvider(schemaLocater));
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I believe a Bentley Open Roads .dgn has a unit of measure associated with it.
When that dgn is sync'd to an iTwin/iModel does the unit of measure get saved with the iModel?
If so, is there a way (API call or ECSQL query) to get the units associated with an iModel?
We are using the PresentationManager and I do understand how I can specific the activeUnitSystem to get my display values in a specific units.
My task is to retrieve the actual UOM so I can properly run calculations on the data (which is always in metric) and display the result in the proper UOM.
I see the following paragraph in the Quantity Formatter docs, but I'm not sure where the ui-test-app can be found:
It is possible to retrieve Units from schemas stored in IModels. The new SchemaUnitProvider can now be created and used by the QuantityFormatter or any method in the core-quantity package that requires a UnitsProvider. Below is an example, extracted from ui-test-app, that demonstrates how to register the IModel-specific UnitsProvider as the IModelConnection is created. This new provider will provide access to a wide variety of Units that were not available in the standalone BasicUnitsProvider.
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions