IModelImporter Class @beta

Base class for importing data into an iModel.

@see - iModel Transformation and Data Exchange

Methods

Name Description
constructor(editTxn: EditTxn, options?: IModelImportOptions): IModelImporter Construct a new IModelImporter  
computeProjectExtents(): void Optionally compute the projectExtents for the target iModel depending on the options for this IModelImporter.  
deleteElement(elementId: string): Promise<void> Deletes one target element tree through deleteElements.  
deleteElements(elementIds: ReadonlySet<string>): Promise<void> Deletes target element trees in one native operation.  
deleteModel(modelId: string): Promise<void> Delete the specified Model from the target iModel.  
deleteRelationship(relationshipProps: RelationshipPropsForDelete): Promise<void> Delete the specified Relationship from the target iModel.  
finalize(): void Needs to be called to perform necessary cleanup operations.  
importElement(elementProps: ElementProps): Promise<string> Import the specified ElementProps (either as an insert or an update) into the target iModel.  
importElementMultiAspects(aspectPropsArray: ElementAspectProps[], filterFunc: (a: ElementMultiAspect) => boolean = ...): Promise<string[]> Import the collection of ElementMultiAspects into the target iModel.  
importElementUniqueAspect(aspectProps: ElementAspectProps): Promise<string> Import an ElementUniqueAspect into the target iModel.  
importModel(modelProps: ModelProps): Promise<void> Import the specified ModelProps (either as an insert or an update) into the target iModel.  
importRelationship(relationshipProps: RelationshipProps): Promise<string> Import the specified RelationshipProps (either as an insert or an update) into the target iModel.  
markElementToUpdateDuringPreserveIds(elementId: string): void Marks an element so that it can be updated during import when preserveElementIdsForFiltering is set to true.  
onDeleteElementAspect(targetElementAspect: ElementAspect): Promise<void> Protected Delete the specified ElementAspect from the target iModel.  
onDeleteElements(elementIds: ReadonlySet<string>): Promise<void> Protected Adds roots required by code-scope dependencies, then deletes the target element trees in one native operation.  
onDeleteModel(modelId: string): Promise<void> Protected Delete the specified Model from the target iModel.  
onDeleteRelationship(relationshipProps: RelationshipPropsForDelete): Promise<void> Protected Delete the specified Relationship from the target iModel.  
onInsertElement(elementProps: ElementProps): Promise<string> Protected Create a new Element from the specified ElementProps and insert it into the target iModel.  
onInsertElementAspect(aspectProps: ElementAspectProps): Promise<string> Protected Insert the ElementAspect into the target iModel.  
onInsertModel(modelProps: ModelProps): Promise<string> Protected Create a new Model from the specified ModelProps and insert it into the target iModel.  
onInsertRelationship(relationshipProps: RelationshipProps): Promise<string> Protected Create a new Relationship from the specified RelationshipProps and insert it into the target iModel.  
onProgress(): Promise<void> Protected This method is called when IModelImporter has made incremental progress based on the progressInterval setting.  
onUpdateElement(elementProps: ElementProps): Promise<void> Protected Update an existing Element in the target iModel from the specified ElementProps.  
onUpdateElementAspect(aspectProps: ElementAspectProps): Promise<void> Protected Update the ElementAspect within the target iModel.  
onUpdateModel(modelProps: ModelProps): Promise<void> Protected Update an existing Model in the target iModel from the specified ModelProps.  
onUpdateRelationship(relationshipProps: RelationshipProps): Promise<void> Protected Update an existing Relationship in the target iModel from the specified RelationshipProps.  
optimizeGeometry(options: OptimizeGeometryOptions): void Examine the geometry streams of every GeometricElement3d in the target iModel and apply the specified optimizations.  

Properties

Name Type Description
_editTxn Protected Readonly EditTxn The EditTxn used for write operations on the target iModel.  
doNotUpdateElementIds Readonly Set<string> The set of target elements that this importer must not directly update or request for deletion.  
editTxn Accessor ReadOnly EditTxn The EditTxn used for write operations on the target iModel.  
options Readonly Required<IModelImportOptions> resolved initialization options for the importer  
progressInterval number The number of entity changes before incremental progress should be reported via the onProgress callback.  
targetDb Readonly IModelDb The read/write target iModel.  

Defined in

Last Updated: 25 August, 2026