Difficulty with xBim.SceneJSWebViewer sample


I have downloaded the various sample files and am trying to run the xBim.SceneJSWebViewer sample.

The code seems to fall over at the SendSharedMaterials method in ModelStreamer.cs. This block selects each material type from the .xbim file and then iterates through each returned type, appending various properties to an array of data.

It fails for me at data.AddRange(BitConverter.GetBytes(Convert.ToUInt16(m.Name.Length)));

as the Name field returned from the .xbim file is null.

Am I missing something?

Many thanks
Closed Oct 27, 2016 at 1:53 PM by martin1cerny
This project has been moved to GitHub. Please, raise an issue there if it is still a problem in the latest xBIM4. There is completely new WebGL implementation here.


andyward4p wrote Dec 18, 2013 at 11:05 AM

I believe LloydPickering is looking at this. The webGL sample app did get out of date with some of the core xbim geometry changes, but it got fixed up a few weeks back, so it should be something simple to correct.

Can you confirm which code branch or build you're using?

Is it a particular model file causing issues, or any?

There's a bit of work to do to the SceneJS implementation (notably upgrade to v3) - worth knowing this before going to far

andyward4p wrote Dec 18, 2013 at 11:06 AM

Assigned to Lloyd

edcorry wrote Dec 18, 2013 at 4:57 PM

Thanks Andy,
The version I am using is xBim 2.4.1. I downloaded it directly from the site as I had difficulty with the SVN download.

All the sample models are causing the same issue, in the SendSharedMaterials block, when the code tries to iterate through the material properties.

We would like to embed the xBim viewer in a .Net website, where we can browse through an IFC file. Any pointers on this would be great.


LloydPickering wrote Jan 22, 2014 at 3:45 PM

I have been looking at this, and bearing in mind the changes needed on the front end (new SceneJS version) as well as the backend geometry changes, I figured it was best to start from first principles.

I have therefore created a new sample project in Head called Xbim.WebXplorer which is now available for people to mess about with. It is pretty limited and will need some work to make it usable, but it at the least should show a way to access and display models in the browser.

Right now you need to alter the web.config key to point to a model folder, and it enumerates the .xbim files contained within.

For the future it could easily be modified to allow upload of Ifc, and on the fly conversion of Ifc files, but I figured it was better to focus on getting something up there.

Finally, the camera (in particular), functionality and performance are pretty limited - but it works.

  • Extend camera so it zooms to the model bounds rather than defaulting to 50m away from the origin.
  • Improve camera so that it is fairly usable
  • Allow federated models to be loaded (perf issues notwithstanding)
  • Test and Extend picking so it works correctly, and returns properties
  • Add a navigation tree
  • Allow pieces of geometry to be made visible/invisible
  • Address some of the fundamental performance issues

nitinp wrote Feb 17, 2014 at 12:19 PM

We are already using the XIBM JSViewer app for one of our integrations. This was recently identified by one of our customers. Can you please suggest the resolution to this issue?

SteveLockley wrote Feb 17, 2014 at 1:19 PM

We seem to have incurred some problems with this when we upgraded to VS 2010 and maybe 2012
Lloyd has started a new WebXplorer as an alternative, however, I have problems getting things to work with this also. Most of the problems relate to Microsoft code throwing culture and security exceptions. I am working on this now to see if I can track down what causes these issues

LloydPickering wrote Feb 19, 2014 at 5:14 PM

The main problem is that the SceneJS Webviewer is so far out of date with the way the xbim core IO stuff now works.

Steve and I are working on a way to RESTfully request data from a model, and that should make development and integration easier for others, but it's ultimately going to mean changes in your integration.

If you absolutely have to get this working with the old SceneJS Webviewer, I would suggest wrapping an if statement around the problem code such as:

m.Name = String.Empty;

That should solve the immediate problem as m.Name.Length will give the correct result of 0 length, and avoid the crash.

afro56 wrote Oct 4, 2015 at 12:28 PM

I am unable to run the xBim.SceneJSWebViewer sample and I seek your advice please.
I am getting a Parser error Message: Could not load type 'Xbim.SceneJSWebViewer.Global'.
Source Error:
Line 1: <%@ Application Codebehind="Global.asax.cs" Inherits="Xbim.SceneJSWebViewer.Global" Language="C#" %>

Any help would be much appreciated.

wrote Oct 27, 2016 at 1:53 PM