<?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: Background processes monitoring or checking in Revit API Forum</title>
    <link>https://forums.autodesk.com/t5/revit-api-forum/background-processes-monitoring-or-checking/m-p/7130018#M57998</link>
    <description>&lt;P&gt;Hello&amp;nbsp;matthew taylor&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for your reply.&lt;/P&gt;&lt;P&gt;not the answer I was hoping for, but I will give it a try.&lt;/P&gt;&lt;P&gt;I was hoping for a IsApplicationBusy function or a function to get (a list of) running background processes or something like that &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thanks anyway.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Chris&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 05 Jun 2017 19:29:29 GMT</pubDate>
    <dc:creator>c_hanschen</dc:creator>
    <dc:date>2017-06-05T19:29:29Z</dc:date>
    <item>
      <title>Background processes monitoring or checking</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/background-processes-monitoring-or-checking/m-p/7127415#M57996</link>
      <description>&lt;P&gt;&lt;STRONG&gt;Is there a way to 'ask' the Revit API what background processes are running? To monitor them?&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm countering the following problem:&lt;/P&gt;&lt;P&gt;I have a lot of different tasks to complete.&lt;/P&gt;&lt;P&gt;all &lt;STRONG&gt;working just fine&lt;/STRONG&gt; fired 1 at the time.&lt;/P&gt;&lt;P&gt;If I fire them up to quick after each other, Revit Crashes!&lt;/P&gt;&lt;P&gt;When I let my code take a break between tasks, the crashes are solved or strongly reduced.&lt;/P&gt;&lt;P&gt;I now use a timer to start the tasks with a pause of some seconds, working fine most of the time.&lt;/P&gt;&lt;P&gt;But when my PC is Bussy doing something else, and the resources for Revit are low, those seconds are not enough and Revit Crashes again.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I think this is because the new task is started while in the background the previous task is not completely finished, no I need to ask Revit for any running background processes, if any running, than the code will wait for it to end before starting &amp;nbsp;a new task.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Is there a way to 'ask' the Revit API what background processes are running? To monitor them?&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Chris Hanschen&lt;/P&gt;&lt;P&gt;LKSVDD architecten&amp;nbsp;&lt;/P&gt;&lt;P&gt;Enschede, The Netherlands.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 03 Jun 2017 22:37:07 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/background-processes-monitoring-or-checking/m-p/7127415#M57996</guid>
      <dc:creator>c_hanschen</dc:creator>
      <dc:date>2017-06-03T22:37:07Z</dc:date>
    </item>
    <item>
      <title>Re: Background processes monitoring or checking</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/background-processes-monitoring-or-checking/m-p/7128613#M57997</link>
      <description>&lt;P&gt;Hi &lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/807926"&gt;@c_hanschen&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;This post may help &lt;A href="https://stackoverflow.com/questions/12035210/how-to-determine-total-unused-physical-memory-in-vb-net" target="_self"&gt;https://stackoverflow.com/questions/12035210/how-to-determine-total-unused-physical-memory-in-vb-net&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;If you want to know how much memory Revit is using, you may have to use &lt;A href="https://stackoverflow.com/questions/27684486/ram-memory-usage-for-windows-application" target="_self"&gt;https://stackoverflow.com/questions/27684486/ram-memory-usage-for-windows-application&lt;/A&gt;, although there are RevitWorker.exe processes now, along with RevitAccelerator.exe, so you may need to use &lt;A href="https://stackoverflow.com/questions/10348180/list-all-processes-that-currently-running-on-windows-by-vb-net-2-0" target="_self"&gt;https://stackoverflow.com/questions/10348180/list-all-processes-that-currently-running-on-windows-by-vb-net-2-0&lt;/A&gt;&amp;nbsp;to get all processes, and check their names for 'Revit' (or something), and add their values. Of course, you may have more than one Revit instance running, so you may need to check for the .Parent.Id value.&lt;/P&gt;</description>
      <pubDate>Mon, 05 Jun 2017 08:52:49 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/background-processes-monitoring-or-checking/m-p/7128613#M57997</guid>
      <dc:creator>matthew_taylor</dc:creator>
      <dc:date>2017-06-05T08:52:49Z</dc:date>
    </item>
    <item>
      <title>Re: Background processes monitoring or checking</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/background-processes-monitoring-or-checking/m-p/7130018#M57998</link>
      <description>&lt;P&gt;Hello&amp;nbsp;matthew taylor&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for your reply.&lt;/P&gt;&lt;P&gt;not the answer I was hoping for, but I will give it a try.&lt;/P&gt;&lt;P&gt;I was hoping for a IsApplicationBusy function or a function to get (a list of) running background processes or something like that &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thanks anyway.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Chris&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 05 Jun 2017 19:29:29 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/background-processes-monitoring-or-checking/m-p/7130018#M57998</guid>
      <dc:creator>c_hanschen</dc:creator>
      <dc:date>2017-06-05T19:29:29Z</dc:date>
    </item>
    <item>
      <title>Re: Background processes monitoring or checking</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/background-processes-monitoring-or-checking/m-p/7130175#M57999</link>
      <description>Hi Chris,&lt;BR /&gt;No problem.&lt;BR /&gt;You need to be more descriptive to get a non-general answer. &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;BR /&gt;Perhaps you should browse Revit events?&lt;BR /&gt;What 'processes' are you running?&lt;BR /&gt;Do you actually mean Windows processes, or something else?&lt;BR /&gt;What APIs are you using?&lt;BR /&gt;What version of Revit?&lt;BR /&gt;If 2018, have you seen my Known Bug List post? I personally think some of the exporting functions that have issues sound like thread/background process issues.&lt;BR /&gt;&lt;A href="https://forums.autodesk.com/t5/revit-architecture-forum/known-bug-list/td-p/7079586" target="_blank"&gt;https://forums.autodesk.com/t5/revit-architecture-forum/known-bug-list/td-p/7079586&lt;/A&gt;&lt;BR /&gt;More data, please. &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;</description>
      <pubDate>Mon, 05 Jun 2017 20:34:25 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/background-processes-monitoring-or-checking/m-p/7130175#M57999</guid>
      <dc:creator>matthew_taylor</dc:creator>
      <dc:date>2017-06-05T20:34:25Z</dc:date>
    </item>
    <item>
      <title>Re: Background processes monitoring or checking</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/background-processes-monitoring-or-checking/m-p/7131949#M58000</link>
      <description>&lt;P&gt;How are you launching your 'tasks', from code behind in a dialog box?&lt;/P&gt;</description>
      <pubDate>Tue, 06 Jun 2017 14:09:07 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/background-processes-monitoring-or-checking/m-p/7131949#M58000</guid>
      <dc:creator>BobbyC.Jones</dc:creator>
      <dc:date>2017-06-06T14:09:07Z</dc:date>
    </item>
    <item>
      <title>Re: Background processes monitoring or checking</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/background-processes-monitoring-or-checking/m-p/7132432#M58001</link>
      <description>&lt;P&gt;Yes, the tool is a Dialog box with a lot of choices, choose the tasks you want, each tasks has it own customize-able settings.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/98018"&gt;@matthew_taylor&lt;/a&gt;&lt;/P&gt;&lt;P&gt;Current using Revit 2017.2&lt;/P&gt;&lt;P&gt;Visual Studio 2015 professional, Language Vb.net&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;By Example:&lt;/P&gt;&lt;P&gt;When printing different sheets and immediately after that exporting sheets to DWG, Revit crashes.&lt;BR /&gt;When waiting between those 2 tasks, the problem is solved.&lt;/P&gt;&lt;P&gt;btw waiting with system.threathing.sleep doesn't work, a temporary visible dialog closing down by a timer does the job,&lt;/P&gt;&lt;P&gt;I somehow think this has something to do with running background processes. that's why I ask if there is any way to monitor the running background processes.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Chris&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 06 Jun 2017 16:37:56 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/background-processes-monitoring-or-checking/m-p/7132432#M58001</guid>
      <dc:creator>c_hanschen</dc:creator>
      <dc:date>2017-06-06T16:37:56Z</dc:date>
    </item>
    <item>
      <title>Re: Background processes monitoring or checking</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/background-processes-monitoring-or-checking/m-p/7132473#M58002</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/807926"&gt;@c_hanschen&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;Yes, the tool is a Dialog box with a lot of choices, choose the tasks you want, each tasks has it own customize-able settings....&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Chris&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Chris,&lt;/P&gt;
&lt;P&gt;I assume that the dialog is modeless, if that's not the case then you can stop reading now as I'm way off track. &amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There has been A LOT of discussion on this in the past. &amp;nbsp;Here's an excellent resource from Jeremy's blog to read up on some of it,&amp;nbsp;&lt;A href="http://thebuildingcoder.typepad.com/blog/about-the-author.html#5.28" target="_blank"&gt;http://thebuildingcoder.typepad.com/blog/about-the-author.html#5.28&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In a nutshell, the Revit API can only be accessed from the main thread. &amp;nbsp;Accessing it from a different thread, like from code behind in a modeless window, will cause errors, insidious errors in that sometimes the code will appear to work, and other times it will not.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The generally accepted way to handle this is via the external events framework. &amp;nbsp;Here's a fairly succinct explanation and example of it,&amp;nbsp;&lt;A href="https://knowledge.autodesk.com/search-result/caas/CloudHelp/cloudhelp/2016/ENU/Revit-API/files/GUID-0A0D656E-5C44-49E8-A891-6C29F88E35C0-htm.html" target="_blank"&gt;https://knowledge.autodesk.com/search-result/caas/CloudHelp/cloudhelp/2016/ENU/Revit-API/files/GUID-0A0D656E-5C44-49E8-A891-6C29F88E35C0-htm.html&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hope that helps!&lt;/P&gt;</description>
      <pubDate>Tue, 06 Jun 2017 17:00:52 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/background-processes-monitoring-or-checking/m-p/7132473#M58002</guid>
      <dc:creator>BobbyC.Jones</dc:creator>
      <dc:date>2017-06-06T17:00:52Z</dc:date>
    </item>
    <item>
      <title>Re: Background processes monitoring or checking</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/background-processes-monitoring-or-checking/m-p/7132511#M58005</link>
      <description>&lt;P&gt;Chris,&lt;/P&gt;
&lt;P&gt;I assume that the dialog is modeless, if that's not the case then you can stop reading now as I'm way off track. &amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There has been A LOT of discussion on this in the past. &amp;nbsp;Here's an excellent resource from Jeremy's blog to read up on some of it,&amp;nbsp;&lt;A href="http://thebuildingcoder.typepad.com/blog/about-the-author.html#5.28" target="_blank"&gt;http://thebuildingcoder.typepad.com/blog/about-the-author.html#5.28&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In a nutshell, the Revit API can only be accessed from the main thread. &amp;nbsp;Accessing it from a different thread, like from code behind in a modeless window, will cause errors, insidious errors in that sometimes the code will appear to work, and other times it will not.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The generally accepted way to handle this is via the external events framework. &amp;nbsp;Here's a fairly succinct explanation and example of it,&amp;nbsp;&lt;A href="https://knowledge.autodesk.com/search-result/caas/CloudHelp/cloudhelp/2016/ENU/Revit-API/files/GUID-0A0D656E-5C44-49E8-A891-6C29F88E35C0-htm.html" target="_blank"&gt;https://knowledge.autodesk.com/search-result/caas/CloudHelp/cloudhelp/2016/ENU/Revit-API/files/GUID-0A0D656E-5C44-49E8-A891-6C29F88E35C0-htm.html&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hope that helps!&lt;/P&gt;</description>
      <pubDate>Tue, 06 Jun 2017 17:13:00 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/background-processes-monitoring-or-checking/m-p/7132511#M58005</guid>
      <dc:creator>BobbyC.Jones</dc:creator>
      <dc:date>2017-06-06T17:13:00Z</dc:date>
    </item>
    <item>
      <title>Re: Background processes monitoring or checking</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/background-processes-monitoring-or-checking/m-p/7132655#M58006</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/53074"&gt;@BobbyC.Jones&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The Windows Form is called by 'ShowDialog', so it is modal and return to it's code after closing the Form. (Dialog)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The code is like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&amp;lt;Autodesk.Revit.Attributes.Transaction(Autodesk.Revit.Attributes.TransactionMode.Manual)&amp;gt;&lt;BR /&gt;&amp;lt;Autodesk.Revit.Attributes.Regeneration(Autodesk.Revit.Attributes.RegenerationOption.Manual)&amp;gt;&lt;BR /&gt;Public Class DeleteViewsNotOnSheets&lt;BR /&gt;Implements IExternalCommand&lt;BR /&gt;Private Function IExternalCommand_Execute(commandData As ExternalCommandData, ByRef message As String, elements As ElementSet) As Result Implements IExternalCommand.Execute&lt;/P&gt;&lt;P&gt;Dim MyDialog As New DialogDeleteViewsNotOnSheet(commandData)&lt;BR /&gt;MyDialog.ShowDialog()&lt;/P&gt;&lt;P&gt;Return Result.Succeeded&lt;/P&gt;&lt;P&gt;End Function&lt;BR /&gt;End Class&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The Api call is closed with 'return succeeded' after closing the dialog.&lt;/P&gt;&lt;P&gt;within the dialog there a multiple transactions, some off them are rolled-back for testing purpose only, other transactions are committed.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Am I doing something wrong by calling a Dialog like this? (Revit Wise)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This code allways returns succeeded, other tool are returning cancelled depending on the outcome of the dialog.&lt;/P&gt;&lt;P&gt;Do not really see the point in this, when the tool is cancelled, the transaction (or transactiongroup) is rolled-back and I can still return succeeded when leaving the API call.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Chris&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 06 Jun 2017 18:03:12 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/background-processes-monitoring-or-checking/m-p/7132655#M58006</guid>
      <dc:creator>c_hanschen</dc:creator>
      <dc:date>2017-06-06T18:03:12Z</dc:date>
    </item>
    <item>
      <title>Re: Background processes monitoring or checking</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/background-processes-monitoring-or-checking/m-p/7132795#M58007</link>
      <description>&lt;P&gt;I think someone asked before but how are you spinning off background processes? &amp;nbsp;If you are just starting threads or background workers in your code you could just track the number of background workers running as you call them. &amp;nbsp;In simplest form, create an integer variable in the dialog scope, when you start a background worker add 1 to it, also add a 'RunWorkerCompleted' handler and -1 to the variable in it so it removes itself from the count when the task is complete. &amp;nbsp;If the variable is 0 there aren't any running.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;That being said, why are you running these as background processes? &amp;nbsp;I have found that Revit API generally doesn't 'like' to be run from another thread and always seems to be a little less stable when I have tried. &amp;nbsp;Plus if you are trying to run them all in sequence anyway then there really isn't an advantage to running them in the background, why not just run them in a straighforward sequential execution? &amp;nbsp;If you want to start several tasks and have them run sequentially just make your dialog have checkboxes or something for all the items you want to do and then you check off what you want to run and start the whole thing and it runs them all on after another.&lt;/P&gt;</description>
      <pubDate>Tue, 06 Jun 2017 18:50:46 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/background-processes-monitoring-or-checking/m-p/7132795#M58007</guid>
      <dc:creator>swfaust</dc:creator>
      <dc:date>2017-06-06T18:50:46Z</dc:date>
    </item>
    <item>
      <title>Re: Background processes monitoring or checking</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/background-processes-monitoring-or-checking/m-p/7132866#M58008</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/807926"&gt;@c_hanschen&lt;/a&gt; wrote:&lt;BR /&gt;&lt;BR /&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The Windows Form is called by 'ShowDialog', so it is modal and return to it's code after closing the Form. (Dialog)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Because this is a modal dialog, and without seeing actual code, I can't say for certain that your crashing is due to threading issues. &amp;nbsp;I.O.W., I may be leading you down the wrong path.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/807926"&gt;@c_hanschen&lt;/a&gt; wrote:&lt;BR /&gt;&lt;BR /&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Am I doing something wrong by calling a Dialog like this? (Revit Wise)&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;The short answer is no. &amp;nbsp;I don't like code behind, but for simple modal dialogs it can work. &amp;nbsp;So ,even though I don't know for sure this is a threading issue, I still&amp;nbsp;suspect it, and if this were my code the first thing I would do to troubleshoot is yank all Revit API calls out of the code behind. &amp;nbsp;Of course that's easy for me to say, it's not my code &amp;nbsp;&lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 06 Jun 2017 19:13:56 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/background-processes-monitoring-or-checking/m-p/7132866#M58008</guid>
      <dc:creator>BobbyC.Jones</dc:creator>
      <dc:date>2017-06-06T19:13:56Z</dc:date>
    </item>
    <item>
      <title>Re: Background processes monitoring or checking</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/background-processes-monitoring-or-checking/m-p/7132978#M58009</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/776962"&gt;@swfaust&lt;/a&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;"That being said, why are you running these as background processes?"&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;I am NOT! I use background workers in standalone Windows Applications, but never in Addins, not in Revit, not in Word or what so ever.&lt;/P&gt;&lt;P&gt;What I meant is, that I think that after calling a Revit Call, the call is partly processed &lt;U&gt;by Revit&lt;/U&gt; in a background process. (finishing up)&lt;/P&gt;&lt;P&gt;And when you start a more than one Revit Api Call (not simultaneously, but after each other) the still running background processen are messed up.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks anyway for your response&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Chris&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 06 Jun 2017 19:48:54 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/background-processes-monitoring-or-checking/m-p/7132978#M58009</guid>
      <dc:creator>c_hanschen</dc:creator>
      <dc:date>2017-06-06T19:48:54Z</dc:date>
    </item>
    <item>
      <title>Re: Background processes monitoring or checking</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/background-processes-monitoring-or-checking/m-p/7132996#M58010</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/53074"&gt;@BobbyC.Jones&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;"and if this were my code the first thing I would do to troubleshoot is yank all Revit API calls out of the code behind."&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Where to put the code? it's now party in the code of the Form and partly in Modules. (VB.net)&lt;/P&gt;&lt;P&gt;Are Modules save to use? I use a lot of Modules so I can share them (linked files) over more than 1 Addin.&lt;/P&gt;&lt;P&gt;Is what you are saying, all the code should be in the same file as the 'IExternalCommand.Execute'...??&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Chris&lt;/P&gt;</description>
      <pubDate>Tue, 06 Jun 2017 19:56:00 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/background-processes-monitoring-or-checking/m-p/7132996#M58010</guid>
      <dc:creator>c_hanschen</dc:creator>
      <dc:date>2017-06-06T19:56:00Z</dc:date>
    </item>
    <item>
      <title>Re: Background processes monitoring or checking</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/background-processes-monitoring-or-checking/m-p/7133339#M58011</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/807926"&gt;@c_hanschen&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/53074"&gt;@BobbyC.Jones&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;"and if this were my code the first thing I would do to troubleshoot is yank all Revit API calls out of the code behind."&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Where to put the code? it's now party in the code of the Form and partly in Modules. (VB.net)&lt;/P&gt;
&lt;P&gt;Are Modules save to use? I use a lot of Modules so I can share them (linked files) over more than 1 Addin.&lt;/P&gt;
&lt;P&gt;Is what you are saying, all the code should be in the same file as the 'IExternalCommand.Execute'...??&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Chris&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;No, break it out into classes and modules as you see fit. &amp;nbsp;The main thing is to&amp;nbsp;separate UI code from the code that does the work. &amp;nbsp;A&amp;nbsp;basic pattern I use with a dialog is to treat the IExternalCommand.Execute() method as a controller. &amp;nbsp;It simply spins up the dialog, determines if the user cancelled or proceeded, and runs tasks using the collected data. &amp;nbsp;I prefer the MVVM pattern:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;    [Transaction(TransactionMode.Manual)]
    [Regeneration(RegenerationOption.Manual)]
    public class InsertNoteCommand : IExternalCommand
    {
        public Result Execute(ExternalCommandData commandData, ref string message, ElementSet elements)
        {
            var notesVM = new NotesViewModel(commandData.Application);

            var notesWindow = new SearchableAnnotationsView {DataContext = notesVM};

            var dialogResult = notesWindow.ShowDialog();

            if (dialogResult != true)
                return Result.Cancelled;

            var note = CommonNote.Create(notesVM.SelectedNote);

            var insertSuccess = note.Insert(notesVM.TextRotation, commandData.Application.ActiveUIDocument);

            return insertSuccess ? Result.Succeeded : Result.Failed;
        }
    }&lt;/PRE&gt;
&lt;P&gt;This allows you to test your task completely independent of the UI. &amp;nbsp;Or reuse it with a different, or no, UI. &amp;nbsp;And I believe this separation would help you isolate and diagnose these errors much better.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;    [Transaction(TransactionMode.Manual)]
    [Regeneration(RegenerationOption.Manual)]
    public class TestNoteCommand : IExternalCommand
    {
        public Result Execute(ExternalCommandData commandData, ref string message, ElementSet elements)
        {
            var text = "This is a test note.";

            var note = CommonNote.Create(text);

            var insertSuccess = note.Insert(TextRotation.Horizontal, commandData.Application.ActiveUIDocument);

            return insertSuccess ? Result.Succeeded : Result.Failed;
        }
    }&lt;/PRE&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;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 06 Jun 2017 22:22:27 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/background-processes-monitoring-or-checking/m-p/7133339#M58011</guid>
      <dc:creator>BobbyC.Jones</dc:creator>
      <dc:date>2017-06-06T22:22:27Z</dc:date>
    </item>
    <item>
      <title>Re: Background processes monitoring or checking</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/background-processes-monitoring-or-checking/m-p/7133858#M58012</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/53074"&gt;@BobbyC.Jones&lt;/a&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for all your replies..!!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm displaying a large progressbar om my dialog to show the complete progress of my tasks, this will be difficult than.&lt;/P&gt;&lt;P&gt;But I will give it a try, to shut down the dialog after collecting all the user input data and handle it in&amp;nbsp;&lt;SPAN&gt;IExternalCommand.Execute()&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;This will be later this week, but I will update you on the outcome.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thanks!&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Chris Hanschen&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;LKSVDD architecten Enschede&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;The Netherlands&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 07 Jun 2017 06:30:18 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/background-processes-monitoring-or-checking/m-p/7133858#M58012</guid>
      <dc:creator>c_hanschen</dc:creator>
      <dc:date>2017-06-07T06:30:18Z</dc:date>
    </item>
    <item>
      <title>Re: Background processes monitoring or checking</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/background-processes-monitoring-or-checking/m-p/7134003#M58013</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/807926"&gt;@c_hanschen&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;I have to agree with &lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/53074"&gt;@BobbyC.Jones&lt;/a&gt;&amp;nbsp;about code separation. It makes things a lot simpler.&lt;/P&gt;
&lt;P&gt;You can always pop up a progress dialog, but get it working first!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I usually get the code working, then add the UI. The code runs the dialog, not the dialog running the code.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Let us know how you get on.&lt;/P&gt;</description>
      <pubDate>Wed, 07 Jun 2017 07:40:54 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/background-processes-monitoring-or-checking/m-p/7134003#M58013</guid>
      <dc:creator>matthew_taylor</dc:creator>
      <dc:date>2017-06-07T07:40:54Z</dc:date>
    </item>
    <item>
      <title>Re: Background processes monitoring or checking</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/background-processes-monitoring-or-checking/m-p/7135295#M58014</link>
      <description>&lt;P&gt;Gotcha, sorry I misunderstood then. &amp;nbsp;I would agree with the others then, try testing the code independently of the dialog and then start adding UI layer on to it and see if you start getting an issue...&lt;/P&gt;</description>
      <pubDate>Wed, 07 Jun 2017 15:27:01 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/background-processes-monitoring-or-checking/m-p/7135295#M58014</guid>
      <dc:creator>swfaust</dc:creator>
      <dc:date>2017-06-07T15:27:01Z</dc:date>
    </item>
    <item>
      <title>Re: Background processes monitoring or checking</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/background-processes-monitoring-or-checking/m-p/7135841#M58015</link>
      <description>&lt;P&gt;&lt;EM&gt;comment of&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/53074"&gt;@BobbyC.Jones&lt;/a&gt;: "How are you launching your 'tasks', from code behind in a dialog box?"&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;I accepted this comment as solution..!!!&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I removed the code from behind my Dialog to the 'IExternalCommand.Execute' Class/Function and the problem was solved..!!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you guys a lot,&amp;nbsp;&lt;SPAN&gt;I never thought that this could be the problem.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;It sets me way back in functionality&amp;nbsp;of my tool, because now the progress indicator&amp;nbsp;is gone and the cancel-function is gone too.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I have to rewrite that functionality, but that may not be the problem...&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;THANKS, THANKS, THANKS..!!&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Chris Hanschen&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;LKSVDD architecten Enschede&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;The Netherlands&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 07 Jun 2017 18:15:35 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/background-processes-monitoring-or-checking/m-p/7135841#M58015</guid>
      <dc:creator>c_hanschen</dc:creator>
      <dc:date>2017-06-07T18:15:35Z</dc:date>
    </item>
    <item>
      <title>Re: Background processes monitoring or checking</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/background-processes-monitoring-or-checking/m-p/7146777#M58016</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/53074"&gt;@BobbyC.Jones&lt;/a&gt;&amp;nbsp;and&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/776962"&gt;@swfaust&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;this story continues on page:&lt;/P&gt;&lt;P&gt;&lt;A href="https://forums.autodesk.com/t5/revit-architecture-forum/known-bug-list/m-p/7145065/highlight/false#M152465&amp;nbsp;" target="_blank"&gt;https://forums.autodesk.com/t5/revit-architecture-forum/known-bug-list/m-p/7145065/highlight/false#M152465&amp;nbsp;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Chris Hanschen&lt;/P&gt;&lt;P&gt;LKSVDD Architecten Enschede&lt;/P&gt;&lt;P&gt;The Netherlands&lt;/P&gt;</description>
      <pubDate>Mon, 12 Jun 2017 19:04:17 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/background-processes-monitoring-or-checking/m-p/7146777#M58016</guid>
      <dc:creator>c_hanschen</dc:creator>
      <dc:date>2017-06-12T19:04:17Z</dc:date>
    </item>
  </channel>
</rss>

