Reference Source
public class | source

CxConverterIFCLoaderPlugin

Extends:

Plugin → CxConverterIFCLoaderPlugin

Viewer plugin that uses CxConverter to load BIM models directly from IFC files, using its WebAssembly buid from npm package.

Overview

The WebAssembly build of CxConverter is still in alfa stage, so it may not work as expected. This documentation will be updated as the library and the plugin evolve. The example below shows how to use the plugin:

import { CxConverterIFCLoaderPlugin, Viewer } from "../../dist/xeokit-sdk.es.js";
const cxConverterIFCLoaderPlugin = new CxConverterIFCLoaderPlugin(viewer);

const sceneModel = await cxConverterIFCLoaderPlugin.load({
       src: "../../assets/models/ifc/Duplex.ifc"
}); 

See the code in action here.

Constructor Summary

Public Constructor
public

constructor(viewer: Viewer, cfg: Object)

Member Summary

Public Members
public

The GLTFLoaderPlugin used internally to load the converted GLTF.

Method Summary

Public Methods
public

async load(params: Object): Promise<SceneModel>

Loads an IFC model from the given source.

Inherited Summary

From class Plugin
public

ID for this Plugin, unique within its Viewer.

public

viewer: Viewer

The Viewer that contains this Plugin.

public

Destroys this Plugin and removes it from its Viewer.

public

error(msg: String)

Logs an error message to the JavaScript developer console, prefixed with the ID of this Plugin.

public

fire(event: String, value: Object, forget: Boolean)

Fires an event on this Plugin.

public

Returns true if there are any subscribers to the given event on this Plugin.

public

log(msg: String)

Logs a message to the JavaScript developer console, prefixed with the ID of this Plugin.

public

off(subId: String)

Cancels an event subscription that was previously made with Plugin#on or Plugin#once.

public

on(event: String, callback: Function, scope: Object): String

Subscribes to an event on this Plugin.

public

once(event: String, callback: Function, scope: Object)

Subscribes to the next occurrence of the given event, then un-subscribes as soon as the event is subIdd.

public

scheduleTask(task: *)

Schedule a task to perform on the next browser interval

public

warn(msg: String)

Logs a warning message to the JavaScript developer console, prefixed with the ID of this Plugin.

Public Constructors

public constructor(viewer: Viewer, cfg: Object) source

Creates this Plugin and installs it into the given Viewer.

Override:

Plugin#constructor

Params:

NameTypeAttributeDescription
viewer Viewer

The Viewer.

cfg Object
  • optional
  • default: {}

Plugin configuration.

Public Members

public gltfLoader: GLTFLoaderPlugin source

The GLTFLoaderPlugin used internally to load the converted GLTF.

Public Methods

public async load(params: Object): Promise<SceneModel> source

Loads an IFC model from the given source.

Params:

NameTypeAttributeDescription
params Object
  • optional
  • default: {}

Loading parameters.

params.src string

Path to an IFC file.

params.progressCallback Function
  • optional

Callback to track loading progress.

params.progressTextCallback Function
  • optional

Callback to track loading progress with text updates.

Return:

Promise<SceneModel>

A promise that resolves to the loaded SceneModel.