IModelExporter Class

Beta  

Base class for exporting data from an iModel.

note Most uses cases will not require a custom subclass of IModelExporter. Instead, it is more typical to subclass/customize IModelExportHandler.

see iModel Transformation and Data Exchange, IModelExporter.registerHandler, IModelTransformer, IModelImporter

Methods

Name Description
constructor(sourceDb: IModelDb): IModelExporter Construct a new IModelExporter  
excludeCodeSpec(codeSpecName: string): void Add a rule to exclude a CodeSpec  
excludeElement(elementId: string): void Add a rule to exclude a specific Element.  
excludeElementAspectClass(classFullName: string): void Add a rule to exclude all ElementAspects of a specified class.  
excludeElementClass(classFullName: string): void Add a rule to exclude all Elements of a specified class.  
excludeElementsInCategory(categoryId: string): void Add a rule to exclude all Elements in a specified Category.  
excludeRelationshipClass(classFullName: string): void Add a rule to exclude all Relationships of a specified class.  
exportAll(): Promise<void> Export all entity instance types from the source iModel.  
exportChanges(user?: string, startChangesetId?: string): Promise<void> Export changes from the source iModel.  
exportChildElements(elementId: string): Promise<void> Export the child elements of the specified element from the source iModel.  
exportCodeSpecById(codeSpecId: string): Promise<void> Export a single CodeSpec from the source iModel.  
exportCodeSpecByName(codeSpecName: string): Promise<void> Export a single CodeSpec from the source iModel.  
exportCodeSpecs(): Promise<void> Export all CodeSpecs from the source iModel.  
exportElement(elementId: string): Promise<void> Export the specified element, its child elements (if applicable), and any owned ElementAspects.  
exportFontByName(fontName: string): Promise<void> Export a single font from the source iModel.  
exportFontByNumber(fontNumber: number): Promise<void> Export a single font from the source iModel.  
exportFonts(): Promise<void> Export all fonts from the source iModel.  
exportModel(modeledElementId: string): Promise<void> Export the model container, contents, and sub-models from the source iModel.  
exportModelContents(modelId: string, elementClassFullName: string = Element.classFullName, skipRootSubject?: boolean): Promise<void> Export the model contents.  
exportRelationship(relClassFullName: string, relInstanceId: string): Promise<void> Export a relationship from the source iModel.  
exportRelationships(baseRelClassFullName: string): Promise<void> Exports all relationships that subclass from the specified base class.  
exportSchemas(): Promise<void> Export schemas from the source iModel.  
exportSubModels(parentModelId: string): Promise<void> Export the sub-models directly below the specified model.  
getAdditionalStateJson(): any Protected You may override this to store arbitrary json state in a exporter state dump, useful for some resumptions  
loadAdditionalStateJson(_additionalState: any): void Protected You may override this to load arbitrary json state in a transformer state dump, useful for some resumptions  
registerHandler(handler: IModelExportHandler): void Register the handler that will be called by IModelExporter.  
shouldExportElement(element: Element): boolean Returns true if the specified element should be exported.  

Properties

Name Type Description
handler Accessor ProtectedReadOnly IModelExportHandler The handler called by this IModelExporter.  
progressInterval number The number of entities exported before incremental progress should be reported via the IModelExporter.onProgress callback.  
sourceDb Readonly IModelDb The read-only source iModel.  
visitElements boolean A flag that determines whether this IModelExporter should visit Elements or not.  
visitRelationships boolean A flag that determines whether this IModelExporter should visit Relationships or not.  
wantGeometry boolean A flag that indicates whether element GeometryStreams are loaded or not.  
wantSystemSchemas boolean A flag that indicates whether system schemas should be exported or not.  
wantTemplateModels boolean A flag that indicates whether template models should be exported or not.  

Defined in

Last Updated: 30 November, 2023