Issues importing IFC files to BlenderBIM

I'm getting the following error message with several IFC 4 files imported from Gemeni (terrain models : https://www.powel.no/construction/gemini-terreng) Gemini seems to be using the DDS engine when exporting and it might be a problem with the export itself. :
Traceback (most recent call last):
File "C:\Users\lb\AppData\Roaming\Blender Foundation\Blender\2.82\scripts\addons\blenderbim\bim\operator.py", line 88, in execute
ifc_importer.execute()
File "C:\Users\lb\AppData\Roaming\Blender Foundation\Blender\2.82\scripts\addons\blenderbim\bim\import_ifc.py", line 291, in execute
self.create_georeferencing()
File "C:\Users\lb\AppData\Roaming\Blender Foundation\Blender\2.82\scripts\addons\blenderbim\bim\import_ifc.py", line 510, in create_georeferencing
scene.TargetCRS.vertical_datum = projected_crs.VerticalDatum
TypeError: bpy_struct: item.attr = val: TargetCRS.vertical_datum doesn't support None from string types
location: :-1
There are so many programs producing IFC files these days with variable quality. It would be great if these files could still be imported to BlenderBIM for manual improvement and validation.
I've shared the file on Firefox send. Thanks for any help.

Comments

  • It is a bug with the BlenderBIM Add-on. Thank you so much for reporting!

    • I was incorrectly casting data types for georeferencing data
    • The file is absolutely positioned, instead of using IFC4 map conversions. Blender does not work with absolute positions, as it is a 3D modeler, not a GIS platform, so it should perform an offset (which needs to be more visibly logged to the user, I have to admit... it's on the to-do list!). This offset feature didn't take into account the coordinate lists used by triangulated geometries, so I've now added this feature.

    Fix here: https://github.com/IfcOpenShell/IfcOpenShell/commit/d22d903a36b2a4d5a94bf98112390ca887a8d36f

    If you want the fix now, you can replace your import_ifc.py with this in your BlenderBIM Add-on's directory (C:\Users\lb\AppData\Roaming\Blender Foundation\Blender\2.82\scripts\addons\blenderbim\bim\import_ifc.py)

  • BlenderGIS and dxf import implements the offset as scene property, maybe we should stick to same variables so they all remains compatibles out of the box

  • @stephen_l correct - integrating IFC geolocation offsets with the BlenderGIS/DXF import variables is on the to-do list.

  • edited June 2020

    Thanks! My goal was indeed to use BlenderBIM to convert from absolute to local coordinates/place the site correctly. The file now imports nicely but I get an error when I attempt to export back to IFC. :

    Traceback (most recent call last): File "C:\Users\lb\AppData\Roaming\Blender Foundation\Blender\2.82\scripts\addons\blenderbim\bim\operator.py", line 69, in execute ifc_exporter.export(context.selected_objects) File "C:\Users\lb\AppData\Roaming\Blender Foundation\Blender\2.82\scripts\addons\blenderbim\bim\export_ifc.py", line 1169, in export self.create_map_conversion() File "C:\Users\lb\AppData\Roaming\Blender Foundation\Blender\2.82\scripts\addons\blenderbim\bim\export_ifc.py", line 1561, in create_map_conversion self.create_target_crs() File "C:\Users\lb\AppData\Roaming\Blender Foundation\Blender\2.82\scripts\addons\blenderbim\bim\export_ifc.py", line 1575, in create_target_crs SIUnitHelper.get_unit_name(self.ifc_parser.target_crs['attributes']['MapUnit']) File "C:\Users\lb\AppData\Roaming\Blender Foundation\Blender\2.82\scripts\addons\blenderbim\libs\site\packages\ifcopenshell\file.py", line 88, in create_entity e[idx] = arg File "C:\Users\lb\AppData\Roaming\Blender Foundation\Blender\2.82\scripts\addons\blenderbim\libs\site\packages\ifcopenshell\entity_instance.py", line 127, in __setitem__ self.wrapped_data.setArgumentAsNull(idx) File "C:\Users\lb\AppData\Roaming\Blender Foundation\Blender\2.82\scripts\addons\blenderbim\libs\site\packages\ifcopenshell\ifcopenshell_wrapper.py", line 1584, in setArgumentAsNull return _ifcopenshell_wrapper.entity_instance_setArgumentAsNull(self, i) RuntimeError: Attribute not set location: <unknown location>:-1

    I also made an attempt to use the IfcPatch tool (https://community.osarch.org/discussion/10/ifcpatch-tool-now-available) to do the patching but ended up with half of the IfcCartesianPoints patched and the other half still stuck in absolute coordinates. (same file) :-) I'm investigating on my side but dealing with IFC from GIS tools is a new area for me

  • @Lars the IfcPatch tool is probably the best way to go if you want to be very careful about preserving data as much as possible. I forgot to update the IfcPatch recipe with the fix (right now there is some duplicate code which I need to share to reduce maintenance in the future). Fixed here: https://github.com/IfcOpenShell/IfcOpenShell/commit/4d8b130f2df17ca3d85ce619f62e0acbc0181d02

    I also fixed the georeferencing export bug, which previously assumed that you should fill out the map unit, which is actually optional, fixed here: https://github.com/IfcOpenShell/IfcOpenShell/commit/36b262dff9b84556569ee34a11e0b93d2b716079

    Hope it helps :) Your testing is incredibly valuable!

    Lars
Sign In or Register to comment.