Infohub JS API
Loading...
Searching...
No Matches
BcfViewpointResource Class Reference

Description

Represents one viewpoint-scoped BCF API resource.

const viewpoint = topic.viewpoint(viewpointId);
await viewpoint.get();
const snapshot = await viewpoint.snapshot.get();
get snapshot()
Gets the viewpoint's snapshot (preview image).
Definition BcfServices.js:775

Public Member Functions

 bitmap (bitmapId)
get coloring ()
 delete ()
 get ()
get selection ()
get snapshot ()
get visibility ()

Function Documentation

◆ bitmap()

bitmap ( bitmapId)

Selects a bitmap in this viewpoint.

Parameters
{string}bitmapId - BCF bitmap identifier.
Returns
{BcfReadableResource} A readable resource.
// Output of bitmap(bitmapId).get(): raw binary image (application/octet-stream).

◆ coloring()

get coloring ( )

Gets the component coloring of this viewpoint.

Returns
{BcfReadableResource} A readable resource.
// Output of coloring.get():
{
"coloring": [{
"color": "#ff0000",
"components": [{ "ifc_guid": "2MF28NhmDBiRVyFakgdbCT" }, { "ifc_guid": "3$cshxZO9AJBebsni$z9Yk" }]
}]
}

◆ delete()

delete ( )
Returns
{Promise<ApiResponse>} Status only, no payload.
// No request body. Output: HTTP 200, no payload.

◆ get()

get ( )
Returns
{Promise<ApiResponse>} The response containing the viewpoint.
// Output:
{
"guid": "a11a82e7-e66c-34b4-ada1-5846abf39133",
"index": 10,
"perspective_camera": {
"camera_view_point": { "x": 0.0, "y": 0.0, "z": 0.0 },
"camera_direction": { "x": 1.0, "y": 1.0, "z": 2.0 },
"camera_up_vector": { "x": 0.0, "y": 0.0, "z": 1.0 },
"field_of_view": 90.0,
"aspect_ratio": 1.33
},
"snapshot": { "snapshot_type": "png" }
}

◆ selection()

get selection ( )

Gets the components selected in this viewpoint.

Returns
{BcfReadableResource} A readable resource.
// Output of selection.get():
{
"selection": [
{ "ifc_guid": "2MF28NhmDBiRVyFakgdbCT", "originating_system": "Example CAD Application" },
{ "ifc_guid": "3$cshxZO9AJBebsni$z9Yk" }
]
}

◆ snapshot()

get snapshot ( )

Gets the viewpoint's snapshot (preview image).

Never part of the viewpoint JSON - only snapshot_type is announced there, the bytes come from this dedicated endpoint.

Returns
{BcfReadableResource} A readable resource.
// Output of snapshot.get(): raw binary image (application/octet-stream).

◆ visibility()

get visibility ( )

Gets the component visibility of this viewpoint.

Returns
{BcfReadableResource} A readable resource.
// Output of visibility.get():
{
"visibility": {
"default_visibility": true,
"exceptions": [{ "ifc_guid": "2MF28NhmDBiRVyFakgdbCT" }],
"view_setup_hints": { "spaces_visible": true, "space_boundaries_visible": false, "openings_visible": true }
}
}