Doesn't model = ifcopenshell.file()
load currently open file? After this, when I use walls = model.by_type('IfcWall')
, i get an empty list. What I am doing wrong.
Doesn't model = ifcopenshell.file()
load currently open file? After this, when I use walls = model.by_type('IfcWall')
, i get an empty list. What I am doing wrong.
In Blender + BIM Add-on context you mean ? If so check wiki page : https://wiki.osarch.org/index.php?title=BlenderBIM_Add-on/Using_the_Python_console_with_BlenderBIM_Add-on
ifcopenshell.file()
Above command just create a new empty ifc file. So it is perfectly logic that you get an empty list.
I think the current correct way using blenderbim is :
from blenderbim.bim import helper
model = helper.IfcStore().get_file()
Thanks @Cyril
Is there a documentation for blender.bim api
@Arv to get the actively loaded IFC in the BlenderBIM Add-on session, you can do:
import blenderbim.tool
model = blenderbim.tool.Ifc.get()
It uses what @Cyril recommended under the hood but is an intended publicly accessible API instead of an internal detail.
You can find documentation here: https://blenderbim.org/docs/ and https://blenderbim.org/docs-python/
Thanks @Moult
Login or Register to reply.