@pilotdev/pilot-bim-dataprovider
TypeScript icon, indicating that this package has built-in type declarations

24.23.0 • Public • Published

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();

Package Sidebar

Install

npm i @pilotdev/pilot-bim-dataprovider

Weekly Downloads

5

Version

24.23.0

License

MIT

Unpacked Size

7.54 MB

Total Files

79

Last publish

Collaborators

  • pilotdev