Unload revit linked with its worksets closed

Hi everyone,

Before publishing workshared models on Forma I generally unload all links as it processes faster. While opening, I manually close all worksets and unload all links inside and close the file. It is quicker. I was looking to automate this workflow using dynamo multiplayer and a dynamo graph.

While testing I came to know (through Claude) that API does not allow unloading of a link whose workset is closed. This is a strange situation as the same can be achieved manually.

I tested script from this thread and it is returning me below error:

If any find solution, please share. Thanks

is the same still true for “publish without links”?

Claud falls short yet again.

It is going about this as if it was a UI task, which is why the roadblock has come up (perhaps as a result of how you prompted it?). Instead it should look at this as an API task and leverage the methods which the API exposes - in particular the TransmissionData class, which was built to allow the exact behavior you’re after without having to ever open the file. I would imagine that publish without links and ETransmit both make use of this. The documentation actually gives you the example of using the class to set the status of all linked documents to ‘unloaded’.

Review the example below and give it a shot. First try to read the code along, then then ask Claude to review the sample and explain it to you, then try to author it in Python on your own, and finally if you still can’t get it working ask Claude to convert to python and then explain how it all works line by line.

I believe TransmissionData class in particular was used for non-cloud models.

I am not good at coding. I tried using ExternalResource and ended up with the same error.

@elton.williams Yes, it is same. I am using Revit 2020 and option to publish without links is not available.

I assumed you were doing the initial publish, as modern builds have the publish without links option. Opening closing and then processing the local copy, opening again and syncing afterwards should work.

All of that said: 2020 is the blocker. You’ve missing 4 years of security updates, and cloud worksharing is likely not going to work for versions older than 2022 in about 2 months.

Update to a modern and supported version (I’d recommend 2025 or 2026 since updating in a timely manor seems problematic) as your first step.

That’s true. We are in the process of upgrading all models to Revit 2026. The workflow still holds good, I will test in it and get back later. Thanks.