<?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: How to solve multi-thread problem for loop set parameter. in Revit API Forum</title>
    <link>https://forums.autodesk.com/t5/revit-api-forum/how-to-solve-multi-thread-problem-for-loop-set-parameter/m-p/8315398#M47130</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;if you just want to display data in a model, you could use the AVF:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="http://thebuildingcoder.typepad.com/blog/2017/03/rvtfader-avf-ray-tracing-and-signal-attenuation.html" target="_blank"&gt;http://thebuildingcoder.typepad.com/blog/2017/03/rvtfader-avf-ray-tracing-and-signal-attenuation.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You can create non-element geometry at runtime to get faces for displaying your values.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="http://thebuildingcoder.typepad.com/blog/2011/12/using-avf-to-display-intersections-and-highlight-rooms.html" target="_blank"&gt;http://thebuildingcoder.typepad.com/blog/2011/12/using-avf-to-display-intersections-and-highlight-rooms.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Note that you have more color and display options (color gradients, points, values, color legends) than you have using just&lt;/P&gt;&lt;P&gt;materials and plain colors.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What I meant by "undo stack" is this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="UndoStack.png" style="width: 337px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/554307iF5302FBFAD23D0A1/image-size/large?v=v2&amp;amp;px=999" role="button" title="UndoStack.png" alt="UndoStack.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Every time you commit a transaction, there is a new entry in this list.&lt;/P&gt;&lt;P&gt;If you set parameters each second, there will be 60 entries after just a minute.&lt;/P&gt;&lt;P&gt;If the user is about to change another parameter and needs more than a second to do so, his changes will be rollbacked, as you can read in the forum topic I've linked.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I think the "Start" and "Cancel" buttons are a good way to show the user that he is in a sort of "playback mode", so he really knows that he cannot work on the model but can "enjoy the show".&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Revitalizer&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 05 Oct 2018 12:47:00 GMT</pubDate>
    <dc:creator>Revitalizer</dc:creator>
    <dc:date>2018-10-05T12:47:00Z</dc:date>
    <item>
      <title>How to solve multi-thread problem for loop set parameter.</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/how-to-solve-multi-thread-problem-for-loop-set-parameter/m-p/8314857#M47127</link>
      <description>&lt;P&gt;Hi, everybody now i&amp;nbsp;am facing a problem, i want to from&amp;nbsp; mysql read data and set this data to revit element parameter although I completed the mysql connection and set the parameters of the code,but i use&amp;nbsp;timer1_Tick function to set parameters every second then revit crashes,i&amp;nbsp;tried to use dynamo node to repeatedly read mysql data and use it to set element parameters,i&amp;nbsp;think revit api can do the same thing.&lt;/P&gt;&lt;P&gt;You may ask me why not use dynamo, because when I use dynamo to do this, the program will be very slow so I want to try using revit&amp;nbsp; api to do this&lt;/P&gt;&lt;P&gt;Can anyone give me some advice or sample code?&lt;/P&gt;&lt;P&gt;Thank you all&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="mysql.JPG" style="width: 999px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/554199iAD4FDC774EA03A5D/image-size/large?v=v2&amp;amp;px=999" role="button" title="mysql.JPG" alt="mysql.JPG" /&gt;&lt;/span&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 05 Oct 2018 08:59:56 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/how-to-solve-multi-thread-problem-for-loop-set-parameter/m-p/8314857#M47127</guid>
      <dc:creator>cxyz278</dc:creator>
      <dc:date>2018-10-05T08:59:56Z</dc:date>
    </item>
    <item>
      <title>Re: How to solve multi-thread problem for loop set parameter.</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/how-to-solve-multi-thread-problem-for-loop-set-parameter/m-p/8314980#M47128</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;bad idea.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;One update per second is way to much.&lt;/P&gt;&lt;P&gt;You will prevent the user from editing data &lt;EM&gt;manually&lt;/EM&gt;, this way.&lt;/P&gt;&lt;P&gt;&lt;A href="https://forums.autodesk.com/t5/revit-api-forum/properties-dialog-doesnt-accept-input-when-commit-transaction/m-p/7768959#M28583" target="_blank"&gt;https://forums.autodesk.com/t5/revit-api-forum/properties-dialog-doesnt-accept-input-when-commit-transaction/m-p/7768959#M28583&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Also, you will pollute the undo stack, so the user will no be able to return to a given transaction within a couple of seconds.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Why not using the existing events, DocumentClosing, DocumentSaving, DocumentSavingAs etc.?&lt;/P&gt;&lt;P&gt;You still could trigger setting the parameters independent of any events - additionally, but not in a continuous loop...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Revitalizer&lt;/P&gt;</description>
      <pubDate>Fri, 05 Oct 2018 09:54:51 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/how-to-solve-multi-thread-problem-for-loop-set-parameter/m-p/8314980#M47128</guid>
      <dc:creator>Revitalizer</dc:creator>
      <dc:date>2018-10-05T09:54:51Z</dc:date>
    </item>
    <item>
      <title>Re: How to solve multi-thread problem for loop set parameter.</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/how-to-solve-multi-thread-problem-for-loop-set-parameter/m-p/8315090#M47129</link>
      <description>&lt;P&gt;Sorry, my English is not very good. I still don’t fully understand what you gave me.&lt;/P&gt;&lt;P&gt;Let me talk about what I want to do first,i want to use api&amp;nbsp; reach the effect of the following image,below image is i did it with&amp;nbsp; dynamo node ,the process is like third image , but dynamo is too slow .&lt;/P&gt;&lt;P&gt;So if I want to achieve this effect,is it possible for me to use some events as you said?&lt;/P&gt;&lt;P&gt;I want to build click start button then program start, continue until I press the Cancel button,is this a good idea?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="one pat" style="width: 999px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/554234i83AC0749572058B8/image-size/large?v=v2&amp;amp;px=999" role="button" title="Positioning_video[2018-10-05-18-19-32].JPG" alt="one pat" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;one pat&lt;/span&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="two pat as same time" style="width: 999px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/554235i78D2B02BF4BF4C21/image-size/large?v=v2&amp;amp;px=999" role="button" title="擷取.JPG" alt="two pat as same time" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;two pat as same time&lt;/span&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="擷取.JPG" style="width: 999px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/554253i0A54D60C322E0CF8/image-size/large?v=v2&amp;amp;px=999" role="button" title="擷取.JPG" alt="擷取.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 05 Oct 2018 10:53:45 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/how-to-solve-multi-thread-problem-for-loop-set-parameter/m-p/8315090#M47129</guid>
      <dc:creator>cxyz278</dc:creator>
      <dc:date>2018-10-05T10:53:45Z</dc:date>
    </item>
    <item>
      <title>Re: How to solve multi-thread problem for loop set parameter.</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/how-to-solve-multi-thread-problem-for-loop-set-parameter/m-p/8315398#M47130</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;if you just want to display data in a model, you could use the AVF:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="http://thebuildingcoder.typepad.com/blog/2017/03/rvtfader-avf-ray-tracing-and-signal-attenuation.html" target="_blank"&gt;http://thebuildingcoder.typepad.com/blog/2017/03/rvtfader-avf-ray-tracing-and-signal-attenuation.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You can create non-element geometry at runtime to get faces for displaying your values.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="http://thebuildingcoder.typepad.com/blog/2011/12/using-avf-to-display-intersections-and-highlight-rooms.html" target="_blank"&gt;http://thebuildingcoder.typepad.com/blog/2011/12/using-avf-to-display-intersections-and-highlight-rooms.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Note that you have more color and display options (color gradients, points, values, color legends) than you have using just&lt;/P&gt;&lt;P&gt;materials and plain colors.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What I meant by "undo stack" is this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="UndoStack.png" style="width: 337px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/554307iF5302FBFAD23D0A1/image-size/large?v=v2&amp;amp;px=999" role="button" title="UndoStack.png" alt="UndoStack.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Every time you commit a transaction, there is a new entry in this list.&lt;/P&gt;&lt;P&gt;If you set parameters each second, there will be 60 entries after just a minute.&lt;/P&gt;&lt;P&gt;If the user is about to change another parameter and needs more than a second to do so, his changes will be rollbacked, as you can read in the forum topic I've linked.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I think the "Start" and "Cancel" buttons are a good way to show the user that he is in a sort of "playback mode", so he really knows that he cannot work on the model but can "enjoy the show".&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Revitalizer&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 05 Oct 2018 12:47:00 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/how-to-solve-multi-thread-problem-for-loop-set-parameter/m-p/8315398#M47130</guid>
      <dc:creator>Revitalizer</dc:creator>
      <dc:date>2018-10-05T12:47:00Z</dc:date>
    </item>
  </channel>
</rss>

