Model cleanup - Open in background

Hi everyone

I’m creating a dynamo graph to clean up models. Short summary of what i’m trying to do:

Open file --> audit, detach, preserve worksets
Clean up file --> delete certain sheets, delete all views not on sheets, delete and unload CAD links.
Save file and close --> compact file, save as central, is workshared, relinquish.

The file opens fine, saves and closes as well. But none of the actions I have assigned is completed. If I however perform the actions on an open document they work fine. Can anybody help me resolve this issue?

I would also love to add the ability to purge the document in the process. Not just once, but until 0 elements is left. I have seen a couple post for this, but none that did the trick for me.

Any help is much appreciated.

2 Likes