<?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: Clear selection after CTRL + A in ObjectARX Forum</title>
    <link>https://forums.autodesk.com/t5/objectarx-forum/clear-selection-after-ctrl-a/m-p/5894034#M10683</link>
    <description>&lt;P&gt;It is my practical experience that it is best practice not to make any changes in reactor callbacks.&lt;/P&gt;&lt;P&gt;You might trigger other reactors. Even if you handle this you might run into trouble.&lt;/P&gt;&lt;P&gt;I use to store data gathered in reactor callbacks in my document data and perform any changes (in the database or selection) later.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I won't claim this to be the only and ultimate solution. But I really don't know how else you could handle your problems.&lt;/P&gt;&lt;P&gt;Good luck &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 05 Nov 2015 12:56:53 GMT</pubDate>
    <dc:creator>tbrammer</dc:creator>
    <dc:date>2015-11-05T12:56:53Z</dc:date>
    <item>
      <title>Clear selection after CTRL + A</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/clear-selection-after-ctrl-a/m-p/5891937#M10678</link>
      <description>&lt;P&gt;Hi, I found something weird. I did a simple test - wanted do the selection not possible. So I wrote simple code in pickFirstModified:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;static bool recursionGuard = false;

if(recursionGuard)
	return;

recursionGuard = true;
acedSSSetFirst( NULL, NULL );
recursionGuard = false;&lt;/PRE&gt;&lt;P&gt;And this code woks perfectly when I click entities. But when I press CTRL+A (select all) all the entities are selected but not gripped. How to clear selection after CTRL + A?&lt;/P&gt;</description>
      <pubDate>Wed, 04 Nov 2015 11:48:21 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/clear-selection-after-ctrl-a/m-p/5891937#M10678</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-11-04T11:48:21Z</dc:date>
    </item>
    <item>
      <title>Re: Clear selection after CTRL + A</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/clear-selection-after-ctrl-a/m-p/5893669#M10679</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Why do you want to modify the pickfirst set programmatically as soon as it is changed by user? &lt;EM&gt;This&lt;/EM&gt; sound a bit weird to me.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Do you want this behaviour &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;(A) within your command only? &amp;nbsp;&amp;nbsp; or&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;(B) allways?&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I don't think that it is a good idea to call &lt;FONT face="courier new,courier"&gt;acedSSSetFirst()&lt;/FONT&gt; within&amp;nbsp; &lt;FONT face="courier new,courier"&gt;pickFirstModified()&lt;/FONT&gt;.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;(A)&lt;/P&gt;&lt;P&gt;In this case your command calls some selection functions like &lt;FONT face="courier new,courier"&gt;acedSSGet()&lt;/FONT&gt;. Just call &lt;FONT face="courier new,courier"&gt;acedSSSetFirst()&lt;/FONT&gt; later in your code.&lt;/P&gt;&lt;P&gt;Make sure your command is added with the &lt;SPAN&gt;flags &lt;FONT face="courier new,courier"&gt;ACRX_CMD_USEPICKSET&lt;/FONT&gt; or&amp;nbsp; &lt;FONT face="courier new,courier"&gt;ACRX_CMD_REDRAW. &lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;(B)&lt;/P&gt;&lt;P&gt;Try to call a registered command using &lt;FONT face="courier new,courier"&gt;acDocManager-&amp;gt;sendStringToExecute(...)&lt;/FONT&gt; within &lt;FONT face="courier new,courier"&gt;pickFirstModified()&lt;/FONT&gt;.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;If you add your command without using the flags &lt;FONT face="courier new,courier"&gt;ACRX_CMD_USEPICKSET&lt;/FONT&gt; and&amp;nbsp; &lt;SPAN&gt;&lt;FONT face="courier new,courier"&gt;ACRX_CMD_REDRAW&lt;/FONT&gt;&lt;/SPAN&gt; AutoCAD will clear the pickfirst set and grips a soon as the command starts. If you want to use&amp;nbsp;&lt;FONT face="courier new,courier"&gt;acedSSSetFirst()&lt;/FONT&gt; you need to use one of these flags like this:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&lt;SPAN&gt;&amp;nbsp;acedRegCmds-&amp;gt;addCommand(L"Group", L"Cmd", L"Cmd", ACRX_CMD_MODAL|ACRX_CMD_REDRAW, &amp;amp;cmdFkt);&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;See docs for&amp;nbsp;&lt;SPAN&gt;&lt;FONT face="courier new,courier"&gt;acedSSSetFirst()&lt;/FONT&gt;&lt;/SPAN&gt; and &lt;FONT face="courier new,courier"&gt;&lt;SPAN&gt;addCommand&lt;/SPAN&gt;&lt;/FONT&gt;().&lt;/P&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>Thu, 05 Nov 2015 08:51:29 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/clear-selection-after-ctrl-a/m-p/5893669#M10679</guid>
      <dc:creator>tbrammer</dc:creator>
      <dc:date>2015-11-05T08:51:29Z</dc:date>
    </item>
    <item>
      <title>Re: Clear selection after CTRL + A</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/clear-selection-after-ctrl-a/m-p/5893812#M10680</link>
      <description>&lt;P&gt;My command uses these flags:&lt;/P&gt;&lt;P&gt;ACRX_CMD_MODAL | ACRX_CMD_USEPICKSET | ACRX_CMD_REDRAW&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But this was just simple test. Reality is much more complicated. It works like that:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1. In pickFirstModified call a callback method to another application (App B)&lt;/P&gt;&lt;P&gt;2. App B gets current selection set&lt;/P&gt;&lt;P&gt;3. App B clears selection set&lt;/P&gt;&lt;P&gt;4. App B creates new selection set - with entities that can be selected&lt;/P&gt;&lt;P&gt;5. Get back to pickFirstModified&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The problem is that my ARX application and App B (which is a dll loaded from my ARX) talks with each other through the other interface. So, you can see that this is not that simple task.&lt;/P&gt;</description>
      <pubDate>Thu, 05 Nov 2015 10:26:20 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/clear-selection-after-ctrl-a/m-p/5893812#M10680</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-11-05T10:26:20Z</dc:date>
    </item>
    <item>
      <title>Re: Clear selection after CTRL + A</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/clear-selection-after-ctrl-a/m-p/5893845#M10681</link>
      <description>&lt;P&gt;However: Move the call to App B away from pickfirstModified()!&lt;/P&gt;&lt;P&gt;Do you have the sourcecode of App B?&lt;/P&gt;&lt;P&gt;I would suggest to write the callback function so that it takes an AcDbObjectIdArray of the selected entities and returns a filtered array.&lt;/P&gt;&lt;P&gt;Than you can deal with it in your "App A" and you can modify the pickfirst set elsewhere.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Have you tried to use any of these classes:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;AcEdInputContextReactor&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; AcEdSSGetFilter&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; AcEdSSGetFilter2&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; AcEdSSGetFilter3&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; AcEdSSGetFilter4&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It seems they provide the functionality you need. From the&lt;FONT face="courier new,courier"&gt; AcEdSSGetFilter&lt;/FONT&gt; docs:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;This class is used for notification of selection set operations. Classes derived from this class can receive enhanced notification about ongoing selection set operations in AutoCAD and can modify the current selection set by adding entries to it and removing entries from it.&lt;/EM&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 05 Nov 2015 10:48:44 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/clear-selection-after-ctrl-a/m-p/5893845#M10681</guid>
      <dc:creator>tbrammer</dc:creator>
      <dc:date>2015-11-05T10:48:44Z</dc:date>
    </item>
    <item>
      <title>Re: Clear selection after CTRL + A</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/clear-selection-after-ctrl-a/m-p/5894006#M10682</link>
      <description>&lt;P&gt;Why should I keep it away from pickFirstModified? I'm asking, because there is quite a lot code to rewrite. I thought if I do some recursion guarding, everything should be ok.&lt;/P&gt;</description>
      <pubDate>Thu, 05 Nov 2015 12:47:46 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/clear-selection-after-ctrl-a/m-p/5894006#M10682</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-11-05T12:47:46Z</dc:date>
    </item>
    <item>
      <title>Re: Clear selection after CTRL + A</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/clear-selection-after-ctrl-a/m-p/5894034#M10683</link>
      <description>&lt;P&gt;It is my practical experience that it is best practice not to make any changes in reactor callbacks.&lt;/P&gt;&lt;P&gt;You might trigger other reactors. Even if you handle this you might run into trouble.&lt;/P&gt;&lt;P&gt;I use to store data gathered in reactor callbacks in my document data and perform any changes (in the database or selection) later.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I won't claim this to be the only and ultimate solution. But I really don't know how else you could handle your problems.&lt;/P&gt;&lt;P&gt;Good luck &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 05 Nov 2015 12:56:53 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/clear-selection-after-ctrl-a/m-p/5894034#M10683</guid>
      <dc:creator>tbrammer</dc:creator>
      <dc:date>2015-11-05T12:56:53Z</dc:date>
    </item>
    <item>
      <title>Re: Clear selection after CTRL + A</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/clear-selection-after-ctrl-a/m-p/5894103#M10684</link>
      <description>&lt;P&gt;It seems you were right. I moved my callback from pickFirstModified to InputContextReactor::beginQuiescentState and it seems to work. But unfortunately it still doesn't solve my other problem with selection: &lt;A href="http://forums.autodesk.com/t5/objectarx/acedsslength-gives-invalid-result/td-p/5890103" target="_blank"&gt;http://forums.autodesk.com/t5/objectarx/acedsslength-gives-invalid-result/td-p/5890103&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 05 Nov 2015 13:34:58 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/clear-selection-after-ctrl-a/m-p/5894103#M10684</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-11-05T13:34:58Z</dc:date>
    </item>
  </channel>
</rss>

