IModelImporter Class

Base class for importing data into an iModel.

@see - iModel Transformation and Data Exchange

Implements

Methods

Name Description
constructor(targetDb: IModelDb, 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): void Delete the specified Element from the target iModel.  
deleteModel(modelId: string): void Delete the specified Model from the target iModel.  
deleteRelationship(relationshipProps: RelationshipProps): void Delete the specified Relationship from the target iModel.  
getAdditionalStateJson(): any Protected You may override this to store arbitrary json state in a exporter state dump, useful for some resumptions  
importElement(elementProps: ElementProps): string Import the specified ElementProps (either as an insert or an update) into the target iModel.  
importElementMultiAspects(aspectPropsArray: ElementAspectProps[], filterFunc: (a: ElementMultiAspect) => boolean = ...): string[] Import the collection of ElementMultiAspects into the target iModel.  
importElementUniqueAspect(aspectProps: ElementAspectProps): string Import an ElementUniqueAspect into the target iModel.  
importModel(modelProps: ModelProps): void Import the specified ModelProps (either as an insert or an update) into the target iModel.  
importRelationship(relationshipProps: RelationshipProps): string Import the specified RelationshipProps (either as an insert or an update) into the target iModel.  
loadAdditionalStateJson(_additionalState: any): void Protected You may override this to load arbitrary json state in a transformer state dump, useful for some resumptions  
onDeleteElement(elementId: string): void Protected Delete the specified Element (and all its children) from the target iModel.  
onDeleteElementAspect(targetElementAspect: ElementAspect): void Protected Delete the specified ElementAspect from the target iModel.  
onDeleteModel(modelId: string): void Protected Delete the specified Model from the target iModel.  
onDeleteRelationship(relationshipProps: RelationshipProps): void Protected Delete the specified Relationship from the target iModel.  
onInsertElement(elementProps: ElementProps): string Protected Create a new Element from the specified ElementProps and insert it into the target iModel.  
onInsertElementAspect(aspectProps: ElementAspectProps): string Protected Insert the ElementAspect into the target iModel.  
onInsertModel(modelProps: ModelProps): string Protected Create a new Model from the specified ModelProps and insert it into the target iModel.  
onInsertRelationship(relationshipProps: RelationshipProps): string Protected Create a new Relationship from the specified RelationshipProps and insert it into the target iModel.  
onProgress(): void Protected This method is called when IModelImporter has made incremental progress based on the IModelImporter.progressInterval setting.  
onUpdateElement(elementProps: ElementProps): void Protected Update an existing Element in the target iModel from the specified ElementProps.  
onUpdateElementAspect(aspectProps: ElementAspectProps): void Protected Update the ElementAspect within the target iModel.  
onUpdateModel(modelProps: ModelProps): void Protected Update an existing Model in the target iModel from the specified ModelProps.  
onUpdateRelationship(relationshipProps: RelationshipProps): 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
autoExtendProjectExtents Accessor boolean | { excludeOutliers: boolean } If true (the default), compute the projectExtents of the target iModel after elements are imported.  
doNotUpdateElementIds Readonly Set<string> The set of elements that should not be updated by this IModelImporter.  
options Readonly Required<IModelImportOptions> resolved initialization options for the importer  
preserveElementIdsForFiltering Accessor boolean See IModelTransformOptions.preserveElementIdsForFiltering  
progressInterval number The number of entity changes before incremental progress should be reported via the IModelImporter.onProgress callback.  
simplifyElementGeometry Accessor boolean See IModelImportOptions.simplifyElementGeometry  
targetDb Readonly IModelDb The read/write target iModel.  

Defined in

Last Updated: 12 February, 2024