Assigning IFC objects in Blender for Newbie
I have scanned a house in Kiri Engine. Imported the USDZ file into Blender. Cleaned it up using ChatGPT suggestions. I have a script to assign the IFC classes to the Objects (Door/Wall etc) . I am stuck as to how get this .blend model to transfer to a ,ifc file. I have the append route but it has not worked.
Comments
Can you share the script and file? would be hard to help you troubleshoot, otherwise.
A partial model .blend file is attached and the script is called Assign_IFC under the Scripting tab. My use case is to Lidar scan a house, import the USDZ file in Blender, cleanup the data, then use python to assign the IFC Classes to the objects while in Blender. Process then would be to move the data to Bonsai and leverage BIM data analysis in Bonsai. My difficulty is - 1. assigning IFC classes (Assign_IFC) to the objects using a script while still in blender. - 2. understanding how to export/append/convert the .blend collection of objects to a project in Bonsai and save as an .ifc file. All of the current objects are for the ground floor and my intention would be to add data for the second floor. I thought this would be a common use case but could readily find a case study to do this in Blender 4.3.2 & Bonsai.
I'm a newbie too, but this script seems to have a lot missing.
I would study: https://docs.ifcopenshell.org/ifcopenshell-python/geometry_creation.html
I think in general your script you need to add the following to your element...
Also use the following to 'get' the loaded ifc_file in Blender.
There are probably other things.. but to just get you started...
To get the model in the current session, don't use IfcStore, use the Ifc tool:
The feature you're looking for to create meshes is the
mesh()
function in the shape builder.hi @billblender
another newbie here, I work with 2D dwg -> dxf -> IFC manual conversion in Bonsai for quantity takeoff (alongside classification and PSets)
wouldn't it be easier to use your nice scanned 3D objects as reference to replace them with quickly built walls, for instance?
surely furniture can be saved as IfcFurniture with their mesh, the rest can easily become a geometry leveraging on typing and parametric objects, also taking much less file space, and ready to get your data.
cheers and happy modeling
Trying a simpler approach with a single wall. I append LR8_singlewall.blend to a new IFC project and extract the wall geometry from the LR8_singlewall.blend file. This is done using LR8C.text as a script in the new saved IFC project. It displays correctly in the 3D viewport, including wall and door openings. (LR8C.blend). However when I save the modified IFC file and reopen it the wall does not show parallel faces, a solid wall or the wall and door openings (LR8C_mod.ifc). Is my script to trace the wall on the wrong track? If I get this working the next step is to replicate this process for all the objects in the original model.
Success! I managed to create the IFC.file using the attached script. Now to work out if I can clean up the geometry where walls join.