Xbim web viewer

99 views Asked by At

i follow the steps in this page

https://docs.xbim.net/examples/hello-building.html

https://docs.xbim.net/XbimWebUI/

I install the npm package

npm install @xbim/viewer

And the package installed in:

C:\Users\mypc\AppData\Roaming\npm\node_modules\@xbim\viewer

enter image description here

Then i don't know how to get xbim-viewer.js mentioned in the script, and the official website don't show any details about that

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>Hello building!</title>
    <script src="../js/xbim-viewer.js"></script>
</head>
<body>
    <canvas id="viewer" width="500" height="300"></canvas>
    <script type="text/javascript">
        var viewer = new Viewer('viewer');
        viewer.on('loaded', () => {
            viewer.show(ViewType.DEFAULT);
        });
        viewer.load('../data/SampleHouse.wexbim');
        viewer.start();
    </script>
</body>
</html>

Are there a steps needed to create xbim-viewer.js?

1

There are 1 answers

0
F. Robb On

I don't think the examples have been updated for the new version of xBim. However, I was able to get the example code to work by retrieving the xbim-viewer.js file and inspecting the 'live example' code.(https://docs.xbim.net/examples/1_Hello_building.live.html).

I'd be interested to know how to get the viewer working from npm.