Create/Save project with UNC Paths

Create/Save project with UNC Paths

Anonymous
No aplicable
1.058 Vistas
6 Respuestas
Mensaje 1 de 7

Create/Save project with UNC Paths

Anonymous
No aplicable

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 Me gusta
1.059 Vistas
6 Respuestas
  • unc
Respuestas (6)
Mensaje 2 de 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 Me gusta
Mensaje 3 de 7

Anonymous
No aplicable

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 Me gusta
Mensaje 4 de 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 Me gusta
Mensaje 5 de 7

Anonymous
No aplicable

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 Me gusta
Mensaje 6 de 7

Anonymous
No aplicable

Nope, SUBST is not an option... 😞 

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

0 Me gusta
Mensaje 7 de 7

Anonymous
No aplicable

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 Me gusta