Failed to create a cache: H5Fopen failed.
I've created a script in blender to reduce the name of faces in an IFC and save the new IFC file. Now I've tried to do a external python script to run blender in background and execute the script. But when it does bpy.ops.bim.update_representation()
, show the error "Failed to create a cache: H5Fopen failed." How can I solve that?
Code:
`import bpy
bpy.ops.bim.load_project(filepath=r"importIfc_route")
for obj in bpy.context.scene.objects:
if obj.type == 'MESH':
decimate_modifier = obj.modifiers.new(name="Decimate", type='DECIMATE')
decimate_modifier.ratio = 0.5
print(f"Decimate modifier added to {obj.name} with ratio 0.5")
else:
print(f"Skipping {obj.name} (not a mesh)")
try:
bpy.ops.bim.update_representation()
print("Update Representation executed successfully.")
except RuntimeError as e:
print(f"Failed to execute 'Update Representation': {e}")
output_path = r"exportIfc_route"
try:
bpy.ops.bim.save_project(filepath=output_path)
print(f"IFC file exported successfully to {output_path}")
except RuntimeError as e:
print(f"Failed to export IFC file: {e}")
`
Comments
I've always had these cache errors, but they don't seem to stop Bonsai working
Ok thanks! I've solved it creating a folder in the path:
%USERPROFILE%\\AppData\Roaming\Blender Foundation\Blender\4.3\extensions\.local\lib\python3.11\site-packages\bonsai\bim\data