Skip to content

The Viewer

This is a an illustation of the use of the CRUD REST APIs to access the data and in this specific case, get the IFC file of a SpatialZone and display it with the ThatOpen IFC Viewer.

D4SU is a backend server and this features is only for illustration purpose and based on a basic mustache template with an iframe for the That Open viewer.

The service is available at

/pages/thatopen-viewer

Viewer Page

The page has a basic layout.

It lets:

(1) Enter the id of a bundle (e.g. 158) and activate the Get SpatialZones button

(2) This triggers the call of /common/bundle/158/bundle-unit-list/?unit_type=IfcProject,IfcSpatialZone which comes with the list of the SpatialZones for the bundle and with the initial IFC file associated with the IfcProject. The name of the Project in the IFC is '0001' and we have not changed it.

Viewer Page

(3) The user can select the apartment Duplex-Aand activate the Get IFC button.

Viewer Page

(4) This triggers the call of common/bundle/158/unit/53d4ba7a-5f23-412a-96db-0735b79bcfe8 which comes back with the detail of the IfcSpatialZone for the apartment Duplex-A, with the path of the IFC file in the unitjson field. This is passed to the viewer so that the viewer can get and and display the IFC file

Viewer Page

(5) Then, the user can select an object (here a wall) and get the details of the object in the right panel.

Viewer Page

(6) The viewer can select the second duplex

Viewer Page

(7) The user can also select the project (named '0001') and display the original IFC file

Viewer Page

The IFC file displayed is the source file which is an IFC2X3 file and the viewer use its own color palette and also shows the spaces.

(8) If instead, we extract the IfcJSON from the database and convert it to an IFC4, the colors will be those defined in the (original) IFC files.

Viewer Page

This version of the Viewer can display the IFC file of the extract of the SpatialZone but does not handle the IfcRelReferencedInSpatialStructure relationship. This is also the case with the other viewers: the relation of the IfcSpaces and the IfcSpatialZone is not exposed. But that could be developed.

Note: this version of the viewer does not display all IFCs properly.