Open ogz opened 1 year ago
Hello there,
Could you provide the IFC2x3 file in question? I will see if I can replicate the issue on my end.
Thanks, Will
Hi Will, thank you. Here is the original file and the result wexBIM file
And also Test2_IFC 2x Editon3.zip Test2_WexBIM 2x Editon3.zip
Hi Ogz, You say it is working for IFC4, but for the examples you provided, both of the wexbim are 1kb?
Regards, Will
Hi Will, The example IFC files are in IFC2x3 format and WexBIM files are the results of the conversion. They are the problematic files.
I didn't uploaded any IFC4 example files because they were converted correctly.
Regards, Reha
Hi Ogz,
The issue is that the file provided does not adhere to CV-2x3
Here is the simple resolution:
The reason I ask about the IFC4 example is that this shouldn't change with schema. Maybe it was exported with a different program?
Hope this helps, Will
Hi Will,
Sorry for the late response. Do you mean I should change the content of the file? Unfortunately, the file belongs to the customer and we are providing a CMS for the customer. Therefore I cannot modify the file. In addition, I don't know which program(s) they are using. The sample file has just been uploaded to the CMS server. But at least I will test your solution to see if it solves the problem.
Is there anything that I can do with a code change at the backend? Regards,
Reha
What you could do is validate & patch the models all in code - before you generate the geometry (with Xbim3DModelContext.CreateContext()
).
If you look at the code in the Geometry engine we validate the IfcGeometricRepresentationContext
are correct and log warnings where there are issues. e.g.
It would be possible to copy this validation into a pre-processing step, and then, instead of logging, go ahead and patch (transiently) the invalid IfcGeometricRepresentationContext
s before calling CreateContext. Once you've done that and get no warnings you should be good.
The key thing is that according to the specification IfcGeometricRepresentation[Sub]Context.ContextType
Attribute MUST be 'Model'
In your models the values are 'Mesh' and 'Solid' which is invalid and violates the implementors agreements.
Equally the ContextIdentifier
attribute needs to be match a ShapeRepresentation's RepresentationIdentifier
. See Figure 405 on the spec on the standards page
Hope that helps
Hi Will, Thank you for your response. I have tested your solution and it works if I change the content (IFCGEOMETRICREPRESENTATIONSUBCONTEXT) of the IFC file. But I furthermore have tested another file and there the following lines are missing:
IFCGEOMETRICREPRESENTATIONCONTEXT($, 'Plan'.............
IFCGEOMETRICREPRESENTATIONSUBCONTEXT('Body', 'Model', .............
IFCGEOMETRICREPRESENTATIONSUBCONTEXT('Box', 'Model',.............
I tried to manually add the lines, but there was no success. It ended with the following exception during the conversion.
Exception during ifc to wexbim conversion: System.NullReferenceException: Object reference not set to an instance of an object.
at Xbim.ModelGeometry.Scene.Xbim3DModelContext.<>c__DisplayClass18_0.<.ctor>b__1(IIfcGeometricRepresentationContext c)
at System.Linq.Enumerable.WhereListIterator`1.ToList()
at Xbim.ModelGeometry.Scene.Xbim3DModelContext..ctor(IModel model, String contextType, String requiredContextIdentifier, ILogger logger)
at PPMRoom.Services.XBimService.CreateTempWexbimFile(String originalIFCFilePhysicalPath, String wexbimFilePhysicalPath, String wexbimDestFolderPath) in E:\GitLab-Runner\builds\NnDCcrQP\0\ppm-raum\ppm-raum-backend\src\PPMRoom.Services\Services\XBimService.cs:line 155
[2022-12-14 14:27:26.7300 ERROR PPMRoom.Services.XBimService]
I have attached the file, do you have any idea about that matter? sample2.zip
Regards,
Reha
In this case, geometry representations don't refer to any context at all. This is an invalid IFC file, because all subtypes of IfcRepresentation have to define their context.
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
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