<?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 RealDWG problem with layouts and plot settings in ObjectARX Forum</title>
    <link>https://forums.autodesk.com/t5/objectarx-forum/realdwg-problem-with-layouts-and-plot-settings/m-p/6803815#M8895</link>
    <description>&lt;P&gt;I have a module called "DocManager" implemented in an ARX that creates a bunch of DWG files.&lt;BR /&gt;I have also ported the DocManager module to a RealDWG application.&lt;BR /&gt;The attached drawing AutoCAD.dwg was created by the ARX, RealDWG.dwg was created by the RealDWG-app.&lt;BR /&gt;&lt;BR /&gt;The ARX-DWGs are ok:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Acad (AutoCAD) and the ACC (AutoCAD Core Console accoreconsole.exe) read them without complaints&lt;/LI&gt;
&lt;LI&gt;Acad and ACC are able to "plot" their layout "DIN-A4" as PDF with the _-plot command&lt;/LI&gt;
&lt;LI&gt;We can also plot them to PDF using Forge&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;The RealDWG-DWGs have some issues:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;When I try to run ACC with the DWG it says: "ERROR: Something went wrong. ErrorStatus=53." and quits.&lt;/LI&gt;
&lt;LI&gt;When I open them in Acad, a dialog pops up an says: "Drawing must be recovered. Errors found" (translated from German). I have to click [Recover]. Than a dialog says: "AUDIT didn't find any errors". The drawing appears and looks ok. Than I can plot it as PDF with Acad. If I save it I can also load and plot it as PDF with the ACC.&lt;/LI&gt;
&lt;LI&gt;Plotting to PDF via Forge works - but the layout isn't scaled correctly&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;What is going on here? It looks as if Acad "repairs" something that is missing in the RealDWG application.&lt;BR /&gt;I don't know how I can find out what is wrong with the RealDWG DWGs. I suppose it has something to do with the layout initialization/validation.&lt;BR /&gt;&lt;BR /&gt;In RealDWG I have to write my own &lt;FONT face="courier new,courier"&gt;AcDbLayoutManager / AcApLayoutManager&lt;/FONT&gt;. I named my class "&lt;FONT face="courier new,courier"&gt;imosRealDwgAcDbLayoutManager&lt;/FONT&gt;".&lt;BR /&gt;My &lt;FONT face="courier new,courier"&gt;acdbHostApplicationServices()-&amp;gt;layoutManager()&lt;/FONT&gt; returns an instance of &lt;FONT face="courier new,courier"&gt;imosRealDwgAcDbLayoutManager&lt;/FONT&gt;.&lt;BR /&gt;There are some methods I have implemented as dummies, because I don't know how to write them:&lt;BR /&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp; void imosRealDwgAcDbLayoutManager::setDefaultPlotConfig(AcDbObjectId layoutBTRId)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp; void imosRealDwgAcDbLayoutManager::updateCurrentPaper(Adesk::Boolean zoomToPaper /*= FALSE*/)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp; void imosRealDwgAcDbLayoutManager::updateLayoutTabs()&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;Also my method&amp;nbsp; &lt;FONT face="courier new,courier"&gt;AcDbPlotSettingsValidator* HostApp::plotSettingsValidator() const&lt;/FONT&gt;&amp;nbsp;&amp;nbsp; currently returns NULL because I have no Idea how to implement an &lt;FONT face="courier new,courier"&gt;AcDbPlotSettingsValidator&lt;/FONT&gt;. So in RealDWG my code:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;PRE&gt;    AcDbPlotSettingsValidator* pPltValid = acdbHostApplicationServices()-&amp;gt;plotSettingsValidator();
    if (pPltValid)
    {
        pPltValid-&amp;gt;setCanonicalMediaName(pNewLayout, chrMediaName);
        pPltValid-&amp;gt;refreshLists(pNewLayout);
    }&lt;/PRE&gt;
&lt;P&gt;won't do anything. How can I implement these methods?&lt;BR /&gt;Or is there an AcDbPlotSettingsValidator in RealDWG that I can use?&lt;BR /&gt;&lt;BR /&gt;It may be important to say, that the DocManager creates, populates and saves &lt;FONT face="courier new,courier"&gt;AcDbDatabase&lt;/FONT&gt;s that are not assigned to an &lt;FONT face="courier new,courier"&gt;AcApDocument&lt;/FONT&gt;. &lt;BR /&gt;They are also not the &lt;FONT face="courier new,courier"&gt;acdbHostApplicationServices()-&amp;gt;workingDatabase()&lt;/FONT&gt;.&lt;BR /&gt;I use code from&amp;nbsp;&lt;A title="copying-a-plotting-setting-from-one-drawing-to-another" href="http://adndevblog.typepad.com/autocad/2012/04/copying-a-plotting-setting-from-one-drawing-to-another.html" target="_blank"&gt;here&lt;/A&gt; to copy plotsettings from one template DWG to my target DWG.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Any help and ideas are appreciated.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 13 Jan 2017 14:15:23 GMT</pubDate>
    <dc:creator>tbrammer</dc:creator>
    <dc:date>2017-01-13T14:15:23Z</dc:date>
    <item>
      <title>RealDWG problem with layouts and plot settings</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/realdwg-problem-with-layouts-and-plot-settings/m-p/6803815#M8895</link>
      <description>&lt;P&gt;I have a module called "DocManager" implemented in an ARX that creates a bunch of DWG files.&lt;BR /&gt;I have also ported the DocManager module to a RealDWG application.&lt;BR /&gt;The attached drawing AutoCAD.dwg was created by the ARX, RealDWG.dwg was created by the RealDWG-app.&lt;BR /&gt;&lt;BR /&gt;The ARX-DWGs are ok:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Acad (AutoCAD) and the ACC (AutoCAD Core Console accoreconsole.exe) read them without complaints&lt;/LI&gt;
&lt;LI&gt;Acad and ACC are able to "plot" their layout "DIN-A4" as PDF with the _-plot command&lt;/LI&gt;
&lt;LI&gt;We can also plot them to PDF using Forge&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;The RealDWG-DWGs have some issues:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;When I try to run ACC with the DWG it says: "ERROR: Something went wrong. ErrorStatus=53." and quits.&lt;/LI&gt;
&lt;LI&gt;When I open them in Acad, a dialog pops up an says: "Drawing must be recovered. Errors found" (translated from German). I have to click [Recover]. Than a dialog says: "AUDIT didn't find any errors". The drawing appears and looks ok. Than I can plot it as PDF with Acad. If I save it I can also load and plot it as PDF with the ACC.&lt;/LI&gt;
&lt;LI&gt;Plotting to PDF via Forge works - but the layout isn't scaled correctly&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;What is going on here? It looks as if Acad "repairs" something that is missing in the RealDWG application.&lt;BR /&gt;I don't know how I can find out what is wrong with the RealDWG DWGs. I suppose it has something to do with the layout initialization/validation.&lt;BR /&gt;&lt;BR /&gt;In RealDWG I have to write my own &lt;FONT face="courier new,courier"&gt;AcDbLayoutManager / AcApLayoutManager&lt;/FONT&gt;. I named my class "&lt;FONT face="courier new,courier"&gt;imosRealDwgAcDbLayoutManager&lt;/FONT&gt;".&lt;BR /&gt;My &lt;FONT face="courier new,courier"&gt;acdbHostApplicationServices()-&amp;gt;layoutManager()&lt;/FONT&gt; returns an instance of &lt;FONT face="courier new,courier"&gt;imosRealDwgAcDbLayoutManager&lt;/FONT&gt;.&lt;BR /&gt;There are some methods I have implemented as dummies, because I don't know how to write them:&lt;BR /&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp; void imosRealDwgAcDbLayoutManager::setDefaultPlotConfig(AcDbObjectId layoutBTRId)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp; void imosRealDwgAcDbLayoutManager::updateCurrentPaper(Adesk::Boolean zoomToPaper /*= FALSE*/)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp; void imosRealDwgAcDbLayoutManager::updateLayoutTabs()&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;Also my method&amp;nbsp; &lt;FONT face="courier new,courier"&gt;AcDbPlotSettingsValidator* HostApp::plotSettingsValidator() const&lt;/FONT&gt;&amp;nbsp;&amp;nbsp; currently returns NULL because I have no Idea how to implement an &lt;FONT face="courier new,courier"&gt;AcDbPlotSettingsValidator&lt;/FONT&gt;. So in RealDWG my code:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;PRE&gt;    AcDbPlotSettingsValidator* pPltValid = acdbHostApplicationServices()-&amp;gt;plotSettingsValidator();
    if (pPltValid)
    {
        pPltValid-&amp;gt;setCanonicalMediaName(pNewLayout, chrMediaName);
        pPltValid-&amp;gt;refreshLists(pNewLayout);
    }&lt;/PRE&gt;
&lt;P&gt;won't do anything. How can I implement these methods?&lt;BR /&gt;Or is there an AcDbPlotSettingsValidator in RealDWG that I can use?&lt;BR /&gt;&lt;BR /&gt;It may be important to say, that the DocManager creates, populates and saves &lt;FONT face="courier new,courier"&gt;AcDbDatabase&lt;/FONT&gt;s that are not assigned to an &lt;FONT face="courier new,courier"&gt;AcApDocument&lt;/FONT&gt;. &lt;BR /&gt;They are also not the &lt;FONT face="courier new,courier"&gt;acdbHostApplicationServices()-&amp;gt;workingDatabase()&lt;/FONT&gt;.&lt;BR /&gt;I use code from&amp;nbsp;&lt;A title="copying-a-plotting-setting-from-one-drawing-to-another" href="http://adndevblog.typepad.com/autocad/2012/04/copying-a-plotting-setting-from-one-drawing-to-another.html" target="_blank"&gt;here&lt;/A&gt; to copy plotsettings from one template DWG to my target DWG.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Any help and ideas are appreciated.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 13 Jan 2017 14:15:23 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/realdwg-problem-with-layouts-and-plot-settings/m-p/6803815#M8895</guid>
      <dc:creator>tbrammer</dc:creator>
      <dc:date>2017-01-13T14:15:23Z</dc:date>
    </item>
  </channel>
</rss>

