Unable to open file 'massive' Rhino file

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,

never mind, found the issue and goin to redo it.

for future others:
install pip install rhino3dm

do something like

create py file ‘layers.py’:

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()

That gives something like:

— ALL LAYERS IN FILE —
Layer 0: ‘Default’ (Parent ID: 00000000-0000-0000-0000-000000000000)
Layer 1: ‘models’ (Parent ID: 00000000-0000-0000-0000-000000000000)
Layer 2: ‘brep’ (Parent ID: 7b805bb4-d8dc-40ca-b3a3-fb7c97204f60)

you maybe be from there you can make a python file ‘recovery.py’ with something like this:

import rhino3dm
import os

INPUT_FILE = r"C:\path\to\your\file.3dm"
OUTPUT_FILE = r"C:\path\to\your\recovered.3dm"

TARGET_ID = “e674ba7d-497a-4a91-bbb2-2b32149de8bb”
KEEP_SUFFIX = " -Closed Brep"

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()