<?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: SelectFileCallback for multiple files at once? in ObjectARX Forum</title>
    <link>https://forums.autodesk.com/t5/objectarx-forum/selectfilecallback-for-multiple-files-at-once/m-p/6604835#M9549</link>
    <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/3736159"&gt;@cdnbake&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;...It would be great, if I could handle all downloaded files at once in the callback...&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Sorry but it look like impossible. &lt;/P&gt;</description>
    <pubDate>Thu, 06 Oct 2016 07:55:43 GMT</pubDate>
    <dc:creator>Alexander.Rivilis</dc:creator>
    <dc:date>2016-10-06T07:55:43Z</dc:date>
    <item>
      <title>SelectFileCallback for multiple files at once?</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/selectfilecallback-for-multiple-files-at-once/m-p/6589292#M9546</link>
      <description>&lt;P&gt;Hello Community,&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;I am wondering if I can select more than one file at once using a custom SelectFileCallback.&lt;BR /&gt;In our AutoCAD add-in (2014-2017), we register the callback through&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;acdbHostApplicationServices()-&amp;gt;registerSelectFileCallback()&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This procedure must set the parameter &lt;STRONG&gt;chosenPath&lt;/STRONG&gt; to the path of the desired file, see following example:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;Acad::ErrorStatus SelectFileCallback(short * userCancel, TCHAR *&amp;amp; chosenPath, void * h, const int nFlags, const TCHAR * prompt, const TCHAR * dir, const TCHAR * name, const TCHAR * type, int * pnChoice, bool * pbReadOnly, const TCHAR * pszWSTags, void * pReserved)
{
    _bstr_t bstrMyDesiredFile = L"Path\\To\\File.dwg";
    chosenPath = new TCHAR[_tcslen(bstrMyDesiredFile) + 1];
    _tcscpy(chosenPath, bstrMyDesiredFile);&lt;BR /&gt;
    *userCancel = 0;
        
    return Acad::eOk;
}&lt;/PRE&gt;&lt;P&gt;Can I use some special string concatenation as chosenPath so that AutoCAD detects automatically, that I want to select more than one file?&lt;/P&gt;&lt;P&gt;Is this even possible at all or does this callback not support multiple files?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Kind regards,&lt;BR /&gt;Bettina&lt;/P&gt;</description>
      <pubDate>Wed, 28 Sep 2016 12:57:25 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/selectfilecallback-for-multiple-files-at-once/m-p/6589292#M9546</guid>
      <dc:creator>cdnbake</dc:creator>
      <dc:date>2016-09-28T12:57:25Z</dc:date>
    </item>
    <item>
      <title>Re: SelectFileCallback for multiple files at once?</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/selectfilecallback-for-multiple-files-at-once/m-p/6604121#M9547</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/3736159"&gt;@cdnbake&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;Hello Community,&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;I am wondering if I can select more than one file at once using a custom SelectFileCallback.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;I think this is impossible as far as docs say:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;When you use registerSelectFileCallback() to register a selectFile() function for file input, you must verify in your function that the &lt;U&gt;&lt;STRONG&gt;string passed back to AutoCAD with the chosenPath pointer is a valid filename of the correct type&lt;/STRONG&gt;&lt;/U&gt;. Failure to do so will cause an infinite loop between AutoCAD and your application. &lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So you have to return correct filename (not multiple but one).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Can you explain why you have to use this callback instead of using acedGetFileNavDialog function?&lt;/P&gt;</description>
      <pubDate>Wed, 05 Oct 2016 21:29:35 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/selectfilecallback-for-multiple-files-at-once/m-p/6604121#M9547</guid>
      <dc:creator>Alexander.Rivilis</dc:creator>
      <dc:date>2016-10-05T21:29:35Z</dc:date>
    </item>
    <item>
      <title>Re: SelectFileCallback for multiple files at once?</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/selectfilecallback-for-multiple-files-at-once/m-p/6604716#M9548</link>
      <description>&lt;P&gt;Hi Alexander,&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;thank you for your explanation, I guess I accidentally skipped that passage in the documentation, my bad. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Unfortunately, I cannot use the AutoCAD file navigaton dialog of acedGetFileNavDialog, because the user does not choose&amp;nbsp;the file(s) from his local hard drive but from a files list on a remote server which is provided by a third party application.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Those files are then downloaded and automatically loaded into the AutoCAD editor, or so they should, because at the moment, I can only handle one file at once.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The user neither&amp;nbsp;knows the exact location nor the&amp;nbsp;filenames, which are actually quite cryptical and may differ from the representation in the remote list.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In short, the workflow is something like this:&lt;/P&gt;&lt;P&gt;1) User hits Open/ Ctrl+O&lt;/P&gt;&lt;P&gt;2) Our custom SelectFileCallback activates&lt;/P&gt;&lt;P&gt;3) Calls to server&lt;/P&gt;&lt;P&gt;4) Server app (third party) displays files list&lt;/P&gt;&lt;P&gt;3) User chooses one or more files&lt;/P&gt;&lt;P&gt;4) Files are downloaded somewhere to&amp;nbsp;local hard drive&lt;/P&gt;&lt;P&gt;5) Server app tells me the absolute file paths&lt;/P&gt;&lt;P&gt;6) I take the first one and return it as chosenPath in the callback&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It would be great, if I could handle all downloaded files at once in the callback.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Kind regards,&amp;nbsp;&lt;/P&gt;&lt;P&gt;Bettina&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 06 Oct 2016 06:44:58 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/selectfilecallback-for-multiple-files-at-once/m-p/6604716#M9548</guid>
      <dc:creator>cdnbake</dc:creator>
      <dc:date>2016-10-06T06:44:58Z</dc:date>
    </item>
    <item>
      <title>Re: SelectFileCallback for multiple files at once?</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/selectfilecallback-for-multiple-files-at-once/m-p/6604835#M9549</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/3736159"&gt;@cdnbake&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;...It would be great, if I could handle all downloaded files at once in the callback...&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Sorry but it look like impossible. &lt;/P&gt;</description>
      <pubDate>Thu, 06 Oct 2016 07:55:43 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/selectfilecallback-for-multiple-files-at-once/m-p/6604835#M9549</guid>
      <dc:creator>Alexander.Rivilis</dc:creator>
      <dc:date>2016-10-06T07:55:43Z</dc:date>
    </item>
    <item>
      <title>Re: SelectFileCallback for multiple files at once?</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/selectfilecallback-for-multiple-files-at-once/m-p/6640602#M9550</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/481027"&gt;@Alexander.Rivilis﻿&lt;/a&gt;,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for your help!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I marked this thread as solved, so others with&amp;nbsp;the same problem will know that it is not possible.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;That is too bad, but we will find another way for our use case.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Kind regards,&amp;nbsp;&lt;/P&gt;&lt;P&gt;Bettina&lt;/P&gt;</description>
      <pubDate>Mon, 24 Oct 2016 05:53:38 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/selectfilecallback-for-multiple-files-at-once/m-p/6640602#M9550</guid>
      <dc:creator>cdnbake</dc:creator>
      <dc:date>2016-10-24T05:53:38Z</dc:date>
    </item>
  </channel>
</rss>

