<?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 ExternalEvent raised during DocumentChanged from a Paste operation does not execute in Revit API Forum</title>
    <link>https://forums.autodesk.com/t5/revit-api-forum/externalevent-raised-during-documentchanged-from-a-paste/m-p/9921311#M29841</link>
    <description>&lt;P&gt;In the sample code,&amp;nbsp;ControlledApplication_DocumentChanged calls&amp;nbsp;Raise() for each Id in&amp;nbsp;GetAddedElementIds()&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you invoke the wall tool and click twice to create a straight wall, 1 element is added and Raise() is called once. When you end the Wall editor (hit ESC twice), the Raise code is executed. Everything is good.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you copy/paste this wall (select it, CTRL-C, CTRL-V, click to place the new wall), then 4 elements are added and Raise() is called 4 times. Push ESC or Finish Paste to complete the Paste command. The Raise code is only executed one time. &lt;STRONG&gt;What happened to the other 3 calls to Raise()?&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have try/catch blocks around all the relevant code and there are no exceptions. The Raise code is only showing a Task Dialog (for debugging purposes).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Relevant code is in&amp;nbsp;&lt;A href="https://bitbucket.org/BoostYourBIM/boostyourbimterrifictools/src/master/BoostYourBIMTerrificTools/Ribbon.cs" target="_blank"&gt;https://bitbucket.org/BoostYourBIM/boostyourbimterrifictools/src/master/BoostYourBIMTerrificTools/Ribbon.cs&lt;/A&gt;&amp;nbsp;lines 130-151&lt;/P&gt;</description>
    <pubDate>Mon, 07 Dec 2020 16:45:28 GMT</pubDate>
    <dc:creator>boostyourbim</dc:creator>
    <dc:date>2020-12-07T16:45:28Z</dc:date>
    <item>
      <title>ExternalEvent raised during DocumentChanged from a Paste operation does not execute</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/externalevent-raised-during-documentchanged-from-a-paste/m-p/9921311#M29841</link>
      <description>&lt;P&gt;In the sample code,&amp;nbsp;ControlledApplication_DocumentChanged calls&amp;nbsp;Raise() for each Id in&amp;nbsp;GetAddedElementIds()&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you invoke the wall tool and click twice to create a straight wall, 1 element is added and Raise() is called once. When you end the Wall editor (hit ESC twice), the Raise code is executed. Everything is good.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you copy/paste this wall (select it, CTRL-C, CTRL-V, click to place the new wall), then 4 elements are added and Raise() is called 4 times. Push ESC or Finish Paste to complete the Paste command. The Raise code is only executed one time. &lt;STRONG&gt;What happened to the other 3 calls to Raise()?&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have try/catch blocks around all the relevant code and there are no exceptions. The Raise code is only showing a Task Dialog (for debugging purposes).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Relevant code is in&amp;nbsp;&lt;A href="https://bitbucket.org/BoostYourBIM/boostyourbimterrifictools/src/master/BoostYourBIMTerrificTools/Ribbon.cs" target="_blank"&gt;https://bitbucket.org/BoostYourBIM/boostyourbimterrifictools/src/master/BoostYourBIMTerrificTools/Ribbon.cs&lt;/A&gt;&amp;nbsp;lines 130-151&lt;/P&gt;</description>
      <pubDate>Mon, 07 Dec 2020 16:45:28 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/externalevent-raised-during-documentchanged-from-a-paste/m-p/9921311#M29841</guid>
      <dc:creator>boostyourbim</dc:creator>
      <dc:date>2020-12-07T16:45:28Z</dc:date>
    </item>
    <item>
      <title>Re: ExternalEvent raised during DocumentChanged from a Paste operation does not execute</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/externalevent-raised-during-documentchanged-from-a-paste/m-p/9921444#M29842</link>
      <description>&lt;P&gt;Dear Harry,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you for your report.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Can you extract the relevant code snippets and put them together into a minimal reproducible case that can be shared with and analysed by the development team?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://thebuildingcoder.typepad.com/blog/about-the-author.html#2" target="_blank"&gt;https://thebuildingcoder.typepad.com/blog/about-the-author.html#2&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Cheers,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Jeremy&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 07 Dec 2020 17:43:20 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/externalevent-raised-during-documentchanged-from-a-paste/m-p/9921444#M29842</guid>
      <dc:creator>jeremytammik</dc:creator>
      <dc:date>2020-12-07T17:43:20Z</dc:date>
    </item>
    <item>
      <title>Re: ExternalEvent raised during DocumentChanged from a Paste operation does not execute</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/externalevent-raised-during-documentchanged-from-a-paste/m-p/9922057#M29843</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/413917"&gt;@jeremytammik&lt;/a&gt;&amp;nbsp;please see attached&lt;/P&gt;</description>
      <pubDate>Mon, 07 Dec 2020 22:17:55 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/externalevent-raised-during-documentchanged-from-a-paste/m-p/9922057#M29843</guid>
      <dc:creator>boostyourbim</dc:creator>
      <dc:date>2020-12-07T22:17:55Z</dc:date>
    </item>
    <item>
      <title>Re: ExternalEvent raised during DocumentChanged from a Paste operation does not execute</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/externalevent-raised-during-documentchanged-from-a-paste/m-p/9922109#M29844</link>
      <description>&lt;P&gt;You may be able to find out what happened to the other three by checking result of:&lt;/P&gt;&lt;P&gt;Utils.testExternalEvent.Raise() if not already done so.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Each one should get a return of either: Accepted, Pending, Denied or TimedOut (with only 'Accepted' being a good result).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;ExternalEventRequest Enum in RevitAPI.chm provides summary of these values. Perhaps sounds like a 'Pending' circumstance i.e. subsequent requests rejected if pending ones your event has already requested are still to be processed.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Moral of the tale may be to raise one event with an argument of four ids rather than raising one event for each item.&lt;/P&gt;</description>
      <pubDate>Mon, 07 Dec 2020 22:55:07 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/externalevent-raised-during-documentchanged-from-a-paste/m-p/9922109#M29844</guid>
      <dc:creator>RPTHOMAS108</dc:creator>
      <dc:date>2020-12-07T22:55:07Z</dc:date>
    </item>
    <item>
      <title>Re: ExternalEvent raised during DocumentChanged from a Paste operation does not execute</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/externalevent-raised-during-documentchanged-from-a-paste/m-p/9922466#M29845</link>
      <description>&lt;P&gt;The first call to Raise() is "Accepted". Then the next 3 are "Pending". I will give a try to handling all 4 ids in a single Raise().&lt;/P&gt;</description>
      <pubDate>Tue, 08 Dec 2020 03:03:10 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/externalevent-raised-during-documentchanged-from-a-paste/m-p/9922466#M29845</guid>
      <dc:creator>boostyourbim</dc:creator>
      <dc:date>2020-12-08T03:03:10Z</dc:date>
    </item>
    <item>
      <title>Re: ExternalEvent raised during DocumentChanged from a Paste operation does not execute</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/externalevent-raised-during-documentchanged-from-a-paste/m-p/9925305#M29846</link>
      <description>&lt;P&gt;Yes the 'Pending' terminology is a bit misleading because it could give the impression that it will eventually be executed and it will not. They should probably have named it 'DuplicateRejected' or something similar. I suppose however they are speaking of the state of the item that will be executed and that state being why the subsequent ones will not be.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Probably when you do copy and paste it is all happening almost instantaneously so Revit doesn't have the required time to get the first one done before the next arrives.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The best practice for ExternalEvent is in the name 'External' I guess i.e. not getting Revit to trigger itself (although I've been guilty of this too). I suspect the intention for the ExternalEvent was for it to be triggered by a human interaction or that of another program.&lt;/P&gt;</description>
      <pubDate>Wed, 09 Dec 2020 00:52:01 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/externalevent-raised-during-documentchanged-from-a-paste/m-p/9925305#M29846</guid>
      <dc:creator>RPTHOMAS108</dc:creator>
      <dc:date>2020-12-09T00:52:01Z</dc:date>
    </item>
  </channel>
</rss>

