<?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: Click the dwg then get the Infomation of Entity in .NET Forum</title>
    <link>https://forums.autodesk.com/t5/net-forum/click-the-dwg-then-get-the-infomation-of-entity/m-p/6355236#M35918</link>
    <description>&lt;BR /&gt;Thanks, norman.yuan.&lt;BR /&gt;</description>
    <pubDate>Mon, 30 May 2016 04:31:06 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2016-05-30T04:31:06Z</dc:date>
    <item>
      <title>Click the dwg then get the Infomation of Entity</title>
      <link>https://forums.autodesk.com/t5/net-forum/click-the-dwg-then-get-the-infomation-of-entity/m-p/6351861#M35916</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;when I clicke the entity in dwg, I want to get that entity infomation, like a image.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;IMG src="https://forums.autodesk.com/t5/image/serverpage/image-id/242841iAB2750F1B973136C/image-size/large?v=v2&amp;amp;px=-1" border="0" alt="캡처.JPG" title="캡처.JPG" /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So, I was using the event in Editor.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;Editor ed = doc.Editor;
ed.PromptedForSelection += edPromptForSelection;

        private void edPromptForSelection(object sender, PromptSelectionResultEventArgs e)
        {
            Editor ed = sender as Editor;
            PromptSelectionResult psr = e.Result;

            if (psr.Status != PromptStatus.OK) return;

            ObjectId[] objArr = psr.Value.GetObjectIds();

            // 레이어를 생성하고, 점만 출력한다.
            using (docLock = doc.LockDocument())
            {
                using (tr = db.TransactionManager.StartTransaction())
                {
                    foreach (ObjectId Id in objArr)
                    {
                        Entity ent = tr.GetObject(Id, OpenMode.ForRead) as Entity;

                    }
                }
            }

            ed.SetImpliedSelection(objArr);
        }&lt;/PRE&gt;&lt;P&gt;&lt;BR /&gt;It was working what I thought but Called the Event many times.... maybe 4?&lt;/P&gt;&lt;P&gt;I just want to call one by one clicked.&lt;/P&gt;&lt;P&gt;so, To release or Clear the selection list,&lt;BR /&gt;I used the&lt;BR /&gt;&lt;BR /&gt;ed.SetImpliedSelection(objArr);&lt;/P&gt;&lt;P&gt;But It cannot fix the problem.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 27 May 2016 04:29:40 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/click-the-dwg-then-get-the-infomation-of-entity/m-p/6351861#M35916</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-05-27T04:29:40Z</dc:date>
    </item>
    <item>
      <title>Re: Click the dwg then get the Infomation of Entity</title>
      <link>https://forums.autodesk.com/t5/net-forum/click-the-dwg-then-get-the-infomation-of-entity/m-p/6352956#M35917</link>
      <description>&lt;P&gt;You did not show whole picture of how your code is loaded into AutoCAD and how it would be triggered.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;However, if your goal is that after your code is loaded/enabled, whenever user selects an Entity in AutoCAD editor, your form pops up (modal or modeless?), you may want to think again: when user works with AutoCAD, he/she would click on AutoCAD editor/entities very often (consciously&amp;nbsp;or unconsciously) for any purpose, do you want to annoy the user by keeping showing up your form?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You'd be better off using custom context menu when user right-click an entity, or using custom double-click event handler to give user the chance to explicitly/consciously show the form.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;To use custom context menu, look into these article:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://through-the-interface.typepad.com/through_the_interface/2007/05/adding_a_contex.html" target="_self"&gt;http://through-the-interface.typepad.com/through_the_interface/2007/05/adding_a_contex.html&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://through-the-interface.typepad.com/through_the_interface/2008/11/displaying-a-co.html" target="_self"&gt;http://through-the-interface.typepad.com/through_the_interface/2008/11/displaying-a-co.html&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For custom double-click handling, this could be of help:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://drive-cad-with-code.blogspot.ca/2013/03/update-custom-double-click-action-using.html" target="_self"&gt;http://drive-cad-with-code.blogspot.ca/2013/03/update-custom-double-click-action-using.html&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 27 May 2016 15:55:55 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/click-the-dwg-then-get-the-infomation-of-entity/m-p/6352956#M35917</guid>
      <dc:creator>norman.yuan</dc:creator>
      <dc:date>2016-05-27T15:55:55Z</dc:date>
    </item>
    <item>
      <title>Re: Click the dwg then get the Infomation of Entity</title>
      <link>https://forums.autodesk.com/t5/net-forum/click-the-dwg-then-get-the-infomation-of-entity/m-p/6355236#M35918</link>
      <description>&lt;BR /&gt;Thanks, norman.yuan.&lt;BR /&gt;</description>
      <pubDate>Mon, 30 May 2016 04:31:06 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/click-the-dwg-then-get-the-infomation-of-entity/m-p/6355236#M35918</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-05-30T04:31:06Z</dc:date>
    </item>
  </channel>
</rss>

