<?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: saving a model AutoCAD, Civil3D .Net api errors with Drawing Write Protected in .NET Forum</title>
    <link>https://forums.autodesk.com/t5/net-forum/saving-a-model-autocad-civil3d-net-api-errors-with-drawing-write/m-p/13193410#M1647</link>
    <description>&lt;P&gt;The issue has nothing to do with the code calling Database.SaveAs(). You can try to pass a full file name that points to a folder of the computer's local drive that you have full access to verify that the code works. The "lock" file you saw, if they are like [FileName].dwl, is AutoCAD created file whenever it opens a drawing file. It does not actually lock the drawing from being saved from the same AutoCAD session.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It is likely that the Autodesk Docs permission issue (when your computer connect to the Autodesk Docs via Autodesk Desktop Connector?).&lt;/P&gt;</description>
    <pubDate>Wed, 04 Dec 2024 20:37:55 GMT</pubDate>
    <dc:creator>Norman_Yuan</dc:creator>
    <dc:date>2024-12-04T20:37:55Z</dc:date>
    <item>
      <title>saving a model AutoCAD, Civil3D .Net api errors with Drawing Write Protected</title>
      <link>https://forums.autodesk.com/t5/net-forum/saving-a-model-autocad-civil3d-net-api-errors-with-drawing-write/m-p/13193243#M1646</link>
      <description>&lt;P&gt;I have an add-in that lets user selects mutliple models and for each, it is made the active document, some properties are added to it, then the document is saved and closed. This works for models that are local to my machine. But if I run it on the model that is in Drive (accessed via Autodesk Docs that mirrors Autodesk Construction Cloud), it fails with the error that "Drawing is write protected".&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My snippet of the code that does the save:&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;db.SaveAs(acadDoc.Name, true, DwgVersion.Current, acadDoc.Database.SecurityParameters);
doc.CloseAndSave(doc.Name);&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Question:&amp;nbsp;&lt;/P&gt;&lt;P&gt;I observe that when the model from Autodesk Docs (shared drive) is opened via the add-in, a lock gets applied. so db.SaveAs is not working. How do I prevent this?&lt;/P&gt;</description>
      <pubDate>Wed, 04 Dec 2024 19:07:32 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/saving-a-model-autocad-civil3d-net-api-errors-with-drawing-write/m-p/13193243#M1646</guid>
      <dc:creator>pari_dhanakoti</dc:creator>
      <dc:date>2024-12-04T19:07:32Z</dc:date>
    </item>
    <item>
      <title>Re: saving a model AutoCAD, Civil3D .Net api errors with Drawing Write Protected</title>
      <link>https://forums.autodesk.com/t5/net-forum/saving-a-model-autocad-civil3d-net-api-errors-with-drawing-write/m-p/13193410#M1647</link>
      <description>&lt;P&gt;The issue has nothing to do with the code calling Database.SaveAs(). You can try to pass a full file name that points to a folder of the computer's local drive that you have full access to verify that the code works. The "lock" file you saw, if they are like [FileName].dwl, is AutoCAD created file whenever it opens a drawing file. It does not actually lock the drawing from being saved from the same AutoCAD session.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It is likely that the Autodesk Docs permission issue (when your computer connect to the Autodesk Docs via Autodesk Desktop Connector?).&lt;/P&gt;</description>
      <pubDate>Wed, 04 Dec 2024 20:37:55 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/saving-a-model-autocad-civil3d-net-api-errors-with-drawing-write/m-p/13193410#M1647</guid>
      <dc:creator>Norman_Yuan</dc:creator>
      <dc:date>2024-12-04T20:37:55Z</dc:date>
    </item>
    <item>
      <title>Re: saving a model AutoCAD, Civil3D .Net api errors with Drawing Write Protected</title>
      <link>https://forums.autodesk.com/t5/net-forum/saving-a-model-autocad-civil3d-net-api-errors-with-drawing-write/m-p/13193412#M1648</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/543921"&gt;@Norman_Yuan&lt;/a&gt;&amp;nbsp;, yes the computer connects to Autodesk Docs via Autodesk Desktop connector.&lt;/P&gt;&lt;P&gt;The issue does not happen if its a local model. The exact error that happens when trying to save the changes to model opened via Autodesk Docs / Desktop Connector is "&lt;STRONG&gt;Drawing file is write protected&lt;/STRONG&gt;". Sometimes I also see&amp;nbsp;&lt;STRONG&gt; Error: eLockViolation&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 04 Dec 2024 20:43:20 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/saving-a-model-autocad-civil3d-net-api-errors-with-drawing-write/m-p/13193412#M1648</guid>
      <dc:creator>pari_dhanakoti</dc:creator>
      <dc:date>2024-12-04T20:43:20Z</dc:date>
    </item>
    <item>
      <title>Re: saving a model AutoCAD, Civil3D .Net api errors with Drawing Write Protected</title>
      <link>https://forums.autodesk.com/t5/net-forum/saving-a-model-autocad-civil3d-net-api-errors-with-drawing-write/m-p/13193662#M1649</link>
      <description>&lt;P&gt;Error message "eLockViolation" HAS NOTHING to do with saving drawing database as drawing file. If you run into this error, it is your code error when dealing with database-residing objects, and you may want to start another discussion thread for this topic.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Again, the error of not able to save the drawing file directly in the Autodesk DOCS' drive is not because of Database.SaveAs(). I do not use Autodesk DOCS, but a business document management system of this kind should/must have some kind version control/check in/out rules, rather than allow users to save whatever changes back freely. So, you must find out what kind of permissions you are given to the drawings in the Autodesk DOCS&amp;nbsp;drive.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 04 Dec 2024 23:08:48 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/saving-a-model-autocad-civil3d-net-api-errors-with-drawing-write/m-p/13193662#M1649</guid>
      <dc:creator>Norman_Yuan</dc:creator>
      <dc:date>2024-12-04T23:08:48Z</dc:date>
    </item>
    <item>
      <title>Re: saving a model AutoCAD, Civil3D .Net api errors with Drawing Write Protected</title>
      <link>https://forums.autodesk.com/t5/net-forum/saving-a-model-autocad-civil3d-net-api-errors-with-drawing-write/m-p/13194942#M1650</link>
      <description>&lt;P&gt;agreed, I have to see what is causing the issue with saving. But you are right that Write Protected error is different from "elockViolation". Posting my solution for "elockViolation" error here. Any add-in that uses&amp;nbsp;&lt;STRONG&gt;CommandFlags.Session&lt;/STRONG&gt; should also lock a document before starting a transaction. Otherwise it causes the&amp;nbsp;&lt;SPAN&gt;eLockViolation error. Locking a document can be done within a scope&lt;BR /&gt;Eg:&amp;nbsp;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;using (DocumentLock acLckDoc = acadDoc.LockDocument()) 
{
          .... all the logic for transaction, adding an object / editing the 
          drawing etc happens here
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 05 Dec 2024 13:59:55 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/saving-a-model-autocad-civil3d-net-api-errors-with-drawing-write/m-p/13194942#M1650</guid>
      <dc:creator>pari_dhanakoti</dc:creator>
      <dc:date>2024-12-05T13:59:55Z</dc:date>
    </item>
  </channel>
</rss>

