<?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: Veto functionality bug? in .NET Forum</title>
    <link>https://forums.autodesk.com/t5/net-forum/veto-functionality-bug/m-p/1445887#M83637</link>
    <description>Can you give me some more details on the PromptForEntityEnding bug that you &lt;BR /&gt;
are seeing? I'd like to get it fixed.&lt;BR /&gt;
&lt;BR /&gt;
albert&lt;BR /&gt;
&lt;BR /&gt;
"Tony Tanzillo" &lt;TONY.TANZILLO&gt; wrote in message &lt;BR /&gt;
news:4970767@discussion.autodesk.com...&lt;BR /&gt;
The name of the event is DocumentLockModeChanged.&lt;BR /&gt;
&lt;BR /&gt;
That is, 'Changed", in the past tense.&lt;BR /&gt;
&lt;BR /&gt;
How can you veto something that has already happened?&lt;BR /&gt;
&lt;BR /&gt;
More importantly, this isn't going to work in any case,&lt;BR /&gt;
because the EATTEDIT dialog has a button that lets&lt;BR /&gt;
the user select another block.&lt;BR /&gt;
&lt;BR /&gt;
I was going to suggest using the Managed events on&lt;BR /&gt;
the Editor (namely Editor.PromptForEntityEnding), but&lt;BR /&gt;
that event is broken (more like FUBAR) and does not&lt;BR /&gt;
allow you to selectively prevent selection of objects&lt;BR /&gt;
(there seems to be some serious problems with the&lt;BR /&gt;
event and the parameters passed to handlers).&lt;BR /&gt;
&lt;BR /&gt;
You may be able to do this in native ObjectARX using&lt;BR /&gt;
the AcEdSSGetFilter::endEntSel() function, but I haven't&lt;BR /&gt;
actually tried it.&lt;BR /&gt;
&lt;BR /&gt;
-- &lt;BR /&gt;
http://www.caddzone.com&lt;BR /&gt;
&lt;BR /&gt;
AcadXTabs: MDI Document Tabs for AutoCAD 2004/2005/2006&lt;BR /&gt;
http://www.acadxtabs.com&lt;BR /&gt;
&lt;BR /&gt;
&lt;BRIANROTH&gt; wrote in message news:4970626@discussion.autodesk.com...&lt;BR /&gt;
Hi all,&lt;BR /&gt;
&lt;BR /&gt;
Has anyone had any luck calling the Veto method in the &lt;BR /&gt;
DocumentLockModeChanged event?  I'm trying to cancel the user's EATTEDIT &lt;BR /&gt;
command for some particular blocks.  So in the DocumentLockModeChanged event &lt;BR /&gt;
I check for that command and block and then call e.Veto().  It doesn't error &lt;BR /&gt;
out, but it also doesn't stop the command.  I'm wondering if there's a bug &lt;BR /&gt;
with the veto, since I set up an event for DocumentLockModeChangeVetoed and &lt;BR /&gt;
it doesn't hit that after I call veto.&lt;BR /&gt;
&lt;BR /&gt;
Anyone else run into this?  Here's what my code looks like:&lt;BR /&gt;
&lt;BR /&gt;
        void DocumentManager_DocumentLockModeChanged(object sender, &lt;BR /&gt;
DocumentLockModeChangedEventArgs e)&lt;BR /&gt;
        {&lt;BR /&gt;
            try&lt;BR /&gt;
            {&lt;BR /&gt;
                if (e.GlobalCommandName == "EATTEDIT" &amp;amp;&amp;amp; &lt;BR /&gt;
IsSpecialBlock(e.Document))&lt;BR /&gt;
                {&lt;BR /&gt;
                    // Block the edit&lt;BR /&gt;
                    e.Veto();&lt;BR /&gt;
                }&lt;BR /&gt;
            }&lt;BR /&gt;
            catch { }&lt;BR /&gt;
        }&lt;/BRIANROTH&gt;&lt;/TONY.TANZILLO&gt;</description>
    <pubDate>Fri, 30 Sep 2005 05:53:21 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2005-09-30T05:53:21Z</dc:date>
    <item>
      <title>Veto functionality bug?</title>
      <link>https://forums.autodesk.com/t5/net-forum/veto-functionality-bug/m-p/1445884#M83634</link>
      <description>Hi all,&lt;BR /&gt;
&lt;BR /&gt;
Has anyone had any luck calling the Veto method in the DocumentLockModeChanged event?  I'm trying to cancel the user's EATTEDIT command for some particular blocks.  So in the DocumentLockModeChanged event I check for that command and block and then call e.Veto().  It doesn't error out, but it also doesn't stop the command.  I'm wondering if there's a bug with the veto, since I set up an event for DocumentLockModeChangeVetoed and it doesn't hit that after I call veto.&lt;BR /&gt;
&lt;BR /&gt;
Anyone else run into this?  Here's what my code looks like:&lt;BR /&gt;
&lt;BR /&gt;
        void DocumentManager_DocumentLockModeChanged(object sender, DocumentLockModeChangedEventArgs e)&lt;BR /&gt;
        {&lt;BR /&gt;
            try&lt;BR /&gt;
            {&lt;BR /&gt;
                if (e.GlobalCommandName == "EATTEDIT" &amp;amp;&amp;amp; IsSpecialBlock(e.Document))&lt;BR /&gt;
                {&lt;BR /&gt;
                    // Block the edit&lt;BR /&gt;
                    e.Veto();&lt;BR /&gt;
                }&lt;BR /&gt;
            }&lt;BR /&gt;
            catch { }&lt;BR /&gt;
        }</description>
      <pubDate>Thu, 29 Sep 2005 14:24:44 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/veto-functionality-bug/m-p/1445884#M83634</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2005-09-29T14:24:44Z</dc:date>
    </item>
    <item>
      <title>Re: Veto functionality bug?</title>
      <link>https://forums.autodesk.com/t5/net-forum/veto-functionality-bug/m-p/1445885#M83635</link>
      <description>The name of the event is DocumentLockModeChanged.&lt;BR /&gt;
&lt;BR /&gt;
That is, 'Changed", in the past tense.&lt;BR /&gt;
&lt;BR /&gt;
How can you veto something that has already happened?&lt;BR /&gt;
&lt;BR /&gt;
More importantly, this isn't going to work in any case,&lt;BR /&gt;
because the EATTEDIT dialog has a button that lets&lt;BR /&gt;
the user select another block.&lt;BR /&gt;
&lt;BR /&gt;
I was going to suggest using the Managed events on&lt;BR /&gt;
the Editor (namely Editor.PromptForEntityEnding), but&lt;BR /&gt;
that event is broken (more like FUBAR) and does not &lt;BR /&gt;
allow you to selectively prevent selection of objects &lt;BR /&gt;
(there seems to be some serious problems with the &lt;BR /&gt;
event and the parameters passed to handlers).&lt;BR /&gt;
&lt;BR /&gt;
You may be able to do this in native ObjectARX using&lt;BR /&gt;
the AcEdSSGetFilter::endEntSel() function, but I haven't&lt;BR /&gt;
actually tried it.&lt;BR /&gt;
&lt;BR /&gt;
-- &lt;BR /&gt;
http://www.caddzone.com&lt;BR /&gt;
&lt;BR /&gt;
AcadXTabs: MDI Document Tabs for AutoCAD 2004/2005/2006&lt;BR /&gt;
http://www.acadxtabs.com&lt;BR /&gt;
&lt;BR /&gt;
&lt;BRIANROTH&gt; wrote in message news:4970626@discussion.autodesk.com...&lt;BR /&gt;
Hi all,&lt;BR /&gt;
&lt;BR /&gt;
Has anyone had any luck calling the Veto method in the DocumentLockModeChanged event?  I'm trying to cancel the user's EATTEDIT command for some particular blocks.  So in the DocumentLockModeChanged event I check for that command and block and then call e.Veto().  It doesn't error out, but it also doesn't stop the command.  I'm wondering if there's a bug with the veto, since I set up an event for DocumentLockModeChangeVetoed and it doesn't hit that after I call veto.&lt;BR /&gt;
&lt;BR /&gt;
Anyone else run into this?  Here's what my code looks like:&lt;BR /&gt;
&lt;BR /&gt;
        void DocumentManager_DocumentLockModeChanged(object sender, DocumentLockModeChangedEventArgs e)&lt;BR /&gt;
        {&lt;BR /&gt;
            try&lt;BR /&gt;
            {&lt;BR /&gt;
                if (e.GlobalCommandName == "EATTEDIT" &amp;amp;&amp;amp; IsSpecialBlock(e.Document))&lt;BR /&gt;
                {&lt;BR /&gt;
                    // Block the edit&lt;BR /&gt;
                    e.Veto();&lt;BR /&gt;
                }&lt;BR /&gt;
            }&lt;BR /&gt;
            catch { }&lt;BR /&gt;
        }&lt;/BRIANROTH&gt;</description>
      <pubDate>Thu, 29 Sep 2005 15:47:35 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/veto-functionality-bug/m-p/1445885#M83635</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2005-09-29T15:47:35Z</dc:date>
    </item>
    <item>
      <title>Re: Veto functionality bug?</title>
      <link>https://forums.autodesk.com/t5/net-forum/veto-functionality-bug/m-p/1445886#M83636</link>
      <description>Thanks for the info, Tony.  Not sure how I'll resolve it, but at least I know what doesn't work!</description>
      <pubDate>Thu, 29 Sep 2005 22:30:20 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/veto-functionality-bug/m-p/1445886#M83636</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2005-09-29T22:30:20Z</dc:date>
    </item>
    <item>
      <title>Re: Veto functionality bug?</title>
      <link>https://forums.autodesk.com/t5/net-forum/veto-functionality-bug/m-p/1445887#M83637</link>
      <description>Can you give me some more details on the PromptForEntityEnding bug that you &lt;BR /&gt;
are seeing? I'd like to get it fixed.&lt;BR /&gt;
&lt;BR /&gt;
albert&lt;BR /&gt;
&lt;BR /&gt;
"Tony Tanzillo" &lt;TONY.TANZILLO&gt; wrote in message &lt;BR /&gt;
news:4970767@discussion.autodesk.com...&lt;BR /&gt;
The name of the event is DocumentLockModeChanged.&lt;BR /&gt;
&lt;BR /&gt;
That is, 'Changed", in the past tense.&lt;BR /&gt;
&lt;BR /&gt;
How can you veto something that has already happened?&lt;BR /&gt;
&lt;BR /&gt;
More importantly, this isn't going to work in any case,&lt;BR /&gt;
because the EATTEDIT dialog has a button that lets&lt;BR /&gt;
the user select another block.&lt;BR /&gt;
&lt;BR /&gt;
I was going to suggest using the Managed events on&lt;BR /&gt;
the Editor (namely Editor.PromptForEntityEnding), but&lt;BR /&gt;
that event is broken (more like FUBAR) and does not&lt;BR /&gt;
allow you to selectively prevent selection of objects&lt;BR /&gt;
(there seems to be some serious problems with the&lt;BR /&gt;
event and the parameters passed to handlers).&lt;BR /&gt;
&lt;BR /&gt;
You may be able to do this in native ObjectARX using&lt;BR /&gt;
the AcEdSSGetFilter::endEntSel() function, but I haven't&lt;BR /&gt;
actually tried it.&lt;BR /&gt;
&lt;BR /&gt;
-- &lt;BR /&gt;
http://www.caddzone.com&lt;BR /&gt;
&lt;BR /&gt;
AcadXTabs: MDI Document Tabs for AutoCAD 2004/2005/2006&lt;BR /&gt;
http://www.acadxtabs.com&lt;BR /&gt;
&lt;BR /&gt;
&lt;BRIANROTH&gt; wrote in message news:4970626@discussion.autodesk.com...&lt;BR /&gt;
Hi all,&lt;BR /&gt;
&lt;BR /&gt;
Has anyone had any luck calling the Veto method in the &lt;BR /&gt;
DocumentLockModeChanged event?  I'm trying to cancel the user's EATTEDIT &lt;BR /&gt;
command for some particular blocks.  So in the DocumentLockModeChanged event &lt;BR /&gt;
I check for that command and block and then call e.Veto().  It doesn't error &lt;BR /&gt;
out, but it also doesn't stop the command.  I'm wondering if there's a bug &lt;BR /&gt;
with the veto, since I set up an event for DocumentLockModeChangeVetoed and &lt;BR /&gt;
it doesn't hit that after I call veto.&lt;BR /&gt;
&lt;BR /&gt;
Anyone else run into this?  Here's what my code looks like:&lt;BR /&gt;
&lt;BR /&gt;
        void DocumentManager_DocumentLockModeChanged(object sender, &lt;BR /&gt;
DocumentLockModeChangedEventArgs e)&lt;BR /&gt;
        {&lt;BR /&gt;
            try&lt;BR /&gt;
            {&lt;BR /&gt;
                if (e.GlobalCommandName == "EATTEDIT" &amp;amp;&amp;amp; &lt;BR /&gt;
IsSpecialBlock(e.Document))&lt;BR /&gt;
                {&lt;BR /&gt;
                    // Block the edit&lt;BR /&gt;
                    e.Veto();&lt;BR /&gt;
                }&lt;BR /&gt;
            }&lt;BR /&gt;
            catch { }&lt;BR /&gt;
        }&lt;/BRIANROTH&gt;&lt;/TONY.TANZILLO&gt;</description>
      <pubDate>Fri, 30 Sep 2005 05:53:21 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/veto-functionality-bug/m-p/1445887#M83637</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2005-09-30T05:53:21Z</dc:date>
    </item>
    <item>
      <title>Re: Veto functionality bug?</title>
      <link>https://forums.autodesk.com/t5/net-forum/veto-functionality-bug/m-p/1445888#M83638</link>
      <description>The Result parameter of the event argument parameter is &lt;BR /&gt;
always null, and the RemoveSelectedObject() method doesn't &lt;BR /&gt;
seem to do what its name suggests. Given those things, the &lt;BR /&gt;
event is of no use whatsoever, because you can't even find &lt;BR /&gt;
out what object was selected.&lt;BR /&gt;
&lt;BR /&gt;
private static void Editor_PromptForEntityEnding(object sender, PromptForEntityEndingEventArgs e)&lt;BR /&gt;
{&lt;BR /&gt;
   Editor editor = (Editor) sender;&lt;BR /&gt;
   if( e.Result == null )&lt;BR /&gt;
   {&lt;BR /&gt;
      editor.WriteMessage("\nPromptForEntityEnding: e.Result == NULL !!!\n");&lt;BR /&gt;
&lt;BR /&gt;
      // This doesn't work at all.&lt;BR /&gt;
      e.RemoveSelectedObject();&lt;BR /&gt;
      return;&lt;BR /&gt;
   }&lt;BR /&gt;
&lt;BR /&gt;
   // simple test: try to prevent picking of any Circle&lt;BR /&gt;
&lt;BR /&gt;
   ObjectId id = e.Result.ObjectId;&lt;BR /&gt;
   using( Transaction tr = id.Database.TransactionManager.StartTransaction() )&lt;BR /&gt;
   {&lt;BR /&gt;
      DBObject o = tr.GetObject( id, OpenMode.ForRead );&lt;BR /&gt;
      if( o != null &amp;amp;&amp;amp; o is Circle )&lt;BR /&gt;
         e.RemoveSelectedObject();&lt;BR /&gt;
   }&lt;BR /&gt;
}&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
-- &lt;BR /&gt;
http://www.caddzone.com&lt;BR /&gt;
&lt;BR /&gt;
AcadXTabs: MDI Document Tabs for AutoCAD 2004/2005/2006&lt;BR /&gt;
http://www.acadxtabs.com&lt;BR /&gt;
&lt;BR /&gt;
"Albert Szilvasy" &lt;NOT_PROVIDED&gt; wrote in message news:4971633@discussion.autodesk.com...&lt;BR /&gt;
Can you give me some more details on the PromptForEntityEnding bug that you &lt;BR /&gt;
are seeing? I'd like to get it fixed.&lt;BR /&gt;
&lt;BR /&gt;
albert&lt;BR /&gt;
&lt;BR /&gt;
"Tony Tanzillo" &lt;TONY.TANZILLO&gt; wrote in message &lt;BR /&gt;
news:4970767@discussion.autodesk.com...&lt;BR /&gt;
The name of the event is DocumentLockModeChanged.&lt;BR /&gt;
&lt;BR /&gt;
That is, 'Changed", in the past tense.&lt;BR /&gt;
&lt;BR /&gt;
How can you veto something that has already happened?&lt;BR /&gt;
&lt;BR /&gt;
More importantly, this isn't going to work in any case,&lt;BR /&gt;
because the EATTEDIT dialog has a button that lets&lt;BR /&gt;
the user select another block.&lt;BR /&gt;
&lt;BR /&gt;
I was going to suggest using the Managed events on&lt;BR /&gt;
the Editor (namely Editor.PromptForEntityEnding), but&lt;BR /&gt;
that event is broken (more like FUBAR) and does not&lt;BR /&gt;
allow you to selectively prevent selection of objects&lt;BR /&gt;
(there seems to be some serious problems with the&lt;BR /&gt;
event and the parameters passed to handlers).&lt;BR /&gt;
&lt;BR /&gt;
You may be able to do this in native ObjectARX using&lt;BR /&gt;
the AcEdSSGetFilter::endEntSel() function, but I haven't&lt;BR /&gt;
actually tried it.&lt;BR /&gt;
&lt;BR /&gt;
-- &lt;BR /&gt;
http://www.caddzone.com&lt;BR /&gt;
&lt;BR /&gt;
AcadXTabs: MDI Document Tabs for AutoCAD 2004/2005/2006&lt;BR /&gt;
http://www.acadxtabs.com&lt;BR /&gt;
&lt;BR /&gt;
&lt;BRIANROTH&gt; wrote in message news:4970626@discussion.autodesk.com...&lt;BR /&gt;
Hi all,&lt;BR /&gt;
&lt;BR /&gt;
Has anyone had any luck calling the Veto method in the &lt;BR /&gt;
DocumentLockModeChanged event?  I'm trying to cancel the user's EATTEDIT &lt;BR /&gt;
command for some particular blocks.  So in the DocumentLockModeChanged event &lt;BR /&gt;
I check for that command and block and then call e.Veto().  It doesn't error &lt;BR /&gt;
out, but it also doesn't stop the command.  I'm wondering if there's a bug &lt;BR /&gt;
with the veto, since I set up an event for DocumentLockModeChangeVetoed and &lt;BR /&gt;
it doesn't hit that after I call veto.&lt;BR /&gt;
&lt;BR /&gt;
Anyone else run into this?  Here's what my code looks like:&lt;BR /&gt;
&lt;BR /&gt;
        void DocumentManager_DocumentLockModeChanged(object sender, &lt;BR /&gt;
DocumentLockModeChangedEventArgs e)&lt;BR /&gt;
        {&lt;BR /&gt;
            try&lt;BR /&gt;
            {&lt;BR /&gt;
                if (e.GlobalCommandName == "EATTEDIT" &amp;amp;&amp;amp; &lt;BR /&gt;
IsSpecialBlock(e.Document))&lt;BR /&gt;
                {&lt;BR /&gt;
                    // Block the edit&lt;BR /&gt;
                    e.Veto();&lt;BR /&gt;
                }&lt;BR /&gt;
            }&lt;BR /&gt;
            catch { }&lt;BR /&gt;
        }&lt;/BRIANROTH&gt;&lt;/TONY.TANZILLO&gt;&lt;/NOT_PROVIDED&gt;</description>
      <pubDate>Fri, 30 Sep 2005 16:07:41 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/veto-functionality-bug/m-p/1445888#M83638</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2005-09-30T16:07:41Z</dc:date>
    </item>
  </channel>
</rss>

