Message 1 of 5
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I am using a macro to retrieve the model size.
For Revit Server files, I was able to use the REST API as follows:
ModelPath modelPath = doc.GetWorksharingCentralModelPath();
string server = modelPath.CentralServerPath; string fullPath = ModelPathUtils.ConvertModelPathToUserVisiblePath(modelPath);
string[] splitPath = fullPath.Split(new string[] {"/"}, StringSplitOptions.RemoveEmptyEntries); string restPath = string.Join("|", splitPath.Skip(2))); //removing protocol and server name WebRequest request = WebRequest.Create("http://" + server + "/RevitServerAdminRESTService" + version + "/AdminRESTService.svc/"+ restPath + "|/modelInfo" ); request.Method = "GET";
If I try to use a similar code on a BIM 360 file I get the error message below:
"The remote server returned an error: (400) Bad Request."
Note: the server (CentralServerPath) returns something like:
"https://modelxyz.skyscraper.autodesk.com:443/ModelService2015/ModelService.svc/basichttpbuffer"
So I am wondering:
- Is the REST API available on a BIM 360 model?
- If it is available how different is it to access it?
- If it is not available, is there another way to get the file size?
Note: I saw a Dynamo Script that gets the document GUID (doc.WorksharingCentralGUID), and search for the GUID.rvt in the local cache folder
Solved! Go to Solution.