I'm hitting sort of a roadblock here in one of my export endeavours. I'm trying to explore how to carve openings in walls using the API.
I'd like to put openings in walls and achieve roundtripping but I can't.
I'm basically converting wall geometry and booleans from blender to ifc. I can't use the blenderbim addon interface to do it because I want to be agnostic of Blender as much as possible and I have hundreds of walls to export.
Here's a simple example.
with a typed wall and a boolean opening (All blender stuff, there is no ifc involved in the blend file yet) :
So as pseudo code here's where I'm at :
material = add_material()
wall_type = add_wall_type(thickness = 0.30)
wall_occurence = add_wall_occurence(blender_obj, wall_type)
Roundtrippin works up until then.
Now I add a regular blender boolean to my wall to create an opening. (It doesn't have to be added as a modifier but that's how I know this opening belongs to this wall in code)
I export it to an opening element, and use it as an opening to the IfcWall occurrence.
opening_ifc = run(
"root.create_entity", wrapper.file, ifc_class="IfcOpeningElement", name=opening_blend.name
)
items = create_ifc_mesh(wrapper, opening_blend) # Similar to the dxf2ifc.py example script
representation = wrapper.file.createIfcShapeRepresentation(
wrapper.body,
wrapper.body.ContextIdentifier,
"Tesselation",
items,
)
run("geometry.assign_representation", wrapper.file, product=opening_ifc, representation=representation)
run("void.add_opening", wrapper.file, opening=opening_ifc, element=wall_ifc)
Then when I try to import the ifc file back to Blender, there is no opening. However the weird thing is that the opening does display when I go into the BIM tool and click on the Void tool, but it isn't registered as an opening.
And it does display in BimVision
and Revit
Surely I'm missing something but can't really figure what...
I'll share the ifc if anyone wants to take a look or has some insight into this.
Cheers