I am trying to integrate XBIM Web UI in to our application. We have IFC files in the local file system. We convert these IFC files to WexBIM format to display them in the browser (via XBIM Web UI). As far as I see XBIMv4 supports IFC versions 2x3 and 4.
But in my case, conversion works correctly with IFC4 files but not with IFC2x3 files. There is no exception or error message during the process and one WexBIM file created after the conversion. But the result wexBIM file is only 1KB. And nothing is displayed on the browser if we load that wexBIM file to the browser.
Here is the code that I am using to perform the IFC -> WexBIM conversion.
using (var model = GetModel(originalIFCFilePhysicalPath, wexbimDestFolderPath, ref ifcFileName))
{
if (model == null)
{
Logger.Error("No ifc model to process");
return GenericRequestResultCode.NotFound;
}
var context = new Xbim3DModelContext(model);
context.CreateContext();
using (var wexBiMfile = new FileStream(wexbimFilePhysicalPath, FileMode.Create, FileAccess.Write))
{
using (var wexBimBinaryWriter = new BinaryWriter(wexBiMfile))
{
model.SaveAsWexBim(wexBimBinaryWriter);
wexBimBinaryWriter.Close();
}
wexBiMfile.Close();
}
}
I am using .net 6 and XBIM.Geometry v5.1.437 in this example.
Any ideas about the problem?