@pilotdev/pilot-bim-dataprovider
v24.23.0
Published
The package for reading data from a information model data container.
Downloads
25
Maintainers
Readme
Installation
npm install @pilotdev/pilot-bim-dataprovider
Summary
This package contains tools for reading and writing data from information model data container (.bm files). This component is part of the Pilot Cloud service (https://pilotcloud.ascon.net/).
How to use
Initialize and read data from information model data container (.bm file).
import { BimDataBigIntMaxValue, BimDataProvider } from "@pilotdev/pilot-bim-dataprovider";
// Create new instance of BimModel
const bimDataProvider = new BimDataProvider();
// Initialize model.
// Method returns Promise<void>
await bimDataProvider.init();
// Read bm file and open it
// fileBuffer - Buffer of a .bm file
// uniqueId - must be unique identfier
const modelPart = await bimDataProvider.openModelPart("uniqueId", fileBuffer);
// Get all elements of the model-part
const elements = await modelPart.getAllElements();
// Get latest version of properties of the element
const properties = await modelPart.getElementProperties(elements[5].guid, BimDataBigIntMaxValue);
// Get all tessellations
const tesselations = await modelPart.getAllTessellations();
// Close model part after end
await modelPart.close();
// Dispose BimModel after all
await bimDataProvider.dispose();