<?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: Progress Dialog not always updating in Revit API Forum</title>
    <link>https://forums.autodesk.com/t5/revit-api-forum/progress-dialog-not-always-updating/m-p/7571868#M54594</link>
    <description>&lt;P&gt;Hi David,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You right, the form is a simple Windows Form and I'm not doing anything complex that requires input.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm unsure how to cell the code from the dialog -I tried to do that once before but had issues&amp;nbsp;the code not knowing the variables that I had set previously...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I guess&amp;nbsp;this is because I'm not passing the variables from the code to the dialog and back again correctly.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'll try to do it again...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sat, 25 Nov 2017 09:16:46 GMT</pubDate>
    <dc:creator>Kevin.Bell</dc:creator>
    <dc:date>2017-11-25T09:16:46Z</dc:date>
    <item>
      <title>Progress Dialog not always updating</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/progress-dialog-not-always-updating/m-p/7561097#M54589</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I’ve created a C# routine which processed Areas and creates plans from them – they all works really well and I’m happy with the result.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There is one minor issue, which is, when the routine runs on a big model, it takes a while to complete and the user assumes that Revit has crashed.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I added a progress dialog in the form of a Modeless dialog which has two progress counters on it. As the routine executes it updates the progress counters and informs the users.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I found that I had to call dialog.Refresh() every time I updated the counter otherwise the dialog would not update.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So this all works fine on the machine I wrote the code on, but I’ve found when I run it on another machine the progress dialog doesn’t update. Sometimes it does update one of the progress counters, other times the whole dialog doesn’t refresh and it displays as white blocks.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I’m struggling to understand why it works fine on one machine and not on another.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I’d appreciate some tips on getting this to work.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 21 Nov 2017 08:40:23 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/progress-dialog-not-always-updating/m-p/7561097#M54589</guid>
      <dc:creator>Kevin.Bell</dc:creator>
      <dc:date>2017-11-21T08:40:23Z</dc:date>
    </item>
    <item>
      <title>Re: Progress Dialog not always updating</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/progress-dialog-not-always-updating/m-p/7563655#M54590</link>
      <description>&lt;P&gt;Try throwing in a&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;System.Windows.Forms.Application.DoEvents()&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;e.g.&lt;/P&gt;&lt;P&gt;pdialog.pBar.PerformStep()&lt;BR /&gt;pdialog.label.Text = "Processing: " &amp;amp; f.Name&lt;BR /&gt;System.Windows.Forms.Application.DoEvents()&lt;/P&gt;</description>
      <pubDate>Tue, 21 Nov 2017 23:27:53 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/progress-dialog-not-always-updating/m-p/7563655#M54590</guid>
      <dc:creator>aricke59</dc:creator>
      <dc:date>2017-11-21T23:27:53Z</dc:date>
    </item>
    <item>
      <title>Re: Progress Dialog not always updating</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/progress-dialog-not-always-updating/m-p/7569875#M54591</link>
      <description>&lt;P&gt;arike - that's for your response, I tried it, but it made no difference&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Strangely, the dialog closed and control was returned to Revit and then a minute later my routine reported that it has completed...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Its also strange that dialog.Refresh() doesn't actually update the dialog...&lt;/P&gt;</description>
      <pubDate>Fri, 24 Nov 2017 08:22:55 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/progress-dialog-not-always-updating/m-p/7569875#M54591</guid>
      <dc:creator>Kevin.Bell</dc:creator>
      <dc:date>2017-11-24T08:22:55Z</dc:date>
    </item>
    <item>
      <title>Re: Progress Dialog not always updating</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/progress-dialog-not-always-updating/m-p/7569900#M54592</link>
      <description>&lt;P&gt;Perhaps the solution should be to use a modal dialog box rather than a modeless one...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;At the moment I have a c# class which call the a modal dialog which collects user input, on close the class then does the tasks and displays a modeless dialog to give progress (which doesn't work).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Perhaps if I moved all the code which does the processing tasks into the OK button function of the dialog, that way the routine would execute with a modal dialog which could also display progress.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm fairly new to c# as you can probably tell, I'm not too sure whether this would work or not...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;(I hope the above makes sense!)&lt;/P&gt;</description>
      <pubDate>Fri, 24 Nov 2017 08:34:27 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/progress-dialog-not-always-updating/m-p/7569900#M54592</guid>
      <dc:creator>Kevin.Bell</dc:creator>
      <dc:date>2017-11-24T08:34:27Z</dc:date>
    </item>
    <item>
      <title>Re: Progress Dialog not always updating</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/progress-dialog-not-always-updating/m-p/7570557#M54593</link>
      <description>&lt;P&gt;Hi Kevin,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm not sure that you need to have the progress dialog&amp;nbsp;as modeless? You're not expecting the user to do anything with Revit while your code runs, and your code is happy running behind a modal dialog? So why not just launch the modal progress box and&amp;nbsp;call your processing from there? Then you can do the progress updates easily, deal with a 'cancel' button, etc.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm assuming you're using simple Windows Forms, and not complex MVVC WPF stuff...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The modeless option is fine, but it's a trickier thing to get right IMHO.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Kind regards,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;David&lt;/P&gt;</description>
      <pubDate>Fri, 24 Nov 2017 13:47:47 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/progress-dialog-not-always-updating/m-p/7570557#M54593</guid>
      <dc:creator>DavidWoodCT</dc:creator>
      <dc:date>2017-11-24T13:47:47Z</dc:date>
    </item>
    <item>
      <title>Re: Progress Dialog not always updating</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/progress-dialog-not-always-updating/m-p/7571868#M54594</link>
      <description>&lt;P&gt;Hi David,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You right, the form is a simple Windows Form and I'm not doing anything complex that requires input.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm unsure how to cell the code from the dialog -I tried to do that once before but had issues&amp;nbsp;the code not knowing the variables that I had set previously...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I guess&amp;nbsp;this is because I'm not passing the variables from the code to the dialog and back again correctly.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'll try to do it again...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 25 Nov 2017 09:16:46 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/progress-dialog-not-always-updating/m-p/7571868#M54594</guid>
      <dc:creator>Kevin.Bell</dc:creator>
      <dc:date>2017-11-25T09:16:46Z</dc:date>
    </item>
    <item>
      <title>Re: Progress Dialog not always updating</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/progress-dialog-not-always-updating/m-p/7572601#M54595</link>
      <description>&lt;P&gt;Hi Kevin,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Yes, you have to&amp;nbsp;look after the Scope of the variables.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I guess if I was approaching this, I'd split the 'processing code' into a separate class, which I'd instantiate from the progress dialog. Then I'd know which data I had to pass at each step: callingClass -&amp;gt; getUserDataDialog -&amp;gt; progressDialog -&amp;gt; processingClass. But there are plenty of other ways you could do it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Kind regards&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;David&lt;/P&gt;</description>
      <pubDate>Sat, 25 Nov 2017 22:38:30 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/progress-dialog-not-always-updating/m-p/7572601#M54595</guid>
      <dc:creator>DavidWoodCT</dc:creator>
      <dc:date>2017-11-25T22:38:30Z</dc:date>
    </item>
    <item>
      <title>Re: Progress Dialog not always updating</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/progress-dialog-not-always-updating/m-p/7573525#M54596</link>
      <description>&lt;P&gt;David,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks - your suggestion worked well.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Cheers,&lt;/P&gt;
&lt;P&gt;Kevin.&lt;/P&gt;</description>
      <pubDate>Sun, 26 Nov 2017 22:08:25 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/progress-dialog-not-always-updating/m-p/7573525#M54596</guid>
      <dc:creator>Kevin.Bell</dc:creator>
      <dc:date>2017-11-26T22:08:25Z</dc:date>
    </item>
  </channel>
</rss>

