XbimEssentials icon indicating copy to clipboard operation
XbimEssentials copied to clipboard

IFC2x3 to Wexbim Conversion Problem with XBIM

Open ogz opened this issue 1 year ago • 9 comments

Hi, 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.

Assemblies and versions affected:

.net 6 and XBIM.Geometry v5.1.437

Steps (or code) to reproduce the issue:

I just run the following code to perform the 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();
	}
}

Minimal file to reproduce the issue:

IFC files need to be zipped to be uploaded. Then just drag & drop here

Expected behavior:

A valid WexBIM File

Actual behavior or exception details:

A WecBIM file with size of 1KB

ogz avatar Nov 24 '22 10:11 ogz