<?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: How to suppress user prompt during IAcadDocumentPtr::Export ? in ObjectARX Forum</title>
    <link>https://forums.autodesk.com/t5/objectarx-forum/how-to-suppress-user-prompt-during-iacaddocumentptr-export/m-p/6405321#M9958</link>
    <description>&lt;P&gt;Hello everyone,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I got the export working without AutoCAD prompting for an object selection!&amp;nbsp;&lt;img id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://forums.autodesk.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I simply had to call the method&amp;nbsp;Select() on my previously created SelectionSet:&lt;/P&gt;&lt;PRE&gt;_variant_t variantEmpty;
variantEmpty.vt = VT_ERROR;
variantEmpty.lVal = DISP_E_PARAMNOTFOUND;
HRESULT hr = pSelectionSet-&amp;gt;Select(acSelectionSetAll, variantEmpty, variantEmpty, variantEmpty, variantEmpty);&lt;/PRE&gt;&lt;P&gt;Now after calling&amp;nbsp;pActiveDoc-&amp;gt;Export() a BMP-Image gets saved as desired.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Have a nice day,&amp;nbsp;&lt;/P&gt;&lt;P&gt;Bettina&lt;/P&gt;</description>
    <pubDate>Mon, 27 Jun 2016 07:17:31 GMT</pubDate>
    <dc:creator>cdnbake</dc:creator>
    <dc:date>2016-06-27T07:17:31Z</dc:date>
    <item>
      <title>How to suppress user prompt during IAcadDocumentPtr::Export ?</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/how-to-suppress-user-prompt-during-iacaddocumentptr-export/m-p/6402066#M9957</link>
      <description>&lt;P&gt;Good morning,&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;In my ARX module for ACAD 2014-2017, I am trying to export the current view to an image file by using the method IAcadDocumentPtr::Export.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;After creating a selection set, I call the function as follows:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;IAcadDocumentPtr pActiveDoc;
/* determination of active document omitted */&lt;BR /&gt;
IAcadSelectionSetsPtr pSelectionSets = NULL;
pActiveDoc-&amp;gt;get_SelectionSets(&amp;amp;pSelectionSets);&lt;BR /&gt;
IAcadSelectionSetPtr pSelectionSet = NULL;
_bstr_t bstrtSelectSetName(L"SelectAll");
hr = pSelectionSets-&amp;gt;Add(bstrtSelectSetName, &amp;amp;pSelectionSet);&lt;BR /&gt;
hr = pActiveDoc-&amp;gt;Export(bstrThumbnailFullFileName, _T("bmp"), pSelectionSet);&lt;BR /&gt;
hr = pSelectionSet-&amp;gt;Delete();&lt;/PRE&gt;&lt;P&gt;&lt;EM&gt;(I omitted error handling and NULL checks in favour of readability.)&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;While executing &lt;STRONG&gt;pActiveDoc-&amp;gt;Export&lt;/STRONG&gt;, AutoCAD prompts me for a selection anyways: "Select objects or &amp;lt;all objects and viewports&amp;gt;:".&lt;BR /&gt;Do I need to suppress this user prompt explicitly?&lt;/P&gt;&lt;P&gt;If so, then why do I have to pass a selection set to the method in the first place?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I also read &lt;A href="http://adndevblog.typepad.com/autocad/2013/02/create-bitmap-of-selected-entities.html" target="_self"&gt;this&lt;/A&gt; article and tried&lt;/P&gt;&lt;PRE&gt;hr = pActiveDoc-&amp;gt;get_ActiveSelectionSet(&amp;amp;pSelectionSet);&lt;/PRE&gt;&lt;P&gt;beforehand, but the result was the same.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It would be great if someone could help me with that.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Have a nice day,&lt;BR /&gt;Bettina&lt;/P&gt;</description>
      <pubDate>Fri, 24 Jun 2016 09:21:46 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/how-to-suppress-user-prompt-during-iacaddocumentptr-export/m-p/6402066#M9957</guid>
      <dc:creator>cdnbake</dc:creator>
      <dc:date>2016-06-24T09:21:46Z</dc:date>
    </item>
    <item>
      <title>Re: How to suppress user prompt during IAcadDocumentPtr::Export ?</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/how-to-suppress-user-prompt-during-iacaddocumentptr-export/m-p/6405321#M9958</link>
      <description>&lt;P&gt;Hello everyone,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I got the export working without AutoCAD prompting for an object selection!&amp;nbsp;&lt;img id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://forums.autodesk.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I simply had to call the method&amp;nbsp;Select() on my previously created SelectionSet:&lt;/P&gt;&lt;PRE&gt;_variant_t variantEmpty;
variantEmpty.vt = VT_ERROR;
variantEmpty.lVal = DISP_E_PARAMNOTFOUND;
HRESULT hr = pSelectionSet-&amp;gt;Select(acSelectionSetAll, variantEmpty, variantEmpty, variantEmpty, variantEmpty);&lt;/PRE&gt;&lt;P&gt;Now after calling&amp;nbsp;pActiveDoc-&amp;gt;Export() a BMP-Image gets saved as desired.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Have a nice day,&amp;nbsp;&lt;/P&gt;&lt;P&gt;Bettina&lt;/P&gt;</description>
      <pubDate>Mon, 27 Jun 2016 07:17:31 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/how-to-suppress-user-prompt-during-iacaddocumentptr-export/m-p/6405321#M9958</guid>
      <dc:creator>cdnbake</dc:creator>
      <dc:date>2016-06-27T07:17:31Z</dc:date>
    </item>
    <item>
      <title>Re: How to suppress user prompt during IAcadDocumentPtr::Export ?</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/how-to-suppress-user-prompt-during-iacaddocumentptr-export/m-p/6407846#M9959</link>
      <description>&lt;P&gt;&lt;STRONG&gt;Update:&lt;/STRONG&gt; I have to add a small note&amp;nbsp;about the method&amp;nbsp;IAcadSelectionSet::&lt;SPAN&gt;Select().&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you call it on an empty drawing with no objects in it, for example right after creating a new file, the selection set will be empty as well and the IAcadDocument::Export() method will prompt you for input again.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For this special case, I had to set up a timer which fires VK_RETURN into the AutoCAD console to simply confirm that I want to export the whole viewport.&lt;/P&gt;&lt;PRE&gt;// if selection set is empty send timed VK_RETURN
long lCount = 0;
hr = pSelectionSet-&amp;gt;get_Count(&amp;amp;count);
if (lCount == 0)
{
  acedGetAcadFrame()-&amp;gt;SetTimer( SEND_VK_RETURN_TO_COMMANDLINE_START, 500, NULL);
}&lt;/PRE&gt;&lt;P&gt;I know this is a bit error prone, since it completely relies on the windows hook finding the correct&amp;nbsp;application window where it can post the key event just in time. Thus, if someone has a better solution in petto,&amp;nbsp;I will happily change it.&amp;nbsp;&lt;img id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://forums.autodesk.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Have a nice day,&amp;nbsp;&lt;/P&gt;&lt;P&gt;Bettina&lt;/P&gt;</description>
      <pubDate>Tue, 28 Jun 2016 11:00:34 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/how-to-suppress-user-prompt-during-iacaddocumentptr-export/m-p/6407846#M9959</guid>
      <dc:creator>cdnbake</dc:creator>
      <dc:date>2016-06-28T11:00:34Z</dc:date>
    </item>
  </channel>
</rss>

