I need a way to open multiple files and save them as central worksharing models. I am able to create a list of file paths in excel for all the files I want to do this with.
The reason: We are moving to a different file storage system which means all the workshared Revit files will still point to the old location. This means that I would have to open all the Revit files individually and save as central model and close them.
It seems like this is something that could be done with a python script, but I am not skilled enough to make it happen.
it does not work fo me, it says something like the file path does not exist, but there is already a file in there
I guess because script is editing the file path name, splitting string by “_” and something more, and my file name contains that symbol.
ilename = filepath.Split("\\")[-1].Replace(".rvt","")
newdoc = app.OpenDocumentFile(filepath)
if RVer not in filename:
if "Central" in filename:
x = filepath.split("_")
x.insert(len(filepath.split("_"))-1,RVer)
y = "_".join(x)
else:
x = filepath[:-4]
y = x + "_" + RVer + ".rvt"
else:
y = filepath
newdoc.SaveAs(y,SaveOptions)
yea it does that, the script’s intention was to also change the name to the respective version. you can comment away the if statement to make it work as you need.