<?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: Revit API Selected Element Set order in Revit API Forum</title>
    <link>https://forums.autodesk.com/t5/revit-api-forum/revit-api-selected-element-set-order/m-p/5602143#M72855</link>
    <description>&lt;P&gt;&lt;SPAN style="font: 14px/15px FrutigerNextW04-Regular; text-align: left; color: #000000; text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; float: none; display: inline !important; white-space: normal; widows: 1; font-size-adjust: none; font-stretch: normal; background-color: #ffffff; -webkit-text-stroke-width: 0px;"&gt;This is how I have users pick in a certain order and adds the elements to a list in that order...&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;List&amp;lt;ElementId&amp;gt; elementIds = new List&amp;lt;ElementId&amp;gt;();
bool flag = true;

while (flag)
{
	try
	{
		Reference reference = uidoc.Selection.PickObject(ObjectType.Element, selFilter, "Pick elements in the desired order and hit ESC to stop picking.");
		elementIds.Add(reference.ElementId);
	}
	catch
	{
		flag = false;
	}
}&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 21 Apr 2015 22:51:15 GMT</pubDate>
    <dc:creator>Troy_Gates</dc:creator>
    <dc:date>2015-04-21T22:51:15Z</dc:date>
    <item>
      <title>Revit API Selected Element Set order</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/revit-api-selected-element-set-order/m-p/5597203#M72850</link>
      <description>&lt;P&gt;I am trying to create a very simple addin for Revit that numbers duct in a new shared parameter. The issue that I have is that the duct that I select is numbered according to the order that it is drawn in. I would prefer it to be numbered in the order of the run rather. My question is does anyone know what property of the duct is used to establish the order that objects are placed in and called out of a SelElementSet? And can this be changed or can the order in a SelElementSet be changed according to another parameter?&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Fri, 17 Apr 2015 15:04:05 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/revit-api-selected-element-set-order/m-p/5597203#M72850</guid>
      <dc:creator>jdkirk5</dc:creator>
      <dc:date>2015-04-17T15:04:05Z</dc:date>
    </item>
    <item>
      <title>Re: Revit API Selected Element Set order</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/revit-api-selected-element-set-order/m-p/5599559#M72851</link>
      <description>&lt;P&gt;Dear Jdirk5,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;As far as I know, the&amp;nbsp;&lt;SPAN&gt;SelElementSet is a set and thus unordered.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;If you wish to keep track of the order in which a user interactively selects elements, you will probably have to use PickObject, ask them to be selected one by one, and keep track of the selection order yourself.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Cheers,&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Jeremy&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 20 Apr 2015 11:33:04 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/revit-api-selected-element-set-order/m-p/5599559#M72851</guid>
      <dc:creator>jeremytammik</dc:creator>
      <dc:date>2015-04-20T11:33:04Z</dc:date>
    </item>
    <item>
      <title>Re: Revit API Selected Element Set order</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/revit-api-selected-element-set-order/m-p/5601718#M72852</link>
      <description>&lt;P&gt;Jeremy,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for the suggestion. I'll give PickObject a try, though I fear it will make the process a little tedious with lots of objects.&lt;/P&gt;&lt;P&gt;As far as I can tell the numbers are assigned to the objects in the order in which they were drawn so I may see if I can iterate through and pick the object by another parameter.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks again&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Jason&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 21 Apr 2015 18:12:39 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/revit-api-selected-element-set-order/m-p/5601718#M72852</guid>
      <dc:creator>jdkirk5</dc:creator>
      <dc:date>2015-04-21T18:12:39Z</dc:date>
    </item>
    <item>
      <title>Re: Revit API Selected Element Set order</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/revit-api-selected-element-set-order/m-p/5601730#M72853</link>
      <description>&lt;P&gt;Dear Jason,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you for your appreciation.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Yes, indeed, the integer values of the element ids are normally growing in the same order the elements were added to the database.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This is undocumented and unsupported behaviour, however, and may change at any time with no warning.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;At the moment you could gernerally (? or mostly, or often?) use that to sort the elements in the order they were added to the database, though.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Cheers,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Jeremy&lt;/P&gt;</description>
      <pubDate>Tue, 21 Apr 2015 18:21:25 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/revit-api-selected-element-set-order/m-p/5601730#M72853</guid>
      <dc:creator>jeremytammik</dc:creator>
      <dc:date>2015-04-21T18:21:25Z</dc:date>
    </item>
    <item>
      <title>Re: Revit API Selected Element Set order</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/revit-api-selected-element-set-order/m-p/5602140#M72854</link>
      <description>&lt;P&gt;Oops wrong account&lt;/P&gt;</description>
      <pubDate>Tue, 21 Apr 2015 22:51:38 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/revit-api-selected-element-set-order/m-p/5602140#M72854</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-04-21T22:51:38Z</dc:date>
    </item>
    <item>
      <title>Re: Revit API Selected Element Set order</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/revit-api-selected-element-set-order/m-p/5602143#M72855</link>
      <description>&lt;P&gt;&lt;SPAN style="font: 14px/15px FrutigerNextW04-Regular; text-align: left; color: #000000; text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; float: none; display: inline !important; white-space: normal; widows: 1; font-size-adjust: none; font-stretch: normal; background-color: #ffffff; -webkit-text-stroke-width: 0px;"&gt;This is how I have users pick in a certain order and adds the elements to a list in that order...&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;List&amp;lt;ElementId&amp;gt; elementIds = new List&amp;lt;ElementId&amp;gt;();
bool flag = true;

while (flag)
{
	try
	{
		Reference reference = uidoc.Selection.PickObject(ObjectType.Element, selFilter, "Pick elements in the desired order and hit ESC to stop picking.");
		elementIds.Add(reference.ElementId);
	}
	catch
	{
		flag = false;
	}
}&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 21 Apr 2015 22:51:15 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/revit-api-selected-element-set-order/m-p/5602143#M72855</guid>
      <dc:creator>Troy_Gates</dc:creator>
      <dc:date>2015-04-21T22:51:15Z</dc:date>
    </item>
    <item>
      <title>Re: Revit API Selected Element Set order</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/revit-api-selected-element-set-order/m-p/5613271#M72856</link>
      <description>&lt;P&gt;Thanks Troy,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I ended up using the PickObject and it seems to work great. Ideally I would have liked for my entire selection to be numbered without having to pick each piece individually as this would have been quicker, but I realise that there are sometimes complications with the ordering that require user input.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Jason Kirk&lt;/P&gt;</description>
      <pubDate>Wed, 29 Apr 2015 20:28:47 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/revit-api-selected-element-set-order/m-p/5613271#M72856</guid>
      <dc:creator>jdkirk5</dc:creator>
      <dc:date>2015-04-29T20:28:47Z</dc:date>
    </item>
  </channel>
</rss>

