<?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: AcEdSSGetFilter Remove item from selection - Not Working in ObjectARX Forum</title>
    <link>https://forums.autodesk.com/t5/objectarx-forum/acedssgetfilter-remove-item-from-selection-not-working/m-p/6883822#M8734</link>
    <description>&lt;P&gt;Even without the transaction stuff, it still doesn't work for me.&lt;/P&gt;</description>
    <pubDate>Thu, 16 Feb 2017 20:16:31 GMT</pubDate>
    <dc:creator>Kyudos</dc:creator>
    <dc:date>2017-02-16T20:16:31Z</dc:date>
    <item>
      <title>AcEdSSGetFilter Remove item from selection - Not Working</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/acedssgetfilter-remove-item-from-selection-not-working/m-p/6881356#M8732</link>
      <description>&lt;P&gt;During one of my commands I need to limit what the user is allowed to select, so I'm using&amp;nbsp;&lt;STRONG&gt;AcEdSSGetFilter::endSSGet&lt;/STRONG&gt;. However, even though my remove call comes back OK, the things I don't want to be selected are still selected. What am I doing wrong?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Code:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;//------------------------------------------------------------------------------
void MySelectionReactor::endSSGet(Acad::PromptStatus returnStatus, int ssgetFlags, AcEdSelectionSetService&amp;amp; service, const AcDbObjectIdArray&amp;amp; selectionSet)
//------------------------------------------------------------------------------
{
    Acad::ErrorStatus es = Acad::eOk;
    if (pApp-&amp;gt;VetoActive())
    {
        CADManager.StartTransaction(__FUNCTION__);

        for (int i = 0; i &amp;lt; selectionSet.length(); i++)
        {
            AcDbObjectId id = selectionSet.at(i);
            AcDbObject* pObject = CADManager.GetAcDbObject(id, AcDb::kForRead);
            AcDbBlockReference* pBlockReference = dynamic_cast&amp;lt;AcDbBlockReference*&amp;gt;(pObject);
            MyClass* pMine = dynamic_cast&amp;lt;MyClass*&amp;gt;(pObject);
            if (pBlockReference == NULL)
            {
                es = service.remove(i);
            }
            else if (pMine != NULL)
            {
                es = service.remove(i);
            }
        }

        CADManager.EndTransaction(__FUNCTION__);
    }
}&lt;/PRE&gt;
&lt;P&gt;(I only want to allow the user to click on block reference objects, except a specific type of block reference object - MyClass)&lt;/P&gt;</description>
      <pubDate>Thu, 16 Feb 2017 02:25:40 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/acedssgetfilter-remove-item-from-selection-not-working/m-p/6881356#M8732</guid>
      <dc:creator>Kyudos</dc:creator>
      <dc:date>2017-02-16T02:25:40Z</dc:date>
    </item>
    <item>
      <title>Re: AcEdSSGetFilter Remove item from selection - Not Working</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/acedssgetfilter-remove-item-from-selection-not-working/m-p/6881498#M8733</link>
      <description>&lt;P&gt;This code i have tested with my custom blockreference and it will work fine:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;void MySelectionReactor::endSSGet(Acad::PromptStatus returnStatus, int ssgetFlags, AcEdSelectionSetService &amp;amp;service, const AcDbObjectIdArray&amp;amp; selectionSet)
{
	if (returnStatus != Acad::eNormal)
	{
		return;
	}

	for (int i = 0; i &amp;lt; selectionSet.length(); i++)
	{
		AcDbObjectId id = selectionSet.at(i);

		AcDbObject* pObject;

		if (acdbOpenObject(pObject, id, AcDb::kForRead) == Acad::eOk)
		{
			AcDbBlockReference* pBlockReference = dynamic_cast&amp;lt;AcDbBlockReference*&amp;gt;(pObject);

			MyClass* pMine = dynamic_cast&amp;lt;MyClass*&amp;gt;(pObject);

			if (pBlockReference == NULL)
			{
				service.remove(i);
			}
			else if (pMine != NULL)
			{
				service.remove(i);
			}

			pObject-&amp;gt;close();
		}
	}
}&lt;/PRE&gt;</description>
      <pubDate>Thu, 16 Feb 2017 05:20:56 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/acedssgetfilter-remove-item-from-selection-not-working/m-p/6881498#M8733</guid>
      <dc:creator>BerndCuder8196</dc:creator>
      <dc:date>2017-02-16T05:20:56Z</dc:date>
    </item>
    <item>
      <title>Re: AcEdSSGetFilter Remove item from selection - Not Working</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/acedssgetfilter-remove-item-from-selection-not-working/m-p/6883822#M8734</link>
      <description>&lt;P&gt;Even without the transaction stuff, it still doesn't work for me.&lt;/P&gt;</description>
      <pubDate>Thu, 16 Feb 2017 20:16:31 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/acedssgetfilter-remove-item-from-selection-not-working/m-p/6883822#M8734</guid>
      <dc:creator>Kyudos</dc:creator>
      <dc:date>2017-02-16T20:16:31Z</dc:date>
    </item>
    <item>
      <title>Re: AcEdSSGetFilter Remove item from selection - Not Working</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/acedssgetfilter-remove-item-from-selection-not-working/m-p/6883898#M8735</link>
      <description>Are you sure your reactor is loaded and endSSGet is called? What happens in debug mode when you set an stop mark at the loop with selectionSet?</description>
      <pubDate>Thu, 16 Feb 2017 20:41:39 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/acedssgetfilter-remove-item-from-selection-not-working/m-p/6883898#M8735</guid>
      <dc:creator>BerndCuder8196</dc:creator>
      <dc:date>2017-02-16T20:41:39Z</dc:date>
    </item>
    <item>
      <title>Re: AcEdSSGetFilter Remove item from selection - Not Working</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/acedssgetfilter-remove-item-from-selection-not-working/m-p/6883916#M8736</link>
      <description>&lt;P&gt;That is basically the problem - it is definitely active, I get to the "&lt;STRONG&gt;service.remove&lt;/STRONG&gt;"&amp;nbsp;lines at the correct times (after clicking a MyClass object for instance), and the debugger shows that those calls return &lt;STRONG&gt;eOk&lt;/STRONG&gt;. It just doesn't &lt;EM&gt;actually&lt;/EM&gt; remove that thing from the selection - it is still highlighted in the interface and in still in the array when I get to my other selection handlers (e.g. in&amp;nbsp;&lt;STRONG&gt;AcEdInputContextReactor::endSSGet&lt;/STRONG&gt;).&lt;/P&gt;</description>
      <pubDate>Thu, 16 Feb 2017 20:47:39 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/acedssgetfilter-remove-item-from-selection-not-working/m-p/6883916#M8736</guid>
      <dc:creator>Kyudos</dc:creator>
      <dc:date>2017-02-16T20:47:39Z</dc:date>
    </item>
    <item>
      <title>Re: AcEdSSGetFilter Remove item from selection - Not Working</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/acedssgetfilter-remove-item-from-selection-not-working/m-p/6883958#M8737</link>
      <description>Have you tested turn off the other reactors? Maybe there is an problem. As I posted before, the code works fine in AutoCAD 2017 on my computer.&lt;BR /&gt;Info: service.remove doesn't work synchronized, it removes the indicies at end of endSSGet.</description>
      <pubDate>Thu, 16 Feb 2017 21:04:22 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/acedssgetfilter-remove-item-from-selection-not-working/m-p/6883958#M8737</guid>
      <dc:creator>BerndCuder8196</dc:creator>
      <dc:date>2017-02-16T21:04:22Z</dc:date>
    </item>
    <item>
      <title>Re: AcEdSSGetFilter Remove item from selection - Not Working</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/acedssgetfilter-remove-item-from-selection-not-working/m-p/6884058#M8738</link>
      <description>&lt;P&gt;I got it to work! I took my code and moved it from&amp;nbsp;&lt;STRONG&gt;endSSGet&lt;/STRONG&gt; to&amp;nbsp;&lt;STRONG&gt;ssgetAddFilter&lt;/STRONG&gt; and analysed the &lt;STRONG&gt;subSelectionSet&lt;/STRONG&gt; for the remove.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Not sure why one works and the other doesn't, but it works so I don't care &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 16 Feb 2017 21:37:07 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/acedssgetfilter-remove-item-from-selection-not-working/m-p/6884058#M8738</guid>
      <dc:creator>Kyudos</dc:creator>
      <dc:date>2017-02-16T21:37:07Z</dc:date>
    </item>
  </channel>
</rss>

