Skip to content

Native plugins

The BIMDataViewer is shipped with native plugins that allow basic interaction with ifcs/models. To enable/disable/configure them, use their name with the corresponding configuration on the plugins section of the makeBIMDataViewer configuration object.

Example:

javascript
const viewer = makeBIMDataViewer({
  plugins: {
    viewer3d: {
      navCube: false,
    },
    split: true,
    "structure-properties": {
      merge: true,
    },
  },
});

Some plugins have an instance API that can be used to interact with them:

Example:

javascript
$viewer.globalContext
  .plugins.get("structure-properties")
  .forEach(plugin => plugin.reloadTrees());

BCF

  • name: bcf

The BCF plugin allows to interact with the BIMData BCF API by opening the BCF Manager plugin. This is a button plugin that can be added to any viewer window.

Note

In order to use BCF features you have to enable the BCF Manager plugin (enabled by default).
The BCF plugin will be useless if BCF Manager is not enabled.

Configuration

NameTypeDescription
topicGuidstringguid of the topic that will be opened automatically when the plugin is mounted

Drawing Tools

  • name: drawing-tools

The Drawing Tools plugin allows to enrich plans from the viewer plan with drawings. Drawings can be predefined shapes like lines, arrows, circles or rectangles, free hand drawings or texts. Except for texts, the line width and the color can be customized for each drawing. Once created, the drawings are stored on the BIMData API. It is possible to move or delete drawings using the corresponding tools (pointer / eraser). It is also possible to edit the text drawing by clicking on them while the text tool is active. Once the input is active, the font size and the text content can be changed.

The Drawing Tools plugin is disabled by default. To enable it, add the following entry into the plugins property object of the makeBIMDataViewer function:

js
const viewer = makeBIMDataViewer({
  plugins: {
    "drawing-tools": true,
  },
});

BCF Manager

  • name: bcfManager

The BCF Manager plugin is a window plugin that provides a complete UI to view/create/update/delete BCF topics in the current project.

Fullscreen

  • name: fullscreen

A plugin as button that allows to request fullscreen on the window it lays in.

Projection

  • name: projection

A plugin as button that sends projection type information on the localContext.hub when user change it through the UI. It requires the viewer3d plugin.

  • name: search

A plugin as button that allows to search object by uuids or names.

Section

  • name: section

A plugin as button that allows to create section planes in the viewer3d plugin. As mentionned, it requires the viewer3d plugin to work properly.

Split

  • name: split

Disabled by default, the split plugin add the ability to split the ifc according to the selection, through a command on the context menu.

Structure

  • name: structure

The structure plugin displays the tree structures of the IFCs.

Instance API

NameDescription
reload(): voidReload the trees of the loaded IFCs.

Structure and properties

  • name: structure-properties

This plugin is actually two plugins merged together. The structure plugin that displays the tree structures of the IFCs. The properties plugin that displays the properties of the selected objects.

Configuration

NameTypeDescription
mergebooleanDefault to false. Add the merge ifcs option on the structure.
exportbooleanDefault to false. Add the export ifcs option on the structure.
editPropertiesbooleanDefault to false. Allows editing properties.
translateIfcEntitiesbooleanDefault to false. Enable IFC Entites translation.
customTranslationsObjectProvide custom translations for IFC types (see example below).

Here is an example usage of the customTranslations configuration:

js
const customTranslations = {
  fr: {
    IfcBeam: "Poutre",
    IfcDoor: "Porte",
    IfcSlab: "Dalle",
    IfcSpace: "Pièce / Espace",
    IfcWall: "Mur / Paroi",
    IfcWindow: "Fenêtre / Ouverture",
    // etc...
  },
  en: {
    IfcBeam: "Beam",
    IfcDoor: "Custom Door name",
    IfcSlab: "Slab",
    IfcSpace: "Space",
    IfcWall: "Wall",
    IfcWindow: "Window",
    // etc...
  },
};

const viewer = makeBIMDataViewer({
  // ...
  plugins: {
    "structure-properties": {
      translateIfcEntities: true, // has to be true to display translations
      customTranslations,
    }
  }
});

Instance API

NameDescription
reloadTrees(): voidReload the trees of the loaded IFCs.

Window Manager

  • name: window-manager

This plugin is in two parts. The first part is displayed if there is only one window without header. It is displayed as a button on the top-right of the window, and add the possibility to split the current window by half, and add the new window where the user want (top, bottom, right or left). The second part is on the right side of the header, and allows to enable split and shows window option.

Viewer 3D (IFC)

  • name: viewer3d

This plugin allows to view 3D representation of IFC models. This is a viewer plugin.

Configuration

NameTypeDescription
pivotMarkerbooleanDefault to true. Add a pivot marker of the rotation center when pivoting
navCubebooleanDefault to true. Add the navCube to facilitate the 3D navigation
edgesbooleanDefault to true. Add model edges
enableOffsetsbooleanDefault to false. Allow model objects to be translated. This increase GPU memory usage
enableDynamicLODbooleanDefault to true. If FPS are too low, complex objects will be hidden during camera moves. This allow a better navigation on low-end computers or with very big models. This decrease GPU memory usage
homebooleanDefault to true. Reinitialize point of view and reset all objects state (visibility, x-ray)
navigationVersionsModelbooleanDefault to true. Allows navigation between various version of models
interactiveSpacesbooleanDefault to false. Allow interaction with IfcSpaces
scaleCanvasResolutionbooleanDefault to true. Scale down the canvas resolution when the camera is moving.
defaultScaleCanvasResolutionFactornumberDefault to 0.8. Default canvas resolution scale factor. Value between 0 and 1. Lower values increase performance but decrease quality.
performanceModeScaleCanvasResolutionFactornumberDefault to 0.5. Scale down the canvas resolution when the performance mode is activated. Value between 0 and 1. Lower values increase performance but decrease quality.

Events

NamePayloadDescriptionEmitted on
3d-model-loading{ ifc, plugin }Emitted when a 3D model is loading.localContext and globalContext
3d-model-loaded{ model, plugin }Emitted when a 3D model is loaded.localContext and globalContext
3d-model-unloaded{ model, plugin }Emitted when a 3D model is unloaded.localContext and globalContext
annotation-create{ id, annotation }Emitted when an annotation marker is created.localContext and globalContext
annotation-click{ id, annotation }Emitted when an annotation marker is clicked.localContext and globalContext
annotation-delete{ id }Emitted when an annotation marker is deleted.localContext and globalContext
annotation-clearNo payloadEmitted when annotation marker are cleared.localContext and globalContext
3d-camera-update{ eye: number[], look: number[], up: number[] }Emitted when the camera is updatedglobalContext

Instance API

This API is available in a 3d window:

javascript
const viewer3dPlugin = this.$viewer.localContext.plugins.get("viewer3d");
NameDescription
xeokitThe Xeokit viewer
xeokitSdkThe Xeokit SDK
selectOnClick: booleanDefault to true. If true, clicking an object select it.
highlightOnHover: booleanDefault to true. If true, hovering an object highlight it.
getProjection(): stringReturn current projection
changeProjection(projection: string): voidSet current projection
isolateObjects(ids: string[], options: object): voidObjects with ids not included in ids are set to xrayed = true & pickable = false.
isolateObjectsByUuids(uuids: string[], options: object): voidThe same as isolateObjects but with uuids instead of ids.
reintegrateObjects(): voidUnisolate objects (opposite action of isolateObjects).
setObjectsVisible(ids: string[], visible: boolean)Update the visible property of the corresponding objects.
setObjectsSelected(ids: string[], selected: boolean)Update the selected property of the corresponding objects.
setObjectsColorized(ids: string[], color: boolean)Update the colorized property of the corresponding objects.
setObjectsHighlighted(ids: string[], highlighted: boolean)Update the highlighted property of the corresponding objects.
setObjectsPickable(ids: string[], pickable: boolean)Update the pickable property of the corresponding objects.
setObjectsXrayed(ids: string[], xrayed: boolean)Update the xrayed property of the corresponding objects.
setObjectsOpacity(ids: string[], opacity: boolean)Update the opacity property of the corresponding objects.
setObjectsCulled(ids: string[], culled: boolean)Update the culled property of the corresponding objects.
setInteractiveSpaces(interact: boolean)Makes IfcSpace objects pickable.
setCameraOnTop(uuids: string[]): voidSet the camera on top of the given objects, looking at their center.
getObjectsCenter(uuids: string[]): number[]Return the world coordinates of the center of the given objects.

Viewer 2D (IFC)

  • name: viewer2d

This plugin allows 2D representation of an IFC. This is a viewer plugin.

Configuration

NameTypeDescription
compassbooleanWhether to display compass or not. Defaults to true.
helpbooleanWhether to display help button or not. Defaults to true.
modelLoaderstringSee viewers config. Possible values: "hidden", "disabled", allows to control models loader display. By default model loader is displayed and enabled.
storeySelectorbooleanWhether to display storey selector or not. Defaults to true.
storeySelectorAutoOpenbooleanWhether storey selector should auto open on model loading or not. Defaults to true.

Events

NamePayloadDescriptionEmitted on
2d-model-loaded{ model, plugin }Emitted when a 2D model is loaded.localContext and globalContext
2d-model-unloaded{ model, plugin }Emitted when a 2D model is unloaded.localContext and globalContext

Instance API

This API is available in a 2d window:

javascript
const viewer2dPlugin = this.$viewer.localContext.plugins.get("viewer2d");
NameDescription
viewer: E2D.ViewerThe engine 2D viewer.
selectOnClick: booleanDefault to true. If true, clicking an object select it.
highlightOnHover: booleanDefault to true. If true, hovering an object highlight it.
spacesVisible: booleanDefault to true. If true, the space names are displayed.
doorsDisplayed: booleanDefault to false. If true, the doors are displayed.
compassDisplayed: booleanDefault to true. If true, the compass is displayed.
camera3DSynchronization: booleanDefault to false. If true, the camera follows the rotation of a 3D camera and an icon representing the 3D camera position is displayed.
syncRotationFrom3DCamera(eye: number[], look: number[], up: number[]): voidDefault arguments are eye = [0, 0, 0], look = [0, 0, 0],up = [0, 1, 0]. Synchronize the rotation between the given 3D camera parameters and the 2D camera.

Viewer DWG

  • name: dwg

This plugin allows to view DWG models. This is a viewer plugin.

Events

NamePayloadDescriptionEmitted on
dwg-model-loaded{ model, plugin }Emitted when a DWG model is loaded.localContext and globalContext
dwg-model-unloaded{ model, plugin }Emitted when a DWG model is unloaded.localContext and globalContext

Instance API

This API is available in a dwg window:

javascript
const viewerDWGPlugin = this.$viewer.localContext.plugins.get("dwg");
NameDescription
viewer: E2D.ViewerThe engine 2D viewer.
selectOnClick: booleanDefault to true. If true, clicking an object select it.
highlightOnHover: booleanDefault to true. If true, hovering an object highlight it.
hideAll(): voidHide all objects.

Viewer DXF

  • name: dxf

This plugin allows to view DXF models. This is a viewer plugin.

Events and Instance API are the same as the Viewer DWG.

Viewer Plan

  • name: plan

This plugin allows to view bitmap plans (PDF, PNG, JPG, METABUILDING models). This is a viewer plugin.

Configuration

NameTypeDescription
helpbooleanWhether to display help button or not. Defaults to true.
modelLoaderstringSee viewers config. Possible values: "hidden", "disabled", allows to control models loader display. By default model loader is displayed and enabled.
metaBuildingStructurebooleanWether to display meta-building structure panel when a meta-building is loaded. If set to false a storey selector will be used instead. Defaults to true.
storeySelectorbooleanWhether to display storey selector or not. Defaults to true.
storeySelectorAutoOpenbooleanWhether storey selector should auto open on model loading or not. Defaults to true.

Events

NamePayloadDescriptionEmitted on
plan-model-loaded{ model, plugin }Emitted when a plan model is loaded.localContext and globalContext
plan-model-unloaded{ model, plugin }Emitted when a plan model is unloaded.localContext and globalContext
pdf-page-changed{ model, page }Emitted when a pdf page is changed.localContext only
storey-loaded{ storey }Emitted when a storey is fully loaded.localContext and globalContext

Instance API

This API is available in a plan window:

javascript
const viewerPlanPlugin = this.$viewer.localContext.plugins.get("plan");
NameDescription
viewer: E2D.ViewerThe engine 2D viewer.
selectedStorey: StoreyCurrently selected (displayed) storey (null if not a METABUILDING model)
bitmaps: any[]Array of loaded bitmaps
pdfPages: any[]Array of pages models (for multipage PDF)
pdfPageIndex: numberCurrent PDF page index (for multipage PDF)
nextPdfPage(): Promise<void>(async) Switch to the next PDF page (if any)
prevPdfPage(): Promise<void>(async) Switch to the previouos PDF page (if any)
setPdfPage(index: number): Promise<void>(async) Go to the specified PDF page (if it exist). Note: pages are indexed from 0 to n-1.
exportAsPNG(): Promise<string>(async) Get a base64 URL of PNG screenshot of the viewer
exportAsJPG(): Promise<string>(async) Get a base64 URL of JPG screenshot of the viewer
exportAsPDF(): Promise<Blob>(async) Generate and return a PDF with the viewer content

Viewer Point Cloud

  • name: pointCloud

This plugin allows to view point cloud models. This is a viewer plugin.

Events

NamePayloadDescriptionEmitted on
pointcloud-model-loaded{ model, plugin }Emitted when a model is loaded.localContext and globalContext
pointcloud-model-unloaded{ model, plugin }Emitted when a model is unloaded.localContext and globalContext

Instance API

This API is available in a pointCloud window:

javascript
const pointCloudPlugin = this.$viewer.localContext.plugins.get("pointCloud");
NameDescription
xeokitThe Xeokit viewer
xeokitSdkThe Xeokit SDK

3D parameters

  • name: viewer3d-parameters

A button plugin that allows to configure highlight, edges and spaces visibility. Parameters are saved in local storage.

2D parameters

  • name: viewer2d-parameters

A button plugin that allows to configure door openings and space names. Parameters are saved in local storage.

2D measurements

  • name: measure2d

A button plugin that allows to measure distances, angles and surfaces in the 2D viewer Measurements are saved in local storage.

Zone Editor Button

  • name: zone-editor-button

This plugin opens the Zone Editor plugin.

Zone Editor

  • name: zone-editor

The Zone Editor plugin is a window plugin that provides a complete UI to manage zones on a Meta Building.

Events

NamePayloadDescriptionEmitted on
zone-created{ zone }Emitted when a zone is created.localContext and globalContext
space-created{ space }Emitted when a space is created.localContext and globalContext
zone-deleted{ zone }Emitted when a zone is deleted.localContext and globalContext
space-deleted{ space }Emitted when a space is deleted.localContext and globalContext
zone-updated{ zone, changes }Emitted when a zone is updated.localContext and globalContext
space-updated{ space, changes }Emitted when a space is updated.localContext and globalContext