import * as path from "path" ; import { IModelHost } from "@itwin/core-backend" ; import { ImportIMJS } from "./ImportIMJS" ; IModelHost . startup ( ) . then ( async ( ) => { console . log ( "start .." ) ; for ( const directoryTail of [ "TaggedGeometryData" , ] ) { console . log ( `input from${ directoryTail }` ) ; const importer = ImportIMJS . create ( path . join ( "d:" , "bfiles" , "importIMJS" , `${ directoryTail }.bim` ) , "testSubject" ) ; if ( ! importer ) { console . log ( "Failed to create bim file" ) ; } else { const modelGroups = importer . importFilesFromDirectory ( path . join ( ".." , ".." , "core" , "geometry" , "src" , "test" , "output" , directoryTail ) ) ; let numModel = 0 ; for ( const group of modelGroups ) { numModel += group . modelNames . length ; } console . log ( { directoryName : directoryTail , models : numModel } ) ; for ( const group of modelGroups ) { if ( group . modelNames . length > 0 ) { console . log ( { groupName : group . groupName , numModel : group . modelNames . length , range : Math . floor ( 0.999999 + group . range . maxAbs ( ) ) } ) ; } } } } await IModelHost . shutdown ( ) ; console . log ( "goodbye" ) ; } ) . catch ( ( ) => { } ) ;