Revit Server Subdirectories

I’m attempting to get a list of the sub-directories and/or files within a Revit server. I used Directory.Contents and Directory.Contents+ correctly with a local directory but unsuccessfully with the revit server. The error that came up was “The given path’s format is not supported.”

I was able to access a revit server file successfully with the same format.

Thoughts are appreciated.

Hi @nathaniel.g.macdonal

Try using “String”:

If it didn’t help then from windows explorer select file -> Shift+Right Click -> CopyasPath-> Paste the path in “String” and remove file name with extension after pasting. Make sure you keep the path only.

Good Luck!

Hmmm, tried both of those with no luck. Definitely have the correct path and putting it in a String node didn’t help. :cry:

That’s happening because the Directory.Contains node uses a standard .NET method that expects a typical local or networked file system folder path, where as you’re providing a custom path that uses a custom proprietary protocol. The Application.OpenDocumentFile node will instead use API methods that can convert the above custom path to a Revit model path and open the file fine.

Maybe there’s a Revit Server alternative to the “Directory.Contains” method but unfortunately I am not aware of such.

You were correct here. I didn’t end up finding a Directory.Contains for the Revit server. Unfortunately I had to rely on someone to give me a list of the current projects. I believe they pulled the list with the Revit Server API.

sounds good, but how to do it because I cannot get access to DOCUMENTS of Revit stored in revit server