Create/Save project with UNC Paths


I have a script for creating new models. Using UNC paths (\local\folder\folder…) instead of traditional (drive:\folder\folder…) paths I get the following error:

Exception: The model could not be saved:  (COleException 0x80030002)

Unfortunately, I don’t have the option to not use a UNC path. I’m certain the problem originates when I use the result from “ConvertUserVisiblePathToModelPath” in SaveAs(…)

path = DB.ModelPathUtils.ConvertUserVisiblePathToModelPath(unc_path_here)
doc.SaveAs(path, sopt)

Does anyone have a suggestion how to fix the problem? :slight_smile:

Hi Thomas,
Just a suggestion, since I cannot try it myself at the moment:

I would try to create a FilePath. It inherits from the ModelPath and should therefore be accepted by the SaveAs method.

Edit to mention:
You´ll probably get more answers on the Revit API Forum. I tend to forget about it, too :slight_smile:

1 Like

Hi Kibar,
Thanks for the suggestions, FilePath didn’t work, I’ll try to post it on Revit API Forum too :slight_smile:

1 Like