<?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: any way to remove password from a dwg in ObjectARX Forum</title>
    <link>https://forums.autodesk.com/t5/objectarx-forum/any-way-to-remove-password-from-a-dwg/m-p/3429797#M14866</link>
    <description>&lt;P&gt;OK. Working code:&lt;/P&gt;
&lt;PRE&gt;static bool RemovePasswordProtection(AcDbDatabase *pDb)
{
    const SecurityParams *parSecOld = pDb-&amp;gt;cloneSecurityParams();
    SecurityParams parSecNew = *parSecOld;
    parSecNew.ulFlags = 0; // Clear all security flags
    return (pDb-&amp;gt;setSecurityParams(&amp;amp;parSecNew));
}
// Main function remove password from current drawing
static void PWDRemovePwd(void)
{
    AcDbDatabase *pCurDb  = acdbCurDwg();
    AcApDocument *pCurDoc = curDoc();
    RemovePasswordProtection(pCurDb);
    pCurDb-&amp;gt;saveAs(pCurDoc-&amp;gt;fileName(),NULL);
}
&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 25 Apr 2012 09:01:07 GMT</pubDate>
    <dc:creator>Alexander.Rivilis</dc:creator>
    <dc:date>2012-04-25T09:01:07Z</dc:date>
    <item>
      <title>any way to remove password from a dwg</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/any-way-to-remove-password-from-a-dwg/m-p/3427433#M14859</link>
      <description>&lt;P&gt;I want to remove password from dwgs whose password is know.&amp;nbsp; I can open these dwgs by known pasword, but I can't find a way to save them without password.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SecurityParams secParams;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;{&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;secParams.cbSize = 48;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;secParams.ulFlags = 1;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;secParams.ulProvType = 1;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;secParams.ulAlgId = 26625;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;secParams.ulKeyLength = 40;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;secParams.wszPassword = szPassword;&lt;FONT color="#FF0000"&gt;//if I give NULL to this param, the "saveAs" method crushes.&lt;/FONT&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;secParams.wszProvName = _T("Microsoft Base Cryptographic Provider v1.0");&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; es = pDb-&amp;gt;saveAs(szFileName,&amp;amp;secParams);// I want to remove their passsword&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 24 Apr 2012 03:33:15 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/any-way-to-remove-password-from-a-dwg/m-p/3427433#M14859</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-04-24T03:33:15Z</dc:date>
    </item>
    <item>
      <title>Re: any way to remove password from a dwg</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/any-way-to-remove-password-from-a-dwg/m-p/3427451#M14860</link>
      <description>&lt;P&gt;Pass NULL for the second argument to saveAs().&lt;/P&gt;</description>
      <pubDate>Tue, 24 Apr 2012 04:09:34 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/any-way-to-remove-password-from-a-dwg/m-p/3427451#M14860</guid>
      <dc:creator>owenwengerd</dc:creator>
      <dc:date>2012-04-24T04:09:34Z</dc:date>
    </item>
    <item>
      <title>Re: any way to remove password from a dwg</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/any-way-to-remove-password-from-a-dwg/m-p/3429705#M14861</link>
      <description>&lt;P&gt;thanks, but are you sure? I tried the following code,&amp;nbsp; it dosen't work. The password of the dwg still exists.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; AcDbDatabase* pDb = new AcDbDatabase(false);&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;Acad::ErrorStatus es = pDb-&amp;gt;readDwgFile(iterS-&amp;gt;c_str(),_SH_DENYWR,false,szOldPassword);&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;if (Acad::eOk == es)&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;{&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;if (_tcscmp(szPassword,_T("")) == 0)&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;{&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;es = pDb-&amp;gt;saveAs(iterS-&amp;gt;c_str(),NULL);&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;}&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;else&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;{&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;es = pDb-&amp;gt;saveAs(iterS-&amp;gt;c_str(),&amp;amp;secParams);&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;}&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;if (Acad::eOk == es ) ++nCount;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;}&lt;/P&gt;</description>
      <pubDate>Wed, 25 Apr 2012 07:48:30 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/any-way-to-remove-password-from-a-dwg/m-p/3429705#M14861</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-04-25T07:48:30Z</dc:date>
    </item>
    <item>
      <title>Re: any way to remove password from a dwg</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/any-way-to-remove-password-from-a-dwg/m-p/3429709#M14862</link>
      <description>&lt;P&gt;Try:&lt;/P&gt;
&lt;PRE&gt;secParams.wszPassword =_T("");&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 25 Apr 2012 07:58:36 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/any-way-to-remove-password-from-a-dwg/m-p/3429709#M14862</guid>
      <dc:creator>Alexander.Rivilis</dc:creator>
      <dc:date>2012-04-25T07:58:36Z</dc:date>
    </item>
    <item>
      <title>Re: any way to remove password from a dwg</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/any-way-to-remove-password-from-a-dwg/m-p/3429719#M14863</link>
      <description>&lt;P&gt;CAD enters dead loop, If I pass an empty string(not null) .&lt;/P&gt;</description>
      <pubDate>Wed, 25 Apr 2012 08:06:43 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/any-way-to-remove-password-from-a-dwg/m-p/3429719#M14863</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-04-25T08:06:43Z</dc:date>
    </item>
    <item>
      <title>Re: any way to remove password from a dwg</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/any-way-to-remove-password-from-a-dwg/m-p/3429723#M14864</link>
      <description>&lt;P&gt;What about save dwg with other filename without password?&lt;/P&gt;
&lt;P&gt;There is a method AcDbDatabase::setSecurityParams. Try pass NULL to it.&lt;/P&gt;</description>
      <pubDate>Wed, 25 Apr 2012 08:19:50 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/any-way-to-remove-password-from-a-dwg/m-p/3429723#M14864</guid>
      <dc:creator>Alexander.Rivilis</dc:creator>
      <dc:date>2012-04-25T08:19:50Z</dc:date>
    </item>
    <item>
      <title>Re: any way to remove password from a dwg</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/any-way-to-remove-password-from-a-dwg/m-p/3429747#M14865</link>
      <description>&lt;P&gt;I tried, "save as" with a new file name, but the new dwg still has the same password from the old dwg.&lt;/P&gt;</description>
      <pubDate>Wed, 25 Apr 2012 08:24:05 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/any-way-to-remove-password-from-a-dwg/m-p/3429747#M14865</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-04-25T08:24:05Z</dc:date>
    </item>
    <item>
      <title>Re: any way to remove password from a dwg</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/any-way-to-remove-password-from-a-dwg/m-p/3429797#M14866</link>
      <description>&lt;P&gt;OK. Working code:&lt;/P&gt;
&lt;PRE&gt;static bool RemovePasswordProtection(AcDbDatabase *pDb)
{
    const SecurityParams *parSecOld = pDb-&amp;gt;cloneSecurityParams();
    SecurityParams parSecNew = *parSecOld;
    parSecNew.ulFlags = 0; // Clear all security flags
    return (pDb-&amp;gt;setSecurityParams(&amp;amp;parSecNew));
}
// Main function remove password from current drawing
static void PWDRemovePwd(void)
{
    AcDbDatabase *pCurDb  = acdbCurDwg();
    AcApDocument *pCurDoc = curDoc();
    RemovePasswordProtection(pCurDb);
    pCurDb-&amp;gt;saveAs(pCurDoc-&amp;gt;fileName(),NULL);
}
&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 25 Apr 2012 09:01:07 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/any-way-to-remove-password-from-a-dwg/m-p/3429797#M14866</guid>
      <dc:creator>Alexander.Rivilis</dc:creator>
      <dc:date>2012-04-25T09:01:07Z</dc:date>
    </item>
    <item>
      <title>Re: any way to remove password from a dwg</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/any-way-to-remove-password-from-a-dwg/m-p/3429811#M14867</link>
      <description>&lt;P&gt;thanks so much. It did work.&amp;nbsp; I noticed that cad&amp;nbsp;&amp;nbsp;&lt;SPAN&gt;automatically&lt;/SPAN&gt;&amp;nbsp;remembers password , but found no way to remove this &lt;SPAN&gt;mechanism.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 25 Apr 2012 09:23:45 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/any-way-to-remove-password-from-a-dwg/m-p/3429811#M14867</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-04-25T09:23:45Z</dc:date>
    </item>
  </channel>
</rss>

