Bcf-js is a BIM Collaboration Format (BCF) reader & parser.
This fork was made to read and write both BCF 2.1 and 3.0 versions.
Find it on npmjs.com https://www.npmjs.com/package/@parametricos/bcf-js
To install the library use:
npm install @parametricos/bcf-js
or yarn add @parametricos/bcf-js
For BCF-XML 3.0:
import { BcfParser } from '@parametricos/bcf-js';
For BCF-XML 2.1:
import { BcfParser } from '@parametricos/bcf-js/2.1';
const file = "some_bcf_file.bcf"
const parser = new BcfParser();
await parser.read(file);
const project = parser.project
project.markups.forEach((markup) => {
console.log(markup.topic);
})
// See ./test/BasicReadExample.js for more examples
const bcfProject: IProject = {
...
}
const savePath = "./test-data/bcf3.0/Writer/WriteTest.bcf"
const parser = new BcfParser();
const content = await parser.write(bcfproject)
fs.writeFile(savePath, content, (err) => {})
// See ./test/BasicWriteExample.js for more examples
There's a few ways to contribute to this project and improve it:
- Fork the project repository and make your first pull request
- Submit sample BCF and it's linked IFC files in the 'test' folder
- Test it and create Issues so that we can start working on them
BCF-js is licensed under the Mozilla Public License 2.0. Please read the LICENSE file in this repository for more details.