How to Open-and-detach a cloud workshared model?

How to Open-and-detach a cloud workshared model?

jfhalaby
Enthusiast Enthusiast
4,374 Views
4 Replies
Message 1 of 5

How to Open-and-detach a cloud workshared model?

jfhalaby
Enthusiast
Enthusiast

Hello,
Is there a recommended best practice for opening a detached copy of a cloud workshared central file with the Revit API?

 

I am developing a model checking utility and I want to open the latest synchronized version of a cloud workshared central file with the detach-and-preserve-worksets option.
However, when I use the method Application.OpenDocumentFile(ModelPath, OpenOptions, IOpenFromCloudCallback) with the option DetachFromCentralOption.DetachAndPreserveWorksets, I get an exception that says "Detach option is not valid for cloud model."

If the detach option is not valid for cloud models, how should I be opening and detaching a cloud model?

 

I could open the cloud model and then SaveAs a new central file to disk locally. However this will not be acceptable because during the model opening process, it is possible to encounter warnings or errors that require changes to the model (for example, deleting a dimension or one of its references.) This would cause elements in the project to be checked out, which I do not want.

Any help would be appreciated.
Best,
Jason

0 Likes
Accepted solutions (1)
4,375 Views
4 Replies
Replies (4)
Message 2 of 5

jeremy_tammik
Alumni
Alumni

I asked the development team for you.

 

Jeremy Tammik Developer Advocacy and Support + The Building Coder + Autodesk Developer Network + ADN Open
0 Likes
Message 3 of 5

jeremy_tammik
Alumni
Alumni
Accepted solution

Dear Jason,

 

As almost always, one important aspect of this topic is the functionality available in the Revit end user interface.

 

Does the UI enable this operation? If not, the API will very probably not do so either.

 

I should have said so first, before asking the devteam. They reply:

 

We don't allow users to do that. SaveAs is our recommend way to achieve that. You can see there is no 'openAndDetach' way in the UI when opening a cloud model, so the API aligns to this design as well.

 

I hope this clarifies.

 

Best regards,

 

Jeremy

 

Jeremy Tammik Developer Advocacy and Support + The Building Coder + Autodesk Developer Network + ADN Open
Message 4 of 5

jfhalaby
Enthusiast
Enthusiast

Jeremy,
Thanks for the clarification.

I was concerned that a SaveAs would not relinquish elements modified as a result of error resolution during model opening. However, I have just tested it and I am happy to report that ownership is in fact relinquished after the SaveAs, or the elements never get checked-out in the first place. I will proceed with this method as a replacement for OpenAndDetach!

Thank you,
Jason Halaby

Message 5 of 5

william.marquand
Community Visitor
Community Visitor

There are a few other reasons to detach from central. If I want to keep a file of phase one of a project, rename the file for phase two, how do I make sure that they are detached from each other and only one (the new second phase file) is connected to the central file.