<?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: loop in revit program in Revit API Forum</title>
    <link>https://forums.autodesk.com/t5/revit-api-forum/loop-in-revit-program/m-p/2651921#M82315</link>
    <description>They have you pushing the envelop don't they...  To run a program on a timer, you can: open a form that never closes, and uses its own 'on timer' event.  Or spin off a thread that runs it's own on timer.  The product of what happens on that timer will determine your biggest problem.  Are you accessing the Revit database on that timer? Does the timer stop to allow the user/program to do other things, or is it running the entire time expecting the user to work simultaneously? Most external commands expect the control to return to Revit when it's DONE running, but if your not going to finish, then control is never returned, hince the reason for a separate thread, or form that never closes.&lt;BR /&gt;
&lt;BR /&gt;
jvj</description>
    <pubDate>Fri, 19 Mar 2010 20:20:43 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2010-03-19T20:20:43Z</dc:date>
    <item>
      <title>loop in revit program</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/loop-in-revit-program/m-p/2651920#M82314</link>
      <description>Hi, i am trying to run an api program written C#. How can i get it to keep running continously. For example, to perform an operation every 10milliseconds. Is there a command for this?</description>
      <pubDate>Fri, 19 Mar 2010 19:33:15 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/loop-in-revit-program/m-p/2651920#M82314</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2010-03-19T19:33:15Z</dc:date>
    </item>
    <item>
      <title>Re: loop in revit program</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/loop-in-revit-program/m-p/2651921#M82315</link>
      <description>They have you pushing the envelop don't they...  To run a program on a timer, you can: open a form that never closes, and uses its own 'on timer' event.  Or spin off a thread that runs it's own on timer.  The product of what happens on that timer will determine your biggest problem.  Are you accessing the Revit database on that timer? Does the timer stop to allow the user/program to do other things, or is it running the entire time expecting the user to work simultaneously? Most external commands expect the control to return to Revit when it's DONE running, but if your not going to finish, then control is never returned, hince the reason for a separate thread, or form that never closes.&lt;BR /&gt;
&lt;BR /&gt;
jvj</description>
      <pubDate>Fri, 19 Mar 2010 20:20:43 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/loop-in-revit-program/m-p/2651921#M82315</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2010-03-19T20:20:43Z</dc:date>
    </item>
    <item>
      <title>Re: loop in revit program</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/loop-in-revit-program/m-p/2651922#M82316</link>
      <description>Jamie, Yes i am accessing the Revit database and i want my program to keep running continiously. Can you give an example of what you wrote earlier? Thanks</description>
      <pubDate>Fri, 19 Mar 2010 20:29:47 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/loop-in-revit-program/m-p/2651922#M82316</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2010-03-19T20:29:47Z</dc:date>
    </item>
    <item>
      <title>Re: loop in revit program</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/loop-in-revit-program/m-p/2651923#M82317</link>
      <description>Because of the complexity your about to approach, strap in and hang on.  What is the tool supposed to do every 10 seconds, that's hardly long enough to let the machine process a single command?  First lets use the easier method, and just create a form that does NOT open modal, just use form.show (not form.showDialog).    Then the external command can quit, return succeeded.  This form should stay open until the user closes it.  &lt;BR /&gt;
To get the timer you need to go to the VisualStudio Toolbox, Components group, and drag the timmer onto the form (it hides at the bottom of the screen).  Set the interval on the timmer (in millisecons) in its properties.  Then place your event code on the form.  (I'm a vb Programmer so bear with me)&lt;BR /&gt;
&lt;P&gt;
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
&lt;/P&gt;
&lt;P&gt;
End Sub&lt;BR /&gt;
After you open the form, the timmer will continue to tick away until you close the form, or write code to bypass the timmer tick procedure like&lt;BR /&gt;
If runTimmer Then&lt;BR /&gt;
'do something&lt;BR /&gt;
End If&lt;BR /&gt;
As such you can but a button on the form that affects the runTimmer boolean so that the tick will do something or not.&lt;BR /&gt;
&lt;BR /&gt;
jvj
&lt;/P&gt;</description>
      <pubDate>Fri, 19 Mar 2010 20:53:00 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/loop-in-revit-program/m-p/2651923#M82317</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2010-03-19T20:53:00Z</dc:date>
    </item>
    <item>
      <title>Re: loop in revit program</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/loop-in-revit-program/m-p/2651924#M82318</link>
      <description>Thanks Jamie, but the revit application uses a class and not a windows form application. I cannot even access the toolbox and properties window. So how do i do this?</description>
      <pubDate>Sat, 20 Mar 2010 00:03:58 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/loop-in-revit-program/m-p/2651924#M82318</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2010-03-20T00:03:58Z</dc:date>
    </item>
    <item>
      <title>Re: loop in revit program</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/loop-in-revit-program/m-p/2651925#M82319</link>
      <description>When you are working in a Visual Studio, or even VSTA project, you can right click on the project, or solution, and select Add Windows Form.  That form will become part of your custom dll when you build.&lt;BR /&gt;
&lt;BR /&gt;
jvj</description>
      <pubDate>Sat, 20 Mar 2010 00:10:57 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/loop-in-revit-program/m-p/2651925#M82319</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2010-03-20T00:10:57Z</dc:date>
    </item>
    <item>
      <title>Re: loop in revit program</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/loop-in-revit-program/m-p/2651926#M82320</link>
      <description>Hello Jamie, I am a little lost. Pls, find attached my code. Can you help me out? Thanks alot. (You can create your own database and change the path to the database).</description>
      <pubDate>Sat, 20 Mar 2010 12:54:03 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/loop-in-revit-program/m-p/2651926#M82320</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2010-03-20T12:54:03Z</dc:date>
    </item>
    <item>
      <title>Re: loop in revit program</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/loop-in-revit-program/m-p/2651927#M82321</link>
      <description>Hello,&lt;BR /&gt;
1. In VisualStudio when writing to RevitAPI.dll, there are differences than VSTA.  Document.get_element is now Document.Element; and same with parameter.  You don't really have to get the parameter to set it in two lines.  You can say element.parameter(name).set(value)&lt;BR /&gt;
2. No clue what your multitable variable is, so I'll assume that's not the problem here.&lt;BR /&gt;
3. It would be a VERY good idea to confirm that the variable myElement is valid after getting it.  If myElement isnot nothing then get to work.  You very well my have element id's that are not in the drawing.&lt;BR /&gt;
4. IF your database stores information, then you close the project, then you open the project and expect those ids to be the same, your in for a world of hurt.  The only value that is the same is element.UniqueID (which is a guid object type).  Currently finding an object by it's uniqueID is a bit different. myElement = Document.Element(guid.tostring)&lt;BR /&gt;
That all I got.&lt;BR /&gt;
jvj</description>
      <pubDate>Sat, 20 Mar 2010 20:35:07 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/loop-in-revit-program/m-p/2651927#M82321</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2010-03-20T20:35:07Z</dc:date>
    </item>
    <item>
      <title>Re: loop in revit program</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/loop-in-revit-program/m-p/2651928#M82322</link>
      <description>Oh you got me wrong. The program actually works and runs fine. All i want you to do is to help me place it in a loop so that it keeps looking into the database and getting values to set. That is, i want it to keep running continiously. &lt;BR /&gt;
I could not follow the procedure you gave me. Pls help.</description>
      <pubDate>Sun, 21 Mar 2010 00:33:09 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/loop-in-revit-program/m-p/2651928#M82322</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2010-03-21T00:33:09Z</dc:date>
    </item>
    <item>
      <title>Re: loop in revit program</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/loop-in-revit-program/m-p/2651929#M82323</link>
      <description>Ok It appears you are using VSTA.  So you need to right click on the project name in the Project Explorer Window and select Add, Windows Form... Then it will create a form that consists of 3 files. A form.vb, a form.designer.vb, and a form.resex file.  That is where you will setup your timer.  The code for my form.vb and form.designer.vb are attached in this text file.&lt;BR /&gt;
jvj</description>
      <pubDate>Sun, 21 Mar 2010 03:31:21 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/loop-in-revit-program/m-p/2651929#M82323</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2010-03-21T03:31:21Z</dc:date>
    </item>
    <item>
      <title>Re: loop in revit program</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/loop-in-revit-program/m-p/2651930#M82324</link>
      <description>Thanks alot. I finally had it work. I am actually new to C#. I also have another question: How can i change the colors of elements and have them display on the interface. E.g. making a door change to red or blue to display its status. Does revit have that functionality? If this is not possible, is it possible to use "transparency"?</description>
      <pubDate>Fri, 26 Mar 2010 18:30:33 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/loop-in-revit-program/m-p/2651930#M82324</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2010-03-26T18:30:33Z</dc:date>
    </item>
  </channel>
</rss>

