The xeokit SDK uses the BCF format to exchange bookmarks of Viewer state with other
BIM software. BCF (Building Collaboration Format) is an open file format that enables data exchange and collaboration on 3D models and building
information. A BCF viewpoint is a snapshot of a specific issue related to a building project, containing information such as the
problem description, location, and proposed solutions. It is used to facilitate communication and collaboration among
project stakeholders in BIM workflows.
In this example we'll set up a xeokit Viewer in a web browser, load a BIM model into it, and then demonstrate how we
can save and load bookmarks of our Viewer state as BCF viewpoints, using the model.
On the DataModel.onBuilt event, we'll customize the View by arranging the @xeokit/viewer!Camera and applying
an X-ray effect tp a couple of objects, then we'll use @xeokit/bcf!saveBCFViewpoint to save the state of the View to
a BCF viewpoint.
Once the SceneModel and DataModel have been built, we can no longer add anything to them.
As before, let's create a Viewer with a View and a SceneModel.
This time, we'll add two ViewLayers to our View, and we'll associate our SceneModel with one of those
ViewLayers. ViewLayers allow us to partition our ViewObjects into bins, so that we can conveniently focus certain operations (eg. import/export
BCF) only on the relevant ViewObjects.
xeokit BCF Viewpoint Importer and Exporter
Interoperate with other BIM software through the exchange of BCF viewpoints
The xeokit SDK uses the BCF format to exchange bookmarks of Viewer state with other BIM software. BCF (Building Collaboration Format) is an open file format that enables data exchange and collaboration on 3D models and building information. A BCF viewpoint is a snapshot of a specific issue related to a building project, containing information such as the problem description, location, and proposed solutions. It is used to facilitate communication and collaboration among project stakeholders in BIM workflows.
To import a JSON-encoded BCF viewpoint into a View belonging to a Viewer, use the @xeokit/bcf!loadBCFViewpoint function. Similarly, to export the state of a View as a JSON-encoded BCF viewpoint, use the @xeokit/bcf!saveBCFViewpoint function.
Refer to @xeokit/bcf!BCFViewpoint for information on the BCF viewpoint format.
Installation
Usage
Saving and Loading a View as BCF
In this example we'll set up a xeokit Viewer in a web browser, load a BIM model into it, and then demonstrate how we can save and load bookmarks of our Viewer state as BCF viewpoints, using the model.
We'll start with these steps:
When our DTX has loaded, that call to SceneModel.build will finalize our SceneModel and cause it to immediately appear in the View's canvas.
That call will also trigger SceneModel.onBuilt and DataModel.onBuilt events.
On the DataModel.onBuilt event, we'll customize the View by arranging the @xeokit/viewer!Camera and applying an X-ray effect tp a couple of objects, then we'll use @xeokit/bcf!saveBCFViewpoint to save the state of the View to a BCF viewpoint.
Once the SceneModel and DataModel have been built, we can no longer add anything to them.
Now that we've saved the @xeokit/bcf!BCFViewpoint, we could now use @xeokit/bcf!loadBCFViewpoint to load the @xeokit/bcf!BCFViewpoint back into the View:
Saving and Loading a ViewLayer as BCF
As before, let's create a Viewer with a View and a SceneModel.
This time, we'll add two ViewLayers to our View, and we'll associate our SceneModel with one of those ViewLayers. ViewLayers allow us to partition our ViewObjects into bins, so that we can conveniently focus certain operations (eg. import/export BCF) only on the relevant ViewObjects.
Now we can use @xeokit/bcf!saveBCFViewpoint to save the states of only the ViewObjects in the ViewLayer that contains our SceneModel to a @xeokit/bcf!BCFViewpoint, while ignoring the other ViewLayer:
Use @xeokit/bcf!loadBCFViewpoint to load the @xeokit/bcf!BCFViewpoint back into the ViewLayer: