patch visible (not hided) elements into a new ifc in Bonsai
- load a IFC into Bonsai
- hide elements either by the use of the tree or by the use of Colour By Property and Select by Property and H-Button or some other workflow
How is it possible to use patch of all visible elements and save a new ifc out of them?
A temporary workaround could be to get all GUID from all visible elements. With a small code snippet this could be transfered to a query to be used in patch. The question here would be how to get all GUID from all visible elements.
cheers bernd
Comments
There is a "Load from Memory" checkbox already on Patch GUI in Bonsai, but it uses all elements from the loaded ifc and not the visible ones.
Noone an idea ... How to get all GUID from all visible objects in Bonsai by python?
not sure this is correct (just trying to guess here)
visible object can be found with
which prints a list of Blender "turned on" objects in the model returning IfcClass/name, you can make a dictionary out of it or a list
from there maybe you could use
ifcopenshell.util.selector(model, query)
that accepts name and type in it to narrow them down to valid IfcBuildingElementafter that the GUID comes with
element.id()
sorry I am not much of an expert in python, just curious to see how this can be achieved
Python programmer here.
The best way is to create a new recipe with ifcpatch
Have a look here:
https://docs.ifcopenshell.org/ifcpatch.html
and here
https://github.com/IfcOpenShell/IfcOpenShell/tree/v0.8.0/src/ifcpatch/ifcpatch/recipes
This is the location on your system where you save new recipes:
%AppData%\Blender Foundation\Blender\4.2\extensions\.local\lib\python3.11\site-packages\ifcpatch\recipes
Restart blender to make them available :)