Hello all,
I am creating a macro that batch upload models to the Revit server. But I want to skip files that already exist on the Revit Server. I am trying to check with BasicFileInfo.Extract(path) and then check if is null and encapsulate in a try-catch in case the file doesn't exist. But this is not working.
Is there an easier way to do this?
Many thanks
Solved! Go to Solution.
Solved by recepagah12. Go to Solution.
Can't you simply get all file names(Include that exist in the server) and compare them with the name of files that already exist in the server. This looks like a simple comparison test.
the problem is that as it is in the Revit server normal Windows system methods don't work. For example I can't get the files in the server with "GetFiles" or "File.Exist". If this was done locally in our file based server it would be very easy.
What do you mean exactly with "Server", is it BIM360, an external database or your company's local database?
I don't get it, how you can upload a file but can't get the information of uploaded files? If everything seems impossible for now, I can suggest you create a log file that contains every information(Path, name etc.) obtained by BasicFileInfo and save it to log file. This solution is applicable even you can't get the name of the fille in the server.
Hope that helps,
Recep.
Hello,
Yes I guess I could create a txt external file with all the uploaded files and then compare with that list. That would work. thanks!
Can't find what you're looking for? Ask the community or share your knowledge.