Quickly identify workshared files vs local files

Q: Does anyone know a way to identify workshared files vs local files without opening them?

Context: Last week our IT company copied our network files to a new server. In doing so, all Revit workshared/central files became disconnected copies of the central file. Of course, every time we open a central file, we get “File has been copied, re-save as a central file…” message. I would like to create a dynamo script that will batch open files and re-save as a central file, but we must first identify which files have been re-saved by users already, and which files are no longer valid central files.

Worksharing is part of the Revit file itself, so I think you’re going to have a hard time checking that without opening a file, but you could do a background open which is faster and uses less resources.

Just check to see if a worskhared file path exists.
GetWorksharingCentralModelPath Method (revitapidocs.com)

1 Like

You want the ‘IsWorkshared’ property of the basic file info, found here: IsWorkshared Property

EDIT: Better still look into the TransmissionData class, which I think can save your bacon from this issue and from link repathing question you’ll have on Thursday: TransmissionData Class

1 Like

I always forget about BasicFileInfo! :+1:

2 Likes