<?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: How to highlight elements when selecting them in Revit API Forum</title>
    <link>https://forums.autodesk.com/t5/revit-api-forum/how-to-highlight-elements-when-selecting-them/m-p/5746210#M71353</link>
    <description>I think my demo code could do what you want.&lt;BR /&gt;if not, would you let me know what is the problem? e.g. errors or behaviors you not expected.&lt;BR /&gt;&lt;BR /&gt;and another choice is to use PickObjects() method. Did you try that?</description>
    <pubDate>Wed, 29 Jul 2015 06:03:56 GMT</pubDate>
    <dc:creator>Aaron.Lu</dc:creator>
    <dc:date>2015-07-29T06:03:56Z</dc:date>
    <item>
      <title>How to highlight elements when selecting them</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/how-to-highlight-elements-when-selecting-them/m-p/5734258#M71346</link>
      <description>&lt;PRE&gt;List&amp;lt;ElementId&amp;gt; elemIdList = new List&amp;lt;ElementId&amp;gt;();
            try
            {
              
                while (true)
                {
                    elemIdList.Add((uidoc.Selection.PickObject(ObjectType.Element, "Pick a room").ElementId));
                    uidoc.Selection.SetElementIds(elemIdList);
                    uidoc.RefreshActiveView();
                   
                }
                
            }
            catch { }&lt;/PRE&gt;&lt;P&gt;hi friends&lt;/P&gt;&lt;P&gt;i want to highlight elements when i am selecting them like ctrl and pick objects&lt;/P&gt;&lt;P&gt;How can i do that in while loop in api?&lt;/P&gt;&lt;P&gt;Thanks in advance.....&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 22 Jul 2015 16:21:25 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/how-to-highlight-elements-when-selecting-them/m-p/5734258#M71346</guid>
      <dc:creator>desdinova</dc:creator>
      <dc:date>2015-07-22T16:21:25Z</dc:date>
    </item>
    <item>
      <title>Re: How to highlight elements when selecting them</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/how-to-highlight-elements-when-selecting-them/m-p/5741211#M71347</link>
      <description>&lt;P&gt;Dear, what about shi:&lt;/P&gt;
&lt;PRE&gt;    try
    {
        while (true)
        {
            elemIdList.Add((uidoc.Selection.PickObject(ObjectType.Element, "Pick a room").ElementId));
        }
    }
    catch 
    {
        uidoc.Selection.SetElementIds(elemIdList);
        uidoc.RefreshActiveView();
    }&lt;/PRE&gt;</description>
      <pubDate>Mon, 27 Jul 2015 02:29:47 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/how-to-highlight-elements-when-selecting-them/m-p/5741211#M71347</guid>
      <dc:creator>Aaron.Lu</dc:creator>
      <dc:date>2015-07-27T02:29:47Z</dc:date>
    </item>
    <item>
      <title>Re: How to highlight elements when selecting them</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/how-to-highlight-elements-when-selecting-them/m-p/5741368#M71348</link>
      <description>Thank you Aaron.Lu&lt;BR /&gt;It doesn't work for me.</description>
      <pubDate>Mon, 27 Jul 2015 07:37:20 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/how-to-highlight-elements-when-selecting-them/m-p/5741368#M71348</guid>
      <dc:creator>desdinova</dc:creator>
      <dc:date>2015-07-27T07:37:20Z</dc:date>
    </item>
    <item>
      <title>Re: How to highlight elements when selecting them</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/how-to-highlight-elements-when-selecting-them/m-p/5741434#M71349</link>
      <description>What is your revit version.&lt;BR /&gt;it works for me on Revit 2015.</description>
      <pubDate>Mon, 27 Jul 2015 09:01:24 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/how-to-highlight-elements-when-selecting-them/m-p/5741434#M71349</guid>
      <dc:creator>Aaron.Lu</dc:creator>
      <dc:date>2015-07-27T09:01:24Z</dc:date>
    </item>
    <item>
      <title>Re: How to highlight elements when selecting them</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/how-to-highlight-elements-when-selecting-them/m-p/5741466#M71350</link>
      <description>I use Revit 2015</description>
      <pubDate>Mon, 27 Jul 2015 09:29:54 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/how-to-highlight-elements-when-selecting-them/m-p/5741466#M71350</guid>
      <dc:creator>desdinova</dc:creator>
      <dc:date>2015-07-27T09:29:54Z</dc:date>
    </item>
    <item>
      <title>Re: How to highlight elements when selecting them</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/how-to-highlight-elements-when-selecting-them/m-p/5744140#M71351</link>
      <description>&lt;P&gt;Not sure what is the problem...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Attachment is video to demo how it works,&lt;/P&gt;
&lt;P&gt;Full code I'm using:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;    [TransactionAttribute(TransactionMode.Manual)]
    public class Pickwhile : IExternalCommand
    {
        public Document doc;
        public Autodesk.Revit.ApplicationServices.Application RevitApp;
        public Result Execute(ExternalCommandData commandData, ref string message, ElementSet elements)
        {
            RevitApp = commandData.Application.Application;
            var uidoc = commandData.Application.ActiveUIDocument;
            if (uidoc == null)
            {
                message = "Please open a document";
                return Result.Failed;
            }

            doc = commandData.Application.ActiveUIDocument.Document;
            List&amp;lt;ElementId&amp;gt; elemIdList = new List&amp;lt;ElementId&amp;gt;();
            try
            {
                while (true)
                {
                    elemIdList.Add((uidoc.Selection.PickObject(ObjectType.Element, "Pick a room").ElementId));
                }
            }
            catch
            {
                uidoc.Selection.SetElementIds(elemIdList);
                uidoc.RefreshActiveView();

                var td = new TaskDialog("Info");
                td.MainInstruction = commandData.Application.ActiveUIDocument.Selection.GetElementIds().Aggregate("", (ss, el) =&amp;gt; ss + "," + el).TrimStart(',');
                td.TitleAutoPrefix = false;
                td.Show();
            }

            return Result.Succeeded;
        }
    }&lt;/PRE&gt;</description>
      <pubDate>Tue, 28 Jul 2015 02:20:35 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/how-to-highlight-elements-when-selecting-them/m-p/5744140#M71351</guid>
      <dc:creator>Aaron.Lu</dc:creator>
      <dc:date>2015-07-28T02:20:35Z</dc:date>
    </item>
    <item>
      <title>Re: How to highlight elements when selecting them</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/how-to-highlight-elements-when-selecting-them/m-p/5744467#M71352</link>
      <description>&lt;P&gt;Hi and thank you again...&lt;/P&gt;&lt;P&gt;I want to make selection like this..&lt;/P&gt;&lt;P&gt;Please see attachment.&lt;/P&gt;&lt;P&gt;Regards...&lt;/P&gt;</description>
      <pubDate>Tue, 28 Jul 2015 09:04:32 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/how-to-highlight-elements-when-selecting-them/m-p/5744467#M71352</guid>
      <dc:creator>desdinova</dc:creator>
      <dc:date>2015-07-28T09:04:32Z</dc:date>
    </item>
    <item>
      <title>Re: How to highlight elements when selecting them</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/how-to-highlight-elements-when-selecting-them/m-p/5746210#M71353</link>
      <description>I think my demo code could do what you want.&lt;BR /&gt;if not, would you let me know what is the problem? e.g. errors or behaviors you not expected.&lt;BR /&gt;&lt;BR /&gt;and another choice is to use PickObjects() method. Did you try that?</description>
      <pubDate>Wed, 29 Jul 2015 06:03:56 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/how-to-highlight-elements-when-selecting-them/m-p/5746210#M71353</guid>
      <dc:creator>Aaron.Lu</dc:creator>
      <dc:date>2015-07-29T06:03:56Z</dc:date>
    </item>
    <item>
      <title>Re: How to highlight elements when selecting them</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/how-to-highlight-elements-when-selecting-them/m-p/5746457#M71354</link>
      <description>Thank you again&lt;BR /&gt;PickObjects() method does what i want...</description>
      <pubDate>Wed, 29 Jul 2015 10:27:44 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/how-to-highlight-elements-when-selecting-them/m-p/5746457#M71354</guid>
      <dc:creator>desdinova</dc:creator>
      <dc:date>2015-07-29T10:27:44Z</dc:date>
    </item>
  </channel>
</rss>

