Blender now supports IFC export

This forum section is only for IFC-related issues
Post Reply
User avatar
Moult
Posts: 321
Joined: Sat Jan 05, 2019 11:46 am
Contact:

Re: Blender now supports IFC export

Post by Moult »

The BlenderBIM Add-on uses the IfcOpenShell bundled in the Blender add-ons install. It does not use your system install.

With every release, it has the latest possible IfcOpenBot build.
I also blog about 3D rendering, architecture, software and other on thinkMoult.com. RSS / Atom feed available for your convenience.
User avatar
yorik
Founder
Posts: 13640
Joined: Tue Feb 17, 2009 9:16 pm
Location: Brussels
Contact:

Re: Blender now supports IFC export

Post by yorik »

With the recent improvements by realthunder, FreeCAD is now able to create a doc without displaying it in the 3D view... I wonder if we couldn't use that to our advantage... Ex. if the IFC importer would be able to create several partial files, and then one "master" file that links (using App Link or Arch Ref), all under the hood, then just open the final file, we could get a huge performance boost...
Moult wrote: Wed Apr 01, 2020 10:29 am Note that related to materials, this IFC4 file produced by FreeCAD seems to use IfcPresentationStyleAssignment, which has been deprecated and is invalid :) Yorik, if you're up to fixing that feel free, otherwise perhaps leave it on the bugtracker.
Can you point me to how it should be done now?
User avatar
bernd
Veteran
Posts: 12849
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: Blender now supports IFC export

Post by bernd »

more debuging:

file could be downloaded here: https://forum.freecadweb.org/viewtopic. ... 61#p135030 (need to be unzipped)

in blenderBIM the most important rebars are missing :o The ones which connect the foundation with the little columns for the crane.


Screenshot_20200402_153824.png
Screenshot_20200402_153824.png (745.75 KiB) Viewed 4646 times
paullee
Veteran
Posts: 5097
Joined: Wed May 04, 2016 3:58 pm

Re: Blender now supports IFC export

Post by paullee »

Moult wrote: Thu Apr 02, 2020 2:15 am @paullee, the file fails to import because it contains some IfcStyledItem which should have a list of materials, but contains an empty list. This is an invalid IFC. e.g. #3917826= IFCSTYLEDITEM(#3917827,(),$);

That said, it doesn't justify a failed import, and so I've fixed it :) https://github.com/IfcOpenShell/IfcOpen ... 3c3ca72353
Would be available in coming BlenderBIM download right ?
Seem in download page, still have the same version one week ago.


Moult wrote: Thu Apr 02, 2020 2:15 am
By the way, there is also an experimental (i.e. has some bugs, but slowly becoming more stable) multicore import option, which can make imports happen twice as fast, or even faster. You can enable it in the scene properties -> model view definitions panel -> experimental modes -> import with cpu multiprocessing.
Need to do some Blender exercise to acquaint myself again Blender workflow :)
User avatar
Moult
Posts: 321
Joined: Sat Jan 05, 2019 11:46 am
Contact:

Re: Blender now supports IFC export

Post by Moult »

@yorik IfcStyledItem (https://standards.buildingsmart.org/IFC ... editem.htm) has a Styles attribute, where the documentation states "NOTE Only the select item IfcPresentationStyle shall be used from IFC4 onwards, the IfcPresentationStyleAssignment has been deprecated.". In FreeCAD, I believe it still uses IfcPresentationStyleAssignment on IFC4 files.

Note that if you do fix this, it (may) break import of colours into Revit. In Blender, I solved this by adding a feature to enable various Revit export workarounds (which force using IfcPresentationStyleAssignment ), but by default it prioritises valid IFC4.

@bernd I think that's a bug in IfcOpenShell. I wish I was capable of fixing it :( Reported here: https://github.com/IfcOpenShell/IfcOpenShell/issues/823

@paullee You can either wait for the next release, or just download the files from the Github repo and replace them in your Blender addons directory. They are just Python files after all :)
I also blog about 3D rendering, architecture, software and other on thinkMoult.com. RSS / Atom feed available for your convenience.
User avatar
bernd
Veteran
Posts: 12849
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: Blender now supports IFC export

Post by bernd »

Moult wrote: Thu Apr 02, 2020 10:56 pm ...
@bernd I think that's a bug in IfcOpenShell. I wish I was capable of fixing it :( Reported here: https://github.com/IfcOpenShell/IfcOpenShell/issues/823
...
FYI: started to do some reinforcement code for FreeCAD. To have some examples I wrote some ifc importer which does only take the polyline from ifc and makes the sweep in FreeCAD. With this I am able to import all rebars. see https://forum.freecadweb.org/viewtopic. ... 63#p383475
User avatar
Moult
Posts: 321
Joined: Sat Jan 05, 2019 11:46 am
Contact:

Re: Blender now supports IFC export

Post by Moult »

@bernd - that is 100% the right approach with rebar. Rebar models can be very heavy and converted them into a brep is definitely a very bad approach. I will also do a similar thing in the BlenderBIM Add-on to treat swept disk solids as a special case.

... I'll add it to the to-do list!
I also blog about 3D rendering, architecture, software and other on thinkMoult.com. RSS / Atom feed available for your convenience.
User avatar
bernd
Veteran
Posts: 12849
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: Blender now supports IFC export

Post by bernd »

and another example where we could share code ...
paullee
Veteran
Posts: 5097
Joined: Wed May 04, 2016 3:58 pm

Re: Blender now supports IFC export

Post by paullee »

Moult wrote: Thu Apr 02, 2020 10:56 pm @paullee You can either wait for the next release, or just download the files from the Github repo and replace them in your Blender addons directory. They are just Python files after all :)
OK I try to download and just overwrite the file, when Blender has already opened .... have problems.

Still nothing after importing.... found in Scripting ...

Code: Select all

Traceback (most recent call last):
  File "/home/paullee/.config/blender/2.82/scripts/addons/blenderbim/operator.py", line 112, in execute
    ifc_importer.execute()
  File "/home/paullee/.config/blender/2.82/scripts/addons/blenderbim/import_ifc.py", line 183, in execute
    self.settings_2d.set(self.settings_2d.INCLUDE_CURVES, True)
  File "/home/paullee/.config/blender/2.82/scripts/addons/blenderbim/import_ifc.py", line 319, in create_products
    
  File "/home/paullee/.config/blender/2.82/scripts/addons/blenderbim/import_ifc.py", line 358, in create_product
    def create_product(self, shape):
  File "/home/paullee/.config/blender/2.82/scripts/addons/blenderbim/import_ifc.py", line 27, in create
    return
  File "/home/paullee/.config/blender/2.82/scripts/addons/blenderbim/import_ifc.py", line 33, in parse_representations
    self.parsed_meshes.append(self.mesh.name)
  File "/home/paullee/.config/blender/2.82/scripts/addons/blenderbim/import_ifc.py", line 38, in parse_representation
    if self.parse_representation(representation):
  File "/home/paullee/.config/blender/2.82/scripts/addons/blenderbim/import_ifc.py", line 50, in parse_representation_item
    def parse_representation_item(self, item):
IndexError: tuple index out of range

location: <unknown location>:-1

Then, close Blender and open it ... problem

Code: Select all

[paullee@localhost ~]$ blender -d
Switching to fully guarded memory allocator.
Blender 2.82 (sub 7)
Build: 2020-03-05 00:00:00 Linux Release
argv[0] = blender
argv[1] = -d
Read prefs: /home/paullee/.config/blender/2.82/config/userpref.blend
read file 
  Version 280 sub 39 date unknown hash unknown
addon not found: 'blenderbim'

Screenshot from 2020-04-04 10-20-04.png
Screenshot from 2020-04-04 10-20-04.png (477.75 KiB) Viewed 4522 times
User avatar
Moult
Posts: 321
Joined: Sat Jan 05, 2019 11:46 am
Contact:

Re: Blender now supports IFC export

Post by Moult »

It sounds like you have somehow replaced the add-on files incorrectly. I cannot debug this easily without seeing what's in your folders. Time to start fresh :)
I also blog about 3D rendering, architecture, software and other on thinkMoult.com. RSS / Atom feed available for your convenience.
Post Reply