<?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 retrieve ID of selected object in .NET Forum</title>
    <link>https://forums.autodesk.com/t5/net-forum/how-to-retrieve-id-of-selected-object/m-p/6870043#M32791</link>
    <description>&lt;P&gt;Excellent! thank you very much. That worked great&lt;/P&gt;</description>
    <pubDate>Fri, 10 Feb 2017 19:50:29 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2017-02-10T19:50:29Z</dc:date>
    <item>
      <title>How to retrieve ID of selected object</title>
      <link>https://forums.autodesk.com/t5/net-forum/how-to-retrieve-id-of-selected-object/m-p/6869425#M32789</link>
      <description>&lt;P&gt;My goal here is to get the ID of my selected object without using a prompt. For example, the user clicks on a rectangle in the drawing and then clicks on a button from my custom menu. I want to be able to retrieve the ID of this rectangle without getting prompted to pick it first.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Right now I'm trying to get the selection set using the PromptSelectionResult value, which asks me to choose the object.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm guessing there's an easy way of doing this but I can't seem to figure it out... Hopefully this makes sense?&lt;/P&gt;</description>
      <pubDate>Fri, 10 Feb 2017 16:36:09 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/how-to-retrieve-id-of-selected-object/m-p/6869425#M32789</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-02-10T16:36:09Z</dc:date>
    </item>
    <item>
      <title>Re : How to retrieve ID of selected object</title>
      <link>https://forums.autodesk.com/t5/net-forum/how-to-retrieve-id-of-selected-object/m-p/6869987#M32790</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you want to get the pickfirst set content, the button event handler shoud call a cutom command with the Commandflags.UsePickFirst:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;        [CommandMethod("foo", CommandFlags.UsePickSet)]
        public void Foo()
        {
            var ed = AcAp.DocumentManager.MdiActiveDocument.Editor;
            var selection = ed.SelectImplied();
            if (selection.Status == PromptStatus.OK)
            {
                if (selection.Value.Count == 1)
                {
                    var id = selection.Value[0].ObjectId;
                    AcAp.ShowAlertDialog(id.ObjectClass.Name);
                }
                else
                {
                    AcAp.ShowAlertDialog("More than one object in pickfirst set");
                }
            }
            else
            {
                AcAp.ShowAlertDialog("None pickfirst set");
            }
        }&lt;/PRE&gt;</description>
      <pubDate>Fri, 10 Feb 2017 19:34:37 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/how-to-retrieve-id-of-selected-object/m-p/6869987#M32790</guid>
      <dc:creator>_gile</dc:creator>
      <dc:date>2017-02-10T19:34:37Z</dc:date>
    </item>
    <item>
      <title>Re : How to retrieve ID of selected object</title>
      <link>https://forums.autodesk.com/t5/net-forum/how-to-retrieve-id-of-selected-object/m-p/6870043#M32791</link>
      <description>&lt;P&gt;Excellent! thank you very much. That worked great&lt;/P&gt;</description>
      <pubDate>Fri, 10 Feb 2017 19:50:29 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/how-to-retrieve-id-of-selected-object/m-p/6870043#M32791</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-02-10T19:50:29Z</dc:date>
    </item>
  </channel>
</rss>

