<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: doc.SaveAs on active CloudModel in Revit API Forum</title>
    <link>https://forums.autodesk.com/t5/revit-api-forum/doc-saveas-on-active-cloudmodel/m-p/9059906#M39496</link>
    <description>&lt;P&gt;I may have answered my own question, but feel free to chime in if any thoughts or comments.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What I'm doing that seems to work.&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Locate local cache copy of file by investigating Revit journal file (namely looking for most recent "Rvt.Attr.LastSavePath:" value)&lt;/LI&gt;&lt;LI&gt;Copy that file to desired local destination&lt;/LI&gt;&lt;LI&gt;Open that file using OpenOptions.DetachFromCentralOption.DetachAndDiscardWorksets&lt;OL&gt;&lt;LI&gt;Doing this even if CloudModel is NOT workshared which appears to work.&lt;/LI&gt;&lt;/OL&gt;&lt;/LI&gt;&lt;LI&gt;At this point the new copy of CloudModel is completely removed from Cloud and can be saved as normal.&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 01 Oct 2019 14:42:26 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2019-10-01T14:42:26Z</dc:date>
    <item>
      <title>doc.SaveAs on active CloudModel</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/doc-saveas-on-active-cloudmodel/m-p/9059522#M39495</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have the need to save active cloud model to a local file. When I try to use SaveAs I get the following error.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;"Error saving solved project: A managed exception was thrown by Revit or by one of its external applications."&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;My code is like below, where "NewFilePath" is to local hard drive.&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE&gt;SaveAsOptions sao = new SaveAsOptions();
sao.OverwriteExistingFile = true;

doc.SaveAs(NewFilePath, sao);&lt;/PRE&gt;&lt;P&gt;I've tried this on both the active cloud document, and by making copy of the local cache file first, but both approaches result in error.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any thoughts? Keep in mind my main goal is just to get a detached local copy of the cloud model.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Jon&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 01 Oct 2019 12:47:52 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/doc-saveas-on-active-cloudmodel/m-p/9059522#M39495</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-10-01T12:47:52Z</dc:date>
    </item>
    <item>
      <title>Re: doc.SaveAs on active CloudModel</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/doc-saveas-on-active-cloudmodel/m-p/9059906#M39496</link>
      <description>&lt;P&gt;I may have answered my own question, but feel free to chime in if any thoughts or comments.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What I'm doing that seems to work.&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Locate local cache copy of file by investigating Revit journal file (namely looking for most recent "Rvt.Attr.LastSavePath:" value)&lt;/LI&gt;&lt;LI&gt;Copy that file to desired local destination&lt;/LI&gt;&lt;LI&gt;Open that file using OpenOptions.DetachFromCentralOption.DetachAndDiscardWorksets&lt;OL&gt;&lt;LI&gt;Doing this even if CloudModel is NOT workshared which appears to work.&lt;/LI&gt;&lt;/OL&gt;&lt;/LI&gt;&lt;LI&gt;At this point the new copy of CloudModel is completely removed from Cloud and can be saved as normal.&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 01 Oct 2019 14:42:26 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/doc-saveas-on-active-cloudmodel/m-p/9059906#M39496</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-10-01T14:42:26Z</dc:date>
    </item>
    <item>
      <title>Re: doc.SaveAs on active CloudModel</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/doc-saveas-on-active-cloudmodel/m-p/9060034#M39497</link>
      <description>&lt;P&gt;Here are some related links on accessing and saving Revit models to and from BIM360.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Accessing BIM360 Models&lt;BR /&gt;&lt;A href="https://thebuildingcoder.typepad.com/blog/2018/12/forge-devcon-keynote-and-bim360-model-access.html#3" target="_blank"&gt;https://thebuildingcoder.typepad.com/blog/2018/12/forge-devcon-keynote-and-bim360-model-access.html#3&lt;/A&gt;&lt;/LI&gt;
&lt;LI&gt;How to create URN for Revit file from Revit plugin or using Forge APIs -- &lt;A href="https://stackoverflow.com/questions/53538382/how-to-create-urn-for-revit-file-from-revit-plugin-or-using-forge-apis" target="_blank"&gt;https://stackoverflow.com/questions/53538382/how-to-create-urn-for-revit-file-from-revit-plugin-or-using-forge-apis&lt;/A&gt;&lt;/LI&gt;
&lt;LI&gt;Forge blog post on accessing BIM 360 design models on Revit -- &lt;A href="https://forge.autodesk.com/blog/accessing-bim-360-design-models-revit" target="_blank"&gt;https://forge.autodesk.com/blog/accessing-bim-360-design-models-revit&lt;/A&gt;&lt;/LI&gt;
&lt;LI&gt;IOpenFromCloudCallback and the DefaultOpenFromCloudCallback Class&lt;BR /&gt;&lt;A href="https://thebuildingcoder.typepad.com/blog/2019/05/precast-api-and-cloud-open-callback.html#3" target="_blank"&gt;https://thebuildingcoder.typepad.com/blog/2019/05/precast-api-and-cloud-open-callback.html#3&lt;/A&gt;&lt;BR /&gt;... using the Revit API 2019 to detach a model from BIM360 with the following code:&lt;/LI&gt;
&lt;LI&gt;Accessing BIM360 Cloud Links&lt;BR /&gt;&lt;A href="https://thebuildingcoder.typepad.com/blog/2019/06/accessing-bim360-cloud-links-thumbnail-and-dynamo.html#2" target="_blank"&gt;https://thebuildingcoder.typepad.com/blog/2019/06/accessing-bim360-cloud-links-thumbnail-and-dynamo.html#2&lt;/A&gt;&lt;BR /&gt;Includes a working code snippet to obtain all external resource references, saying BIM360 Cloud references and local file references.&amp;nbsp;Contains Forge BIM360 ProjectId (i.e., LinkedModelModelId) and ModelId (i.e., LinkedModelModelId) if it's from BIM360 Docs.&amp;nbsp;&amp;nbsp;They can be used in calls to ModelPathUtils.ConvertCloudGUIDsToCloudPath.&amp;nbsp;ExternalResourceUtils.GetAllExternalResourceReferences, GetExternalResourceReferences and GetReferenceInformation&lt;/LI&gt;
&lt;LI&gt;Update Revit custom properties by web API&lt;BR /&gt;&lt;A href="https://stackoverflow.com/questions/54788232/update-revit-custom-properties-by-web-api" target="_blank"&gt;https://stackoverflow.com/questions/54788232/update-revit-custom-properties-by-web-api&lt;/A&gt;&lt;/LI&gt;
&lt;LI&gt;Open Revit BIM360 Model via command line&lt;BR /&gt;&lt;A href="https://stackoverflow.com/questions/57806330/open-revit-bim360-model-via-command-line" target="_blank"&gt;https://stackoverflow.com/questions/57806330/open-revit-bim360-model-via-command-line&lt;/A&gt;&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hope they help!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please let us know how you end up solving this.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 01 Oct 2019 15:20:29 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/doc-saveas-on-active-cloudmodel/m-p/9060034#M39497</guid>
      <dc:creator>jeremytammik</dc:creator>
      <dc:date>2019-10-01T15:20:29Z</dc:date>
    </item>
    <item>
      <title>Re: doc.SaveAs on active CloudModel</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/doc-saveas-on-active-cloudmodel/m-p/9060040#M39498</link>
      <description>&lt;P&gt;I saw your answer after posting my list.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Your approach sounds both feasible and clever.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you for sharing the solution!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I hope it continues to work reliably for you!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 01 Oct 2019 15:22:38 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/doc-saveas-on-active-cloudmodel/m-p/9060040#M39498</guid>
      <dc:creator>jeremytammik</dc:creator>
      <dc:date>2019-10-01T15:22:38Z</dc:date>
    </item>
    <item>
      <title>Re: doc.SaveAs on active CloudModel</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/doc-saveas-on-active-cloudmodel/m-p/9060669#M39499</link>
      <description>&lt;P&gt;Thanks Jeremy,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;After reviewing the links you provided I've settled on using the solution I posted above (I will mark this as the solution for post). It accomplishes exactly what I need. The only "down-side" to my solution I feel is digging through the journal file to locate local cache file, but as long as it remains reliable then not a problem.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I did find the "IopenFromCloudCallback" link helpful/interesting as it reveals you can Open &amp;amp; Detach directly using the CloudModelPath, with the result being a detached file that has the local cache file in doc.PathName (no need to dig through journal). I would have used this but the opened document replaces my active document (the CloudDocument) and I prefer to have both of them open.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks again!&lt;/P&gt;&lt;P&gt;Jon&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 01 Oct 2019 19:14:30 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/doc-saveas-on-active-cloudmodel/m-p/9060669#M39499</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-10-01T19:14:30Z</dc:date>
    </item>
  </channel>
</rss>

