<?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 : selecting blocks, entities in .NET Forum</title>
    <link>https://forums.autodesk.com/t5/net-forum/selecting-blocks-entities/m-p/4348436#M48719</link>
    <description>&lt;P&gt;Hi Gilles,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thanks for your reply. Using your code/example I managed to reach my goal.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;best&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Filip&lt;/P&gt;</description>
    <pubDate>Tue, 30 Jul 2013 15:13:06 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2013-07-30T15:13:06Z</dc:date>
    <item>
      <title>selecting blocks, entities</title>
      <link>https://forums.autodesk.com/t5/net-forum/selecting-blocks-entities/m-p/4328172#M48715</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have some blocks which are placed with some routines in VB.net and are linked by a unique code to a external data file (XML-file). I want to try to created a kind of propertybox (in a toolpalette) which indicate some of this external data values. If one of these values are changed (by changing the values in the propertybox), some routines need to be executed.&lt;BR /&gt;&lt;BR /&gt;So my question is, is it possible when a object is selected (not during a command), to run a piece of code (VB.NET). I have found some basic principles about "overruling" but I'm not sure this is the correct/possible way to solve the problem and I'm not there yet.&lt;BR /&gt;&lt;BR /&gt;Can somebody help me with some sample code in VB.NET?&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;SPAN class="short_text"&gt;&lt;SPAN class="hps"&gt;&lt;SPAN class="short_text"&gt;&lt;SPAN class="hps"&gt;thx&lt;BR /&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="short_text"&gt;&lt;SPAN class="hps"&gt;&lt;SPAN class="short_text"&gt;&lt;SPAN class="hps"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="short_text"&gt;&lt;SPAN class="hps"&gt;&lt;SPAN class="short_text"&gt;&lt;SPAN class="hps"&gt;Filip&lt;BR /&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 12 Jul 2013 14:35:06 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/selecting-blocks-entities/m-p/4328172#M48715</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-07-12T14:35:06Z</dc:date>
    </item>
    <item>
      <title>Re : selecting blocks, entities</title>
      <link>https://forums.autodesk.com/t5/net-forum/selecting-blocks-entities/m-p/4328237#M48716</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You can handle the Document.ImpliedSelectionChanged event.&lt;/P&gt;</description>
      <pubDate>Fri, 12 Jul 2013 15:16:50 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/selecting-blocks-entities/m-p/4328237#M48716</guid>
      <dc:creator>_gile</dc:creator>
      <dc:date>2013-07-12T15:16:50Z</dc:date>
    </item>
    <item>
      <title>Re : selecting blocks, entities</title>
      <link>https://forums.autodesk.com/t5/net-forum/selecting-blocks-entities/m-p/4328258#M48717</link>
      <description>&lt;P&gt;Here's a little sample.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;C#&lt;/P&gt;&lt;PRE&gt;        [CommandMethod("On")]
        public void On()
        {
            Document doc = AcAp.DocumentManager.MdiActiveDocument;
            doc.ImpliedSelectionChanged += new EventHandler(doc_ImpliedSelectionChanged);
        }

        [CommandMethod("Off")]
        public void Off()
        {
            Document doc = AcAp.DocumentManager.MdiActiveDocument;
            doc.ImpliedSelectionChanged -= new EventHandler(doc_ImpliedSelectionChanged);
        }

        void doc_ImpliedSelectionChanged(object sender, EventArgs e)
        {
            Document doc = (Document)sender;
            Editor ed = doc.Editor;
            PromptSelectionResult psr = ed.SelectImplied();
            if (psr.Status == PromptStatus.OK)
                AcAp.ShowAlertDialog(string.Format("{0} selected entities", psr.Value.Count));
        }&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;VB&lt;/P&gt;&lt;PRE&gt;        &amp;lt;CommandMethod("On")&amp;gt; _
        Public Sub [On]()
            Dim doc As Document = Application.DocumentManager.MdiActiveDocument
            AddHandler doc.ImpliedSelectionChanged, AddressOf doc_ImpliedSelectionChanged
        End Sub

        &amp;lt;CommandMethod("Off")&amp;gt; _
        Public Sub Off()
            Dim doc As Document = Application.DocumentManager.MdiActiveDocument
            RemoveHandler doc.ImpliedSelectionChanged, AddressOf doc_ImpliedSelectionChanged
        End Sub

        Private Sub doc_ImpliedSelectionChanged(sender As Object, e As EventArgs)
            Dim doc As Document = DirectCast(sender, Document)
            Dim ed As Editor = doc.Editor
            Dim psr As PromptSelectionResult = ed.SelectImplied()
            If psr.Status = PromptStatus.OK Then
                Application.ShowAlertDialog(String.Format("{0} selected entities", psr.Value.Count))
            End If
        End Sub&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 12 Jul 2013 15:31:51 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/selecting-blocks-entities/m-p/4328258#M48717</guid>
      <dc:creator>_gile</dc:creator>
      <dc:date>2013-07-12T15:31:51Z</dc:date>
    </item>
    <item>
      <title>Re : selecting blocks, entities</title>
      <link>https://forums.autodesk.com/t5/net-forum/selecting-blocks-entities/m-p/4328282#M48718</link>
      <description>&lt;P&gt;You can also handle the DBObject.Modified event for you blocks.&lt;/P&gt;</description>
      <pubDate>Fri, 12 Jul 2013 16:03:13 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/selecting-blocks-entities/m-p/4328282#M48718</guid>
      <dc:creator>_gile</dc:creator>
      <dc:date>2013-07-12T16:03:13Z</dc:date>
    </item>
    <item>
      <title>Re : selecting blocks, entities</title>
      <link>https://forums.autodesk.com/t5/net-forum/selecting-blocks-entities/m-p/4348436#M48719</link>
      <description>&lt;P&gt;Hi Gilles,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thanks for your reply. Using your code/example I managed to reach my goal.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;best&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Filip&lt;/P&gt;</description>
      <pubDate>Tue, 30 Jul 2013 15:13:06 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/selecting-blocks-entities/m-p/4348436#M48719</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-07-30T15:13:06Z</dc:date>
    </item>
  </channel>
</rss>

