Workflow experiment From Rhino to IFC using Blender

edited June 17 in General

I received a Rhino 3dm file from an architect I am working with (Confidential sorry, I will not be able to share screenshots). Here is the workflow I have experimented from 3dm file to IFC :

  1. Import using import_3dm addon.
    • Issue : In first import geometry was pretty good. On second export (several months after with the updated model) I got many displaced elements (some furnitures, windows etc…) .
    • Issue : some material seems correctly imported but not sure that all are. Too many things are blank.
  2. Use Scene PropertiesQuick Project Setup to create basic IFC structure
  3. Classify IFC object by selecting them Scene PropertiesAssign IFC Class.
    • Tedious workflow I don’t know if there is data in 3dm which might help classifying item.
  4. Select Project objects and export to ifc
    • Issue : it looks like material name is mandatory. See traceback.
Traceback (most recent call last):
  File "Blender\2.83\scripts\addons\blenderbim\bim\operator.py", line 69, in execute
    ifc_exporter.export(context.selected_objects)
  File "Blender\2.83\scripts\addons\blenderbim\bim\export_ifc.py", line 1134, in export
    self.ifc_parser.parse(selected_objects)
  File "Blender\2.83\scripts\addons\blenderbim\bim\export_ifc.py", line 163, in parse
    self.get_products()
  File "Blender\2.83\scripts\addons\blenderbim\bim\export_ifc.py", line 222, in get_products
    self.add_product(self.get_product(product))
  File "Blender\2.83\scripts\addons\blenderbim\bim\export_ifc.py", line 490, in get_product
    self.rel_associates_material.setdefault(slot.material.name, []).append(product)
AttributeError: 'NoneType' object has no attribute 'name'

location: <unknown location>:-1

Have you already experiment a workflow from Rhino to IFC using Blender ? (or FreeCAD ?)
Speckle should also be a valid path as there is a module in both Rhino and Blender but I don’t have Rhino myself.

Comments

  • Just in case it could be useful, there is also this repo to read and manipulate 3dm files. Never used it but I plan to take a stab at some point https://github.com/mcneel/rhino3dm

    Cyril
  • edited June 17

    @Cyril It may be that the bug you are encountering is already fixed, but I won't know for sure unless I have your file. Is it possible to send to dion@thinkmoult.com? You can use send.firefox.com for end-to-end encryption. Naturally I will only use it for debugging and will delete the file afterwards.

    You can also do a print(product) prior to L490 and isolate just that object and send that / replicate with that, if the entire file is too sensitive.

  • edited June 19

    @Moult said:
    You can also do a print(product) prior to L490 and isolate just that object and send that / replicate with that, if the entire file is too sensitive.

    Done. I sent you the sample file with the incriminated object by email.

    Note : I didn’t know how to export from Blender console to get something printed so I wrote it on wiki BlenderBIM Add-on code examples

  • @Cyril it works in the master version of the BlenderBIM Add-on, so I think it has been fixed already. There will be a new release this weekend.

  • @Moult said:
    @Cyril it works in the master version of the BlenderBIM Add-on, so I think it has been fixed already. There will be a new release this weekend.

    I tried with master version without success yesterday but didn’t want to react too early so I waited the new version 0.0.200621. Error stills occur. Strange.

  • edited June 22

    @Cyril for a couple versions now, the BlenderBIM Add-on requires a project structure which includes spatial objects, see screenshot, in particular the red circled objects (I missed circling the IfcBuildingStorey/* one too, but that is important too):

    Your blend file didn't seem to have it, so I added those objects (they are just empty objects, but they must be in that location in the spatial tree and must match the collection name which they define. Hopefully if you add those, it'll work for you too.

    Cyril
  • edited June 23

    @Moult said:
    @Cyril for a couple versions now, the BlenderBIM Add-on requires a project structure which includes spatial objects, see screenshot, in particular the red circled objects (I missed circling the IfcBuildingStorey/* one too, but that is important too):
    Your blend file didn't seem to have it, so I added those objects (they are just empty objects, but they must be in that location in the spatial tree and must match the collection name which they define. Hopefully if you add those, it'll work for you too.

    That was it for the tile but I get a similar error message with another element. I sent it by email.

    Side note : Adding a specific error for missing spatial objects would be a good thing. Press quick project setup again do not create it. Deleting all spatial element collections then pressing quick project setup do not create it again but export works with a single object.

  • Fixed - forgot to consider there that a slot may not have a material: https://github.com/IfcOpenShell/IfcOpenShell/commit/da7ba7b1e9fb8529026b35688f35f5d2c0408b37

    Better error messages is a low priority right now due to the rapidly changing nature of how things are processed. In the latest BlenderBIM Add-on version, the quick project setup will set up the spatial elements correctly, and the auto-setup at export time also sets it up correctly, and the import process will set it up correctly too... so unless the user deletes it, they shouldn't come across that problem... similarly, in the future, I am considering not actually requiring that object - so time will tell :)

    Cyril
  • @Moult said:
    Fixed - forgot to consider there that a slot may not have a material: https://github.com/IfcOpenShell/IfcOpenShell/commit/da7ba7b1e9fb8529026b35688f35f5d2c0408b37

    It works.
    Next error is different. I don’t know what object to extract :

    Traceback (most recent call last):
      File "<blender_console>", line 1, in <module>
      File "C:\Program Files\Blender Foundation\Blender 2.83\2.83\scripts\modules\bpy\ops.py", line 201, in __call__
        ret = op_call(self.idname_py(), None, kw)
    RuntimeError: Error: Traceback (most recent call last):
      File "C:\Users\UserName\AppData\Roaming\Blender Foundation\Blender\2.83\scripts\addons\blenderbim\bim\operator.py", line 69, in execute
        ifc_exporter.export(context.selected_objects)
      File "C:\Users\UserName\AppData\Roaming\Blender Foundation\Blender\2.83\scripts\addons\blenderbim\bim\export_ifc.py", line 1170, in export
        self.create_representations()
      File "C:\Users\UserName\AppData\Roaming\Blender Foundation\Blender\2.83\scripts\addons\blenderbim\bim\export_ifc.py", line 1832, in create_representations
        representation['ifc'] = self.create_representation(representation)
      File "C:\Users\UserName\AppData\Roaming\Blender Foundation\Blender\2.83\scripts\addons\blenderbim\bim\export_ifc.py", line 2002, in create_representation
        return self.create_model_representation(representation)
      File "C:\Users\UserName\AppData\Roaming\Blender Foundation\Blender\2.83\scripts\addons\blenderbim\bim\export_ifc.py", line 2016, in create_model_representation
        return self.create_variable_representation(representation)
      File "C:\Users\UserName\AppData\Roaming\Blender Foundation\Blender\2.83\scripts\addons\blenderbim\bim\export_ifc.py", line 2074, in create_variable_representation
        self.create_curve_representation(representation))
      File "C:\Users\UserName\AppData\Roaming\Blender Foundation\Blender\2.83\scripts\addons\blenderbim\bim\export_ifc.py", line 2193, in create_curve_representation
        self.create_curves(representation['raw'].bevel_object.data)[0])
    AttributeError: 'NoneType' object has no attribute 'data'
    
    location: C:\Program Files\Blender Foundation\Blender 2.83\2.83\scripts\modules\bpy\ops.py:201
    
Sign In or Register to comment.