B
by billblender on 12 Feb 2025, edited 10 Mar 2025
#
+2 votes
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.
T
by theoryshaw on 12 Feb 2025
#
Can you share the script and file? would be hard to help you troubleshoot, otherwise.
B
by billblender on 12 Feb 2025
#
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.
T
by theoryshaw on 12 Feb 2025
#
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.
from bonsai.bim.ifc import IfcStore
ifc_file = IfcStore.get_file()
There are probably other things.. but to just get you started...
M
by Moult on 12 Feb 2025
#
+4 votes
To get the model in the current session, don't use IfcStore, use the Ifc tool:
import bonsai.tool as tool
model = tool.Ifc.get()
The feature you're looking for to create meshes is the mesh() function in the shape builder.
S
by steverugi on 13 Feb 2025
#
+1 votes
hi @billblender
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:
- assigning IFC classes (Assign_IFC) to the objects using a script while still in blender.
- 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.
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
B
by billblender on 9 Mar 2025
#
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.
B
by billblender on 10 Mar 2025
#
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.