So in BlenderBIM there is the possibility to update an ifc2x3 to ifc4
What is the command behind it? so that can be used for an script?
So in BlenderBIM there is the possibility to update an ifc2x3 to ifc4
What is the command behind it? so that can be used for an script?
does this get you started?
Thanks @theoryshaw
So it was the recipe https://github.com/IfcOpenShell/IfcOpenShell/blob/v0.7.0/src/ifcpatch/ifcpatch/recipes/Migrate.py
So i wrote that little script. The varibale path_to_directory
is just a directory, the script takes all the ifc file in a given directory and tries to make an IFC4 and optimize a litte bit.
import ifcpatch
import ifcopenshell
from pathlib import Path
for path in path_to_directory.glob("*.ifc"):
abs_path = path.resolve()
name = path.name
model = ifcopenshell.open(abs_path)
output = ifcpatch.execute({"input": name,
"file": model,"recipe": "Migrate", "arguments": ["IFC4"]})
new_name_ifc4 = f"IFC4-{name}"
path_to_new = new_Folder / new_name_ifc4
ifcpatch.write(output, str(path_to_new))
output_2 = ifcpatch.execute({"input": new_name_ifc4,"file": output, "recipe": "RecycleNonRootedElements", "arguments": []})
name_ifc4_opt = f"Opt-IFC4-{name}"
path_to_new = new_Folder / name_ifc4_opt
ifcpatch.write(output, str(path_to_new))
Login or Register to reply.