Open links background and save it

Hello.

I need some help with my script, i´ll try to explain what im doing.

I want to make something like a “work construction progress” inside of Revit. I have a project call “ST.rtv”, y want to make some changes, save it, then load it in a new project a see those changes, this it’s the whole idea.

First of all, I have the structural project (“ST.rvt”) with columns, floors, beams, walls, etc… each of those elements has two parameters: “start date” and “finish date”, then I open a new project and linked the “ST.rvt” project inside of it. The idea is to open “ST.rvt” as background to make some changes on it like override graphics on the elements that are less or equals to the given date by user, when this is achieved, save linked model “ST.rvt” and close it, after that, reload the link again and the elements will show up with colors… I already have this and works fine, but I have no idea how to save the linked model “ST.rvt” (NOT THE LOCAL MODEL) from the local with those changes and reload it again to see the element graphics, because, when I run the scritp with “ST.rvt” linked not save but If I unload it, it is save…. I tried python but i´m not an expert….

I don´t know if this is possible, can anybody help me…

These are the screenshots

“SV.rvt” in local model

“SV.rvt” in local model, user gives a date (mm-dd-yyyy)

“SV.rvt” in local model, override graphics shown if parameter value (“start date”) is less or equal

New project with “ST.rvt” linked

New project with “ST.rvt” linked typing same date as shown above

Collects files .rvt from directory, in this case “ST.rvt”

(purple) I got the elements from linked file “ST.rvt”, transparency (blue) and colour (green), works fine

Here comes the problem “can´t close the file, it has either been closed already or another weird error”

If I put another “data stream.await” node to unload the link “ST.rvt” gives the next error, because its true it has been deleted