BimApi
Hierarchy
- BimCoreApi
- BimApi
Index
Constructors
Properties
Accessors
Methods
Constructors
publicconstructor
Constructor.
Parameters
canvas: HTMLCanvasElement
Canvas element where 3D content will be rendered.
_apiClient: TwinfinityApiClient
optionalbimApiOptions: Object
Returns BimApi
Properties
publicreadonlycamera
Camera is an instance of BimCamera and used for manipulating the 3D camera view of the BIM viewer.
publicreadonlyviewer
Exposes 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:
- BabylonJS APIs will remain backwards compatible. Therefore, your application may break when BabylonJS is updated to a new version.
- Babylonjs data that BimCoreApi creates, such as scene hierarchy, lights, camera etc., will remain backwards compatible between versions. Relying on this may break your application.
- Your modifications to BabylonJS data (such as scene hierarchy, lights, cameras etc.) will not be changed by code in this package.
- Other bugs will not occur as a result of direct usage of BabylonJS APIs. https://doc.babylonjs.com/api/classes/babylon.scene
publicstaticrunRenderLoopbeta
Extension 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.
Accessors
publicaxes
Gets or sets a value indicating whether to hide or show coordinate system axes.
Returns boolean
Parameters
isEnabled: boolean
Returns void
publicbackend
Direct access to the methods for communicating the backend.
Returns TwinfinityApiClient
publiccurrentContainerInfo
Gives information on currently selected container such as title, language and also details of the current user.
Returns BimContainerInfo
publicgrid
Gets or sets options for 3D help grid visualization.
Returns GridOptions
publicisSkyboxEnabled
Gets or sets a value indicating whether to show or hide skybox.
Returns boolean
Parameters
enabled: boolean
Returns void
publiconPointerObservable
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).
Returns Observable<DeepImmutableObject<PointerInfoWithTimings>>
publicselectables
Exposes methods related to selection operations. For example, what the user actually clicked on.
Returns Selectables
Methods
publicapplyVisualChanges
Returns Promise<void>
publicclear
Clears api (any loaded IFC files etc are unloaded).
Returns void
publiccreateCoordinateTracker
Gets a CoordinateTracker instance.
Type parameters
- Tracked3D: Vertex3 = any
Returns CoordinateTracker<Tracked3D>
publicfilter
Iterate the BimIfcObject instances and return those that match the specified predicate.
Parameters
predicate: BimIfcObjectForEachPredicate
Predicate. Items matching this will be returned in array format.
Returns BimIfcObject[]
Array with BimIfcObject instances matched by the specified predicate.
publicforeach
Use this function to iterate over all BIM objects.
Parameters
Returns void
publicgetIntersections
Intersects all visible BIM objects using ray from origin towards direction
Parameters
origin: Vector3
direction: Vector3
objects: BimIfcObject[] = []
Returns undefined | Intersection[]
Intersection[] | undefined
publicinfo
General Twinfinity information such as customer portal name, Twinfinity API version etc.
Returns TwinfinityInfo
publicloadPropertySets
Loads all BIM property sets for all loaded files.
Returns Promise<void>
publicon
Sets a handler to event of given type
Parameters
type: click
Type of event. For now only “click” is supported
clickEventHandler: ClickEventHandler
Returns void
publicproducts
Create a iterator that can be used to iterate over all BimIfcObject‘s. Same as foreach but with a iterator instead.
Returns IterableIterator<BimIfcObject>
Iterator that can be used to iterate over all BimIfcObject‘s.
publicsetBackgroundColor
Sets background color in viewer
Parameters
color: Color3 | Color
RGB in range 0-1
Returns void
publicsetContainer
Parameters
containerOrUrl: URL | BimContainer
Container object or absolute URL Example: https://bim.foo.com/sites/portal/projects/{project name}
optionaloptions: BimApiLoadOptions
Loading options
Returns Promise<void>
publicsetHighlightColor
Sets highlight color in viewer
Parameters
color: Color3
RGB in range 0-1
highlightIndex: ColoredHighlightIndexes
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
Returns void
publicwithVisibleBimObjects
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
Type parameters
- T
Parameters
visibleBimObjects: BimIfcObject[]
Visible objects to run operation on
action: (objects: BimIfcObject[]) => T
Operation
Returns T
publiczoomToExtent
This function zooms the camera to contain BIM objects in view frustum.
Parameters
products: BimIfcObject[]
Returns void
publicstaticcreate
Parameters
_htmlElementOrId: string | HTMLElement
absoluteContainerUrlOrApiClient: string | URL | TwinfinityApiClient
Absolute URL to the container.
optionaloptions: Object
Creation options.
Returns Promise<BimApi>
publicstaticcreateApi
Type parameters
- TBimApi: BimCoreApi<TBimApi>
Parameters
_htmlElementOrId: string | HTMLElement
apiFactory: (canvas: HTMLCanvasElement) => TBimApi
Returns Promise<TBimApi>
BimApi is the main API class. This a subclass of BimCoreApi that is extended with information only available from the Twinfinity API backend.