Skip to content

Conversation

@hl662
Copy link
Contributor

@hl662 hl662 commented Aug 20, 2025

Prerequisite for #1412

@hl662 hl662 self-assigned this Aug 20, 2025
Comment on lines +46 to +50
} catch (error) {
// Query failed, return empty array
console.warn("Failed to query used KindOfQuantities from iModel:", error);
return [];
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we really want to hide the error? Generally, we shouldn't do that and instead let components decide what to do with the error - maybe ignore it, maybe show some warning to the user...

Comment on lines +283 to +288
/**
* Called when an iModel is opened. Sets up schema-based formats if enabled.
* @param iModel - The opened iModel connection.
* @param options - Optional configuration for schema format setup.
*/
public async onIModelOpen(iModel: IModelConnection, options?: OnIModelOpenOptions): Promise<void> {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Who's supposed to call it? The docs give an impression that it should happen automatically, but that doesn't seem to be the case.

public async onIModelOpen(iModel: IModelConnection, options?: OnIModelOpenOptions): Promise<void> {
// Set up schema-based units and formats providers
const schemaFormatsProvider = new SchemaFormatsProvider(iModel.schemaContext, IModelApp.quantityFormatter.activeUnitSystem);
this.fallbackFormatsProvider = schemaFormatsProvider;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it by design that FormarManager is compatible with only one iModel at a time?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants