<?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: acedSSLength gives invalid result in ObjectARX Forum</title>
    <link>https://forums.autodesk.com/t5/objectarx-forum/acedsslength-gives-invalid-result/m-p/5891367#M10690</link>
    <description>&lt;P&gt;You say that your application unintentionally&amp;nbsp;changes the behavior of AutoCAD's Shift-select. And you want to find out why. Right?&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Do you use functions that modify the pickfirst set?&lt;BR /&gt;Maybe even in reactors?&lt;/P&gt;</description>
    <pubDate>Tue, 03 Nov 2015 22:49:44 GMT</pubDate>
    <dc:creator>tbrammer</dc:creator>
    <dc:date>2015-11-03T22:49:44Z</dc:date>
    <item>
      <title>acedSSLength gives invalid result</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/acedsslength-gives-invalid-result/m-p/5890103#M10687</link>
      <description>&lt;P&gt;Hi, I don't know how to properly title this post. I'll try to describe it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1. Open Autocad&lt;/P&gt;&lt;P&gt;2. Draw 5 lines (let's say paralell lines)&lt;/P&gt;&lt;P&gt;3. Select them all with area (mouse move)&lt;/P&gt;&lt;P&gt;4. Now press shift and holding shift move your mouse from right lower corner into left upper - selecting all the lines.&lt;/P&gt;&lt;P&gt;If you have done all operations well, every line should be now unselected.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now, when my Autocad loads my application, there something different happens. When I select all the lines, I get pickFirstModified and everything is ok.&lt;/P&gt;&lt;P&gt;But when I'm trying to unselect them all (like I have written earlier), pickFirstModified is called, but then:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;resbuf * p = NULL;
int result = acedSSGetFirst(NULL, &amp;amp;p); //it gives me selection set
if((p != NULL) &amp;amp;&amp;amp; (result == RTNORM))
	{
		m_name[0] = p-&amp;gt;resval.rlname[0];
		m_name[1] = p-&amp;gt;resval.rlname[1];
	
		acutRelRb(p);
	}

//now, I check the length
long len;
int result = acedSSLength(m_name, &amp;amp;len);&lt;/PRE&gt;&lt;P&gt;This length gives me 4. What's more, the 4 lines on the drawing are actually still selected. Only one is unselected. Does anyone of you knows the reason why?&lt;/P&gt;</description>
      <pubDate>Tue, 03 Nov 2015 12:19:16 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/acedsslength-gives-invalid-result/m-p/5890103#M10687</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-11-03T12:19:16Z</dc:date>
    </item>
    <item>
      <title>Re: acedSSLength gives invalid result</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/acedsslength-gives-invalid-result/m-p/5890235#M10688</link>
      <description>&lt;P&gt;can't understand, what makes you think that you unselect objects?&lt;/P&gt;&lt;P&gt;nevermind)))&lt;/P&gt;&lt;P&gt;for selecting:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;ads_name _preselect, en1;&lt;BR /&gt;AcDbObjectIdArray wantedObjectsToBeSelected;// fill it with ids
acedSSAdd(0,0,_preselect);&lt;BR /&gt;for (int i = 0; i &amp;lt; wantedObjectsToBeSelected.length(); i++)&lt;BR /&gt;{
  acdbGetAdsName(en1,wantedObjectsToBeSelected.at(i));
  acedSSAdd(en1,_preselect,_preselect);&lt;BR /&gt;}
acedSSSetFirst(_preselect, NULL);&lt;BR /&gt;acedSSFree(_preselect);&lt;/PRE&gt;&lt;P&gt;to&amp;nbsp;clear selection:&lt;/P&gt;&lt;PRE&gt;acedSSSetFirst(NULL, NULL);&lt;/PRE&gt;&lt;P&gt;and, can't remember exactly, but it seems, that &amp;nbsp;flags&amp;nbsp;ACRX_CMD_USEPICKSET | ACRX_CMD_REDRAW have to be added to your command description&lt;/P&gt;&lt;P&gt;PS: about your code... it must crush autocad )))&lt;/P&gt;&lt;P&gt;if you want to get ids of preselect, you have to use something like this:&lt;/P&gt;&lt;PRE&gt;AcDbObjectIdArray preSelect(bool clearSelection = false)
{
	AcApDocument * pDoc = acDocManager-&amp;gt;mdiActiveDocument();
	acDocManager-&amp;gt;lockDocument(pDoc);

	AcDbObjectId eId;
	AcDbObjectIdArray entArr; entArr.removeAll();
	ads_name ent, one_ent;
	long len = 0L;
	struct resbuf *grip_set = NULL, *ents = NULL;
	int res = acedSSGetFirst(&amp;amp;grip_set, &amp;amp;ents);
	if (res == RTNORM)
	{
		if (ents) 
		{
			if (ents -&amp;gt;restype == RTPICKS) 
			{		
				acedSSLength(ents-&amp;gt;resval.rlname, &amp;amp;len);

				for (long a = 0; a &amp;lt; len; a++)
				{
					if (ads_ssname(ents-&amp;gt;resval.rlname,a,one_ent)!=RTNORM)continue;
					if(acdbGetObjectId(eId, one_ent)!= Acad::eOk)continue;
					entArr.append(eId);
				}
				acedSSFree(ents-&amp;gt;resval.rlname);
			}
			acutRelRb(ents);
		}

		if (grip_set) 
		{
			if (grip_set-&amp;gt;restype == RTPICKS) acedSSFree(grip_set-&amp;gt;resval.rlname);
			acutRelRb(grip_set);
		}
	}

	if (clearSelection)
		acedSSSetFirst(NULL, NULL);

	acDocManager-&amp;gt;unlockDocument(pDoc);
	return entArr;
}&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 03 Nov 2015 13:33:36 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/acedsslength-gives-invalid-result/m-p/5890235#M10688</guid>
      <dc:creator>nick83</dc:creator>
      <dc:date>2015-11-03T13:33:36Z</dc:date>
    </item>
    <item>
      <title>Re: acedSSLength gives invalid result</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/acedsslength-gives-invalid-result/m-p/5890328#M10689</link>
      <description>&lt;P&gt;I don't think you understand my problem. Maybe because title of the post may not be the proper one.&lt;/P&gt;&lt;P&gt;One more time:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When I have 5 lines selected and want to unselect them - on the drawing - I can press shift and while holding shift drag mouse over the entities I want to unselect. After this operation, when my application is loaded only one line is unselected. Not all of them.&lt;/P&gt;</description>
      <pubDate>Tue, 03 Nov 2015 14:12:17 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/acedsslength-gives-invalid-result/m-p/5890328#M10689</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-11-03T14:12:17Z</dc:date>
    </item>
    <item>
      <title>Re: acedSSLength gives invalid result</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/acedsslength-gives-invalid-result/m-p/5891367#M10690</link>
      <description>&lt;P&gt;You say that your application unintentionally&amp;nbsp;changes the behavior of AutoCAD's Shift-select. And you want to find out why. Right?&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Do you use functions that modify the pickfirst set?&lt;BR /&gt;Maybe even in reactors?&lt;/P&gt;</description>
      <pubDate>Tue, 03 Nov 2015 22:49:44 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/acedsslength-gives-invalid-result/m-p/5891367#M10690</guid>
      <dc:creator>tbrammer</dc:creator>
      <dc:date>2015-11-03T22:49:44Z</dc:date>
    </item>
    <item>
      <title>Re: acedSSLength gives invalid result</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/acedsslength-gives-invalid-result/m-p/5891771#M10691</link>
      <description>&lt;P&gt;You posted &lt;A title="Selection set changed" href="https://forums.autodesk.com/t5/objectarx/selection-set-changed/m-p/5854149" target="_blank"&gt;this&lt;/A&gt; recently. Do you use an &lt;FONT face="courier new,courier"&gt;AcEdSSGetFilter&lt;/FONT&gt;?&lt;/P&gt;</description>
      <pubDate>Wed, 04 Nov 2015 08:19:49 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/acedsslength-gives-invalid-result/m-p/5891771#M10691</guid>
      <dc:creator>tbrammer</dc:creator>
      <dc:date>2015-11-04T08:19:49Z</dc:date>
    </item>
    <item>
      <title>Re: acedSSLength gives invalid result</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/acedsslength-gives-invalid-result/m-p/5891818#M10692</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/845950"&gt;@tbrammer&lt;/a&gt; wrote:&lt;BR /&gt;You say that your application unintentionally&amp;nbsp;changes the behavior of AutoCAD's Shift-select. And you want to find out why. Right?&lt;BR /&gt;&lt;BR /&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Exactly.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/845950"&gt;@tbrammer&lt;/a&gt; wrote:&lt;BR /&gt;&lt;P&gt;You posted &lt;A title="Selection set changed" href="https://forums.autodesk.com/t5/objectarx/selection-set-changed/m-p/5854149" target="_blank"&gt;this&lt;/A&gt; recently. Do you use an &lt;FONT face="courier new,courier"&gt;AcEdSSGetFilter&lt;/FONT&gt;?&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Actually I do. I mean I have this reactor connected to the document, but all the methods are empty.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 04 Nov 2015 09:34:57 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/acedsslength-gives-invalid-result/m-p/5891818#M10692</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-11-04T09:34:57Z</dc:date>
    </item>
    <item>
      <title>Re: acedSSLength gives invalid result</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/acedsslength-gives-invalid-result/m-p/5895922#M10693</link>
      <description>&lt;P&gt;It has occured that it works fine in Autocad 2014. Code is the same.&lt;/P&gt;</description>
      <pubDate>Fri, 06 Nov 2015 10:50:01 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/acedsslength-gives-invalid-result/m-p/5895922#M10693</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-11-06T10:50:01Z</dc:date>
    </item>
  </channel>
</rss>

