Open revit file in another revit window in the background

Good afternoon
I’m trying to make a script that will resave the file opened in the current revit window into the specified folder in the structure, followed by cleaning from unused and removing unnecessary links (facilitating the model, for uploading to adjacent users)
There was a problem, if I try to open a detached file in the background, then revit gives a standard error that cannot be opened in the same window
Is it possible to somehow use dynamo to open a new revit window in the background and already perform all these operations in it
At the moment, the script is not completed (the synchronization process remains after cleaning and the problem mentioned above)
Saving to public access.dyn (81.1 KB)

Why not open a new project, and do the transmittal on N projects in the background?

Dynamo can’t directly facilitate the other actions, so your best bet is to start a new Revit instance and then background process the content. Better still start a new Revit instance and use ETransmit to just do the work for you - no need to build a Dynamo graph if a free and fully supported tool already exists.

thanks for the answer! I use eTransmit, but the idea was that a specialist designer who is currently working directly in the file could at any time (without having to remember where to save the file, under what name, etc.) upload the file for public use and continue working in the file

Sadly to detach from the central you need to close and reopen it - this is a requirement for Revit worksharing.

Yes, it is. There was a plugin in C# that performed this function and opened a new revit in the background, opened the file by disconnecting it from the central model at the time of the last synchronization and performed the specified operations, but at the moment the plugin does not have access. Because of this, I wanted to repeat the functionality on Dynamo. Unfortunately, I don’t know python and revit api well enough to repeat this in code and tried to recreate it using nodes

This is the limiting factor which I am pointing out. The tool requires opening a new Revit instance, and there is no way to open a headless instance of Revit unless someone has broken the terms of service and hacked something they shouldn’t have (I have seen people try and WRECK project data sets to the point that a month of work was obliterated so I recommend you skip that path).

You can look into copying the local file to a new location and opening the copy detached in the background to process, or transmitting the new copy using the API (purge isn’t possible this way as far as I know). However none of this is something I have seen nodes for so you’ll need to do some heavy Python or C# lifting.