Constructor.
Canvas element where 3D content will be rendered.
Methods for communicating with the backend.
OptionalbimApiOptions: BimApiOptionsReadonlycameraCamera is an instance of BimCamera and used for manipulating the 3D camera view of the BIM viewer.
ReadonlyviewerExposes viewer internals. Use this to access BabylonJS API. Disclaimer! Accessing BabylonJS internals is considered advanced usage and you are effectively bypassing BimCoreApi (and subclasses). We cannot make guarantees that:
Static BetarunExtension point for applications that need to run the renderloop outside their own change handling (AngularJs is one such example). Assignment should be done before creation of a BimCoreApi instance.
Gets or sets a value indicating whether to hide or show coordinate system axes.
Direct access to the methods for communicating the backend.
Gives information on currently selected container such as title, language and also details of the current user.
Gets or sets options for 3D help grid visualization.
Gets or sets a value indicating whether to show or hide skybox.
Subscribe to get access to pointer events (mouse, touchpad etc) and to determine what (if anything) a mouse click interacted with (what object was 'picked' in the 3D scene).
Exposes methods related to selection operations. For example, what the user actually clicked on.
Updates the viewer with the latest visual changes on BIM objects. See foreach for an example.
Clears api (any loaded IFC files etc are unloaded).
Gets a CoordinateTracker instance.
ProtecteddisposeDisposes the API and releases all resources including WASM memory and Babylon.js resources. After calling this method, the API instance should not be used.
Iterate the BimIfcObject instances and return those that match the specified predicate.
Predicate. Items matching this will be returned in array format.
Array with BimIfcObject instances matched by the specified predicate.
Use this function to iterate over all BIM objects.
This is a lambda function to evaluate on each BimIfcObject.
Intersects all visible BIM objects using ray from origin towards direction
Vector3
Vector3
BimIfcObject[]
Intersection[] | undefined
// GetIntersections makes a hit test on all visible BIM objects, from origin in direction and return first object intersection.
const intersections = this.api.getIntersections([0, 0, 0], [1, 1, 1]);
General Twinfinity information such as customer portal name, Twinfinity API version etc.
ProtectedinitializeLoads all BIM property sets for all loaded files.
Call BimIfcLoader.loadPropertySets on ifc instead.
Sets a handler to event of given type
Type of event. For now only "click" is supported
Function that gets called when the event occurs
Use onPointerObservable instead.
Create a iterator that can be used to iterate over all BimIfcObject's. Same as foreach but with a iterator instead.
Iterator that can be used to iterate over all BimIfcObject's.
Sets the container of the current BimApi instance.
Container object or absolute URL Example: https://bim.foo.com/sites/portal/projects/{project name}
Optionaloptions: BimApiLoadOptionsLoading options
Sets highlight color in viewer
RGB in range 0-1
The highlight index tgo change, it's restricted to One, Two and Three because it makes no sense to change the color of the Empty index (since it's only there to denote that a productMesh has no highlight). The highlight index defaults to One
Makes it possible to perform API operations, that operate on the set of visible BIM objects, on a smaller set of (still visible) BIM objects
Visible objects to run operation on
Operation
This function zooms the camera to contain BIM objects in view frustum.
Array of BIM objects.
StaticcreateCreates a new instance of BimApi.
ID of the HTML element where the viewer should be created.
Absolute URL to the container.
Optionaloptions: BimApiOptionsCreation options.
// Create an API instance.
const api = await BimApi.create('viewer', 'project-url'); // Open project directly.
const api = await BimApi.create('viewer', new BimTwinfinityApiClient(url)); // Create API. If a valid container url is given, the API automatically switches to it, otherwise calls api.setContainer() afterwards.
StaticcreateCreates a new instance of BimCoreApi or subclass of BimCoreApi.
ID of the HTML element where the viewer should be created.
Factory function to create the API instance.
BimApi is the main API class. This a subclass of BimCoreApi that is extended with information only available from the Twinfinity API backend.