Create/Save project with UNC Paths

Create/Save project with UNC Paths

Anonymous
Not applicable
1,063 Views
6 Replies
Message 1 of 7

Create/Save project with UNC Paths

Anonymous
Not applicable

Hi,

I have a script for creating new models - created with Python in Dynamo. 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)

I have also tried the FilePath method, here the script never stops.. 

 

https://www.revitapidocs.com/2015/0776a818-f032-a332-ac59-962953d8493a.htm
https://www.revitapidocs.com/2015/db245ec6-e07a-b989-077a-a2947e308345.htm

 

Does anyone have a suggestion how to fix the problem? 🙂 

0 Likes
1,064 Views
6 Replies
Replies (6)
Message 2 of 7

jeremytammik
Autodesk
Autodesk

Can you use SUBST?

 

https://en.wikipedia.org/wiki/SUBST

 



Jeremy Tammik
Developer Technical Services
Autodesk Developer Network, ADN Open
The Building Coder

0 Likes
Message 3 of 7

Anonymous
Not applicable

Hi Jeremy,

I can use SUBST, wouldn't it give issues for other users?  or if I link models? using SUBST...

 

(EDIT: wrong account :-S)

0 Likes
Message 4 of 7

jeremytammik
Autodesk
Autodesk

Yes, of course, that might require some tricky coordination...

 

Sorry for being such an egoist and individualist, I always forget about the teamwork stuff...

 



Jeremy Tammik
Developer Technical Services
Autodesk Developer Network, ADN Open
The Building Coder

0 Likes
Message 5 of 7

Anonymous
Not applicable

hehe 🙂 

 

Besides SUBST, it's not possible to work with UNC paths in Revit?

If not, do you know if Autodesk is planning to support UNC paths from the Revit API?  

0 Likes
Message 6 of 7

Anonymous
Not applicable

Nope, SUBST is not an option... 😞 

2020-10-13_10-15-46.png

0 Likes
Message 7 of 7

Anonymous
Not applicable

update...  

DB.FilePath works with UNC paths ....
if you just aren't stupid enough to make a minor mistake in the path...
 
emoji.png
 
0 Likes