Hi , apparently i made a grafting mistake in an automated baking proces and i noticed it only when I saved the file after a crash ‘‘out of memory’’ popup. Turns out my file is now a massive 55GB.
And worst .. I cannot load it .. even in safe mode. I am trying to open the file and it is in it’s second hour and my third attempt. The bak file is also the same size. Same as rhino’s emergency saved file
worst-case I can revert back to previous file, but that would mean i need to redo my baking process that takes 2 days (bunch of complex boolean sdiff’s that take 15 min. each)
is there a way to inspect and remove geometry without rhino in attempt to reduce the file size. I know the layer the geometry is on.
i tried Rescure3dmFile, Insert, Merge etc… all no effect,
import rhino3dm
import os
input_path = "RHINO_EMERGENCY_SAVE.3dm"
def list_layers():
if not os.path.exists(input_path):
print("Error: File not found.")
return
# Read the file header and tables
model = rhino3dm.File3dm.Read(input_path)
print("\n--- ALL LAYERS IN FILE ---")
layer_count = len(model.Layers)
for i, layer in enumerate(model.Layers):
parent_info = ""
if layer.ParentLayerId != "00000000-0000-0000-0000-000000000000":
parent_info = f" (Parent ID: {layer.ParentLayerId})"
print(f"Layer {i}: '{layer.Name}'{parent_info}")
print(f"\nTotal Layers Found: {layer_count}")
if __name__ == "__main__":
list_layers()
def recover():
if not os.path.exists(INPUT_FILE):
print(“Input not found.”)
return
model = rhino3dm.File3dm.Read(INPUT_FILE)
new_model = rhino3dm.File3dm()
count = 0
for obj in model.Objects:
attr = obj.Attributes
layer = model.Layers[attr.LayerIndex]
# Check if object is inside the target hierarchy via ID
is_in_tree = (str(layer.Id) == TARGET_ID or str(layer.ParentLayerId) == TARGET_ID)
keep = False
if not is_in_tree:
keep = True
elif layer.Name.endswith(KEEP_SUFFIX):
keep = True
if keep:
new_model.Objects.Add(obj.Geometry, attr)
count += 1
# Uses the original file's Rhino version (7, 8, etc.)
new_model.Write(OUTPUT_FILE, model.ArchiveVersion)
print(f"Done. {count} objects saved to {OUTPUT_FILE}")
if name == “main”:recover()