Dear Greg,
I raised this again with the development team in the discussion of a related issue, in a case named HLM-607 [doc.PathName is very slow for a360 project].
Here is a summary of what I learned so far:
Currently there is not support for opening a C4R model programmatically. The best way to access the data (today) is to leverage the Forge API to get at the models in a project. However, it is important to note that the model that is accessible via the Forge API is “detached” from the “source of truth” which is C4R.
Supporting programmatic access to C4R models is something that makes sense. Besides authorization/authentication issues, the Revit API will have to deal with operations that the API can perform on the model that are not currently allowed in a C4R session (e.g. upgrading the model). Consequently, opening a C4R model programmatically has some technical issues to work through.
Unfortunately, I don’t have a good answer that allows programmatic access at this time.
Is it possible that accessing the “detached” model via Forge will satisfy the current requirements?
The way things are right now, there's apparently not really much these users can do. I think they could figure out whether a model is in the cloud or not, but the forum users seem to want to be able to work with the cloud models, not just filter them out of the things they can work with.
I see the following concrete requests on those forum posts:
- Figure out whether ExternalResource is "missing" or "unloaded"
- Use model open API to open a cloud model as long as the user is logged in
- List C4R models via some API
- Support for ApplicationServices.Application.CopyModel to copy a cloud model to a spot on the disk
- Full API support for cloud hosted documents (this isn't specific enough to do anything about but I figured I'd call it out anyway)
All of these are really feature requests.
Regarding the second forum post, https://forums.autodesk.com/t5/revit-api-forum/externalfileutils-not-working-with-c4r/m-p/6939236
I'm not entirely sure what the add-in described there does, so I may be missing large chunk of stuff that they need. It seems like they'd be happy if they could at least open a model via API though. I think the tough part of that isn't really the model open call (it would require some work but obviously Revit does know how to open models from the cloud) but getting the correct information to the plugin. It would have to know the project and model identifiers which we don't expose. It may be possible basically exposing the management service API via Revit API but getting it to gel with the existing file based APIs might be quite the trick.
Some of this would definitely be easier with the new Forge BIM 360 Docs integration work because I think enough information will live in Forge that they could query that using their own app key and I think that would give them enough information to build up a string that we could make Revit parse without too much pain. That's all a bit up in the air though until it's actually built.
I hope this clarifies where we are right now, even if it does not provide much concrete help of how to solve anything.
Cheers,
Jeremy