<?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: Switching active documents is not allowed during API event handling in Revit API Forum</title>
    <link>https://forums.autodesk.com/t5/revit-api-forum/switching-active-documents-is-not-allowed-during-api-event/m-p/5498439#M74068</link>
    <description>*Opens the chm* *search for it ...* Tnx!</description>
    <pubDate>Fri, 06 Feb 2015 21:50:45 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2015-02-06T21:50:45Z</dc:date>
    <item>
      <title>Switching active documents is not allowed during API event handling</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/switching-active-documents-is-not-allowed-during-api-event/m-p/5496940#M74062</link>
      <description>&lt;P&gt;This really self explaing exception is thrown when i try to do an Application.OpenandActivateDocument, the second time (when i have no active documents it works),&lt;BR /&gt;The point is the event i'm trying to do this from, is: application.Idling ...&lt;BR /&gt;I really expected to be allowed from there do do that.&lt;/P&gt;</description>
      <pubDate>Fri, 06 Feb 2015 01:27:14 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/switching-active-documents-is-not-allowed-during-api-event/m-p/5496940#M74062</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-02-06T01:27:14Z</dc:date>
    </item>
    <item>
      <title>Re: Switching active documents is not allowed during API event handling</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/switching-active-documents-is-not-allowed-during-api-event/m-p/5497160#M74063</link>
      <description>&lt;P&gt;Dear Luigi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Does this help in any way?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://thebuildingcoder.typepad.com/blog/2012/12/closing-the-active-document.html" target="_blank"&gt;http://thebuildingcoder.typepad.com/blog/2012/12/closing-the-active-document.html&lt;/A&gt;&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;</description>
      <pubDate>Fri, 06 Feb 2015 07:46:09 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/switching-active-documents-is-not-allowed-during-api-event/m-p/5497160#M74063</guid>
      <dc:creator>jeremytammik</dc:creator>
      <dc:date>2015-02-06T07:46:09Z</dc:date>
    </item>
    <item>
      <title>Re: Switching active documents is not allowed during API event handling</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/switching-active-documents-is-not-allowed-during-api-event/m-p/5497260#M74064</link>
      <description>&lt;P&gt;Hello Jeremy i went through your blog thorougly before posting and that article has been read.&lt;BR /&gt;&lt;BR /&gt;I tried to close the document but i get another error,&amp;nbsp;i think process start can help, but i dislike that option since i don't get any reference to the document ... (maybe i can get throug open documents and find the one with that filename ...&lt;BR /&gt;First cal works from second on it doesn't&lt;BR /&gt;&lt;BR /&gt;I made a solution to investigate the problem with the comunity:&lt;/P&gt;&lt;P&gt;&lt;A target="_blank" href="https://github.com/LiFeleSs/RevitOpenAndActivateDuringIdle"&gt;https://github.com/LiFeleSs/RevitOpenAndActivateDuringIdle&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;ALSO i can't access this forum using google chrome anymore&lt;/P&gt;</description>
      <pubDate>Fri, 06 Feb 2015 09:29:03 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/switching-active-documents-is-not-allowed-during-api-event/m-p/5497260#M74064</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-02-06T09:29:03Z</dc:date>
    </item>
    <item>
      <title>Re: Switching active documents is not allowed during API event handling</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/switching-active-documents-is-not-allowed-during-api-event/m-p/5498420#M74065</link>
      <description>&lt;P&gt;I've implemented the process start workaround and found a way to realiably get the opened document, unfortunately not the&amp;nbsp;UiDocument.&lt;BR /&gt;I still think this should be considered a bug in revit API...&lt;/P&gt;</description>
      <pubDate>Fri, 06 Feb 2015 21:42:51 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/switching-active-documents-is-not-allowed-during-api-event/m-p/5498420#M74065</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-02-06T21:42:51Z</dc:date>
    </item>
    <item>
      <title>Re: Switching active documents is not allowed during API event handling</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/switching-active-documents-is-not-allowed-during-api-event/m-p/5498424#M74066</link>
      <description>&lt;P&gt;Naturally, I have to step in, for I do not like Jeremy’s suggested solution all that much (and he knows it &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Although opening a new active document is not allowed from event handlers when there already is a document open in Revit, there may be an alternative. I believe we have implemented External Events so they do&amp;nbsp;not share this restriction with events. Thus, for the user who otherwise used the Idling event, switching to an External Event could be a suitable solution. And it is both supported and safe.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you&lt;/P&gt;</description>
      <pubDate>Fri, 06 Feb 2015 21:43:52 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/switching-active-documents-is-not-allowed-during-api-event/m-p/5498424#M74066</guid>
      <dc:creator>arnostlobel</dc:creator>
      <dc:date>2015-02-06T21:43:52Z</dc:date>
    </item>
    <item>
      <title>Re: Switching active documents is not allowed during API event handling</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/switching-active-documents-is-not-allowed-during-api-event/m-p/5498428#M74067</link>
      <description>Luigi,&lt;BR /&gt;&lt;BR /&gt;You’ve posted seconds before me.&lt;BR /&gt;Of course, opening a DB document has no restrictions. You should be always able to do it in virtually any situations.&lt;BR /&gt;</description>
      <pubDate>Fri, 06 Feb 2015 21:46:26 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/switching-active-documents-is-not-allowed-during-api-event/m-p/5498428#M74067</guid>
      <dc:creator>arnostlobel</dc:creator>
      <dc:date>2015-02-06T21:46:26Z</dc:date>
    </item>
    <item>
      <title>Re: Switching active documents is not allowed during API event handling</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/switching-active-documents-is-not-allowed-during-api-event/m-p/5498439#M74068</link>
      <description>*Opens the chm* *search for it ...* Tnx!</description>
      <pubDate>Fri, 06 Feb 2015 21:50:45 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/switching-active-documents-is-not-allowed-during-api-event/m-p/5498439#M74068</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-02-06T21:50:45Z</dc:date>
    </item>
    <item>
      <title>Re: Switching active documents is not allowed during API event handling</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/switching-active-documents-is-not-allowed-during-api-event/m-p/5498445#M74069</link>
      <description>&lt;P&gt;I am not sure what your last comment means, but, yes, I guess.&lt;BR /&gt;If you are referring to finding some help for using External Event, I recommend searching through the samples in the SDK. There is at least one.&lt;/P&gt;</description>
      <pubDate>Fri, 06 Feb 2015 21:56:44 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/switching-active-documents-is-not-allowed-during-api-event/m-p/5498445#M74069</guid>
      <dc:creator>arnostlobel</dc:creator>
      <dc:date>2015-02-06T21:56:44Z</dc:date>
    </item>
    <item>
      <title>Re: Switching active documents is not allowed during API event handling</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/switching-active-documents-is-not-allowed-during-api-event/m-p/5498500#M74070</link>
      <description>&lt;P&gt;Oh that is a bad habit from when i used to just write on forums for fun, not for relevant things, putting an action between asterisks means i'm actually doing that actions ...&lt;BR /&gt;&lt;BR /&gt;I've found an axample about that on Jeremy blog, my source for inspiration (thanks Jeremy) and updated my solution to not use the idling event but to raise my shiny new external event, and it works like a charm!&lt;BR /&gt;I didn't realized external events purpose, i thougth it was a way to leverage idling handling ...&lt;BR /&gt;So! thanks for pointing me in the right direction!&lt;BR /&gt;&lt;BR /&gt;Arnost there is some other aspects of the API i'd like to&amp;nbsp;discuss (like button availability) is this the right place ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;P.s. i've updated the git hub repository, if you want to include it&amp;nbsp;in the samples ...&lt;/P&gt;</description>
      <pubDate>Fri, 06 Feb 2015 22:49:03 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/switching-active-documents-is-not-allowed-during-api-event/m-p/5498500#M74070</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-02-06T22:49:03Z</dc:date>
    </item>
    <item>
      <title>Re: Switching active documents is not allowed during API event handling</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/switching-active-documents-is-not-allowed-during-api-event/m-p/5500978#M74071</link>
      <description>&lt;P&gt;Dear Luigi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Congratulations on resolving your problem, and thank you for sharing the result.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I would love to share your sample with the rest of the Revit add-in developer community...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Could you be a bit more specific about what it actually demonstrates and how, now that all the issues&amp;nbsp;you were encountering are resolved and you are clear about the use of external events?&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;</description>
      <pubDate>Mon, 09 Feb 2015 22:50:27 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/switching-active-documents-is-not-allowed-during-api-event/m-p/5500978#M74071</guid>
      <dc:creator>jeremytammik</dc:creator>
      <dc:date>2015-02-09T22:50:27Z</dc:date>
    </item>
    <item>
      <title>Re: Switching active documents is not allowed during API event handling</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/switching-active-documents-is-not-allowed-during-api-event/m-p/5501005#M74072</link>
      <description>&lt;P&gt;Helllo Luigi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I suggest you take Jeremy's offer for possibly sharing your sample on his blog. That is the right platform for showing custom samples. Here at Revit R&amp;amp;D we&amp;nbsp;can only use SDK samples we develop ourselves, becasue we need to include them as part of our builds to ensure their build-ability (if that is a word.)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;As for your question, this forum is totally the right place&amp;nbsp;for your posting questions about button ability etc., assuming your question is about the progamming aspect of such a task. Naturally, not all questions get always answered - after all this is still but a peer-to-peer forum. Most questions do get aswered, however, &amp;nbsp;and we (at Revit R&amp;amp;D) do pay atttention to all posts even when we do not directly participate.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you&lt;/P&gt;</description>
      <pubDate>Mon, 09 Feb 2015 23:15:31 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/switching-active-documents-is-not-allowed-during-api-event/m-p/5501005#M74072</guid>
      <dc:creator>arnostlobel</dc:creator>
      <dc:date>2015-02-09T23:15:31Z</dc:date>
    </item>
    <item>
      <title>Re: Switching active documents is not allowed during API event handling</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/switching-active-documents-is-not-allowed-during-api-event/m-p/5501558#M74073</link>
      <description>&lt;P&gt;Very good! you can share my example as long as you want, in fact is publicily available on gitHub.&lt;BR /&gt;The last version of it demostrate how using an &lt;STRONG&gt;ExternalEvent&lt;/STRONG&gt; solve getting the &lt;EM&gt;&lt;STRONG&gt;"Switching active documents is not allowed during API event handling"&lt;/STRONG&gt; &lt;/EM&gt;exception trying to open a document (or more than one)&amp;nbsp;during a call from a command or an event such the idling.&lt;BR /&gt;And also it demostrate how to declare and call the external event.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;the previous versions could be also quite usefull to some revit users because it shows how to get a task executed during the idling event. but need some arrangement because it was built to demonstrate the other issue.&lt;/P&gt;</description>
      <pubDate>Tue, 10 Feb 2015 13:15:22 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/switching-active-documents-is-not-allowed-during-api-event/m-p/5501558#M74073</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-02-10T13:15:22Z</dc:date>
    </item>
  </channel>
</rss>

