<?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 File time counter in Inventor Programming - iLogic, Macros, AddIns &amp; Apprentice</title>
    <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/file-time-counter/m-p/9979862#M119606</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;is it possible to create a Logic which, when started, would show how much time in total (I mean closing and reopening) was spent working on that file?&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 05 Jan 2021 17:41:42 GMT</pubDate>
    <dc:creator>kresh.bell</dc:creator>
    <dc:date>2021-01-05T17:41:42Z</dc:date>
    <item>
      <title>File time counter</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/file-time-counter/m-p/9979862#M119606</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;is it possible to create a Logic which, when started, would show how much time in total (I mean closing and reopening) was spent working on that file?&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 05 Jan 2021 17:41:42 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/file-time-counter/m-p/9979862#M119606</guid>
      <dc:creator>kresh.bell</dc:creator>
      <dc:date>2021-01-05T17:41:42Z</dc:date>
    </item>
    <item>
      <title>Re: File time counter</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/file-time-counter/m-p/9980045#M119611</link>
      <description>&lt;P&gt;Here is a simple Stopwatch example.&amp;nbsp; It uses the System.Diagnostics.Stopwatch Class.&amp;nbsp; It is often used to gauge elapsed time differences between different versions of the same code/application for efficiency purposes.&amp;nbsp; Maybe you can use this object to achieve your goal.&lt;/P&gt;&lt;LI-CODE lang="general"&gt;Dim oTimer As New Stopwatch
oTimer.Start
'Do some stuff here
Dim i As Long
Dim oCode As Long
'simply gives it something to do a bunch of times for the example
'should only take a few seconds
For i = 1 To 1000000
	oCode = ThisApplication.Locale
Next
oTimer.Stop
'This one is more specific (shows 3 decimal places after seconds)
MsgBox("Elapsed time = " &amp;amp; oTimer.ElapsedMilliseconds / 1000 &amp;amp; " seconds", vbOKOnly, " ")
'or this one doesn't have any decimal places
'MsgBox("Elapsed time = " &amp;amp; oTimer.Elapsed.Seconds &amp;amp; " seconds",vbOKOnly," ") &lt;/LI-CODE&gt;&lt;P&gt;If this solved your problem, or answered your question, please click &lt;SPAN style="background-color: green; color: white;"&gt;&lt;STRONG&gt;ACCEPT SOLUTION&lt;/STRONG&gt;&lt;/SPAN&gt;.&lt;BR /&gt;Or, if this helped you, please click 'LIKE' &lt;SPAN&gt;&lt;img class="lia-deferred-image lia-image-emoji" src="https://forums.autodesk.com/html/@7401B55A0A518861312A0F851CD29320/emoticons/1f44d.png" alt=":thumbs_up:" title=":thumbs_up:" /&gt;&lt;/SPAN&gt;.&lt;/P&gt;&lt;P&gt;If you have time, please... Vote For &lt;A href="https://forums.autodesk.com/t5/forums/recentpostspage/post-type/message/interaction-style/idea/user-id/7812054/" target="_blank"&gt;My IDEAS &lt;SPAN&gt;&lt;img class="lia-deferred-image lia-image-emoji" src="https://forums.autodesk.com/html/@B166FEBB95D67CFA84899D32D8E17FC1/emoticons/1f4a1.png" alt=":light_bulb:" title=":light_bulb:" /&gt;&lt;/SPAN&gt;&lt;/A&gt;and Explore &lt;A href="https://knowledge.autodesk.com/profile/LTSUSR7HXMSAE/articles" target="_blank"&gt;My CONTRIBUTIONS &lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://help.autodesk.com/view/INVNTOR/2021/ENU/" target="_blank"&gt;Inventor 2021 Help &lt;/A&gt;| &lt;A href="https://forums.autodesk.com/t5/inventor-forum/bd-p/78/" target="_blank"&gt;Inventor Forum &lt;/A&gt;| &lt;A href="https://forums.autodesk.com/t5/inventor-customization/bd-p/120/" target="_blank"&gt;Inventor Customization Forum &lt;/A&gt;| &lt;A href="https://forums.autodesk.com/t5/inventor-ideas/idb-p/v1232/" target="_blank"&gt;Inventor Ideas Forum &lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 05 Jan 2021 18:55:24 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/file-time-counter/m-p/9980045#M119611</guid>
      <dc:creator>WCrihfield</dc:creator>
      <dc:date>2021-01-05T18:55:24Z</dc:date>
    </item>
    <item>
      <title>Re: File time counter</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/file-time-counter/m-p/9980199#M119614</link>
      <description>&lt;P&gt;Here is another simple 'Timer' example rule, which uses a different method.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Dim oStart, oFinish, oTotal As Double
MsgBox("Click 'OK' to start the timer.",,"")
oStart = Microsoft.VisualBasic.DateAndTime.Timer
MsgBox("Click 'STOP' to stop the timer.",,"")
oFinish = Microsoft.VisualBasic.DateAndTime.Timer
oTotal = oFinish - oStart
MsgBox(oTotal &amp;amp; " seconds have elapsed.",,"")&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If this solved your problem, or answered your question, please click &lt;SPAN style="background-color: green; color: white;"&gt;&lt;STRONG&gt;ACCEPT SOLUTION&lt;/STRONG&gt;&lt;/SPAN&gt;.&lt;BR /&gt;Or, if this helped you, please click 'LIKE' &lt;SPAN&gt;&lt;img class="lia-deferred-image lia-image-emoji" src="https://forums.autodesk.com/html/@7401B55A0A518861312A0F851CD29320/emoticons/1f44d.png" alt=":thumbs_up:" title=":thumbs_up:" /&gt;&lt;/SPAN&gt;.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 05 Jan 2021 19:46:15 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/file-time-counter/m-p/9980199#M119614</guid>
      <dc:creator>WCrihfield</dc:creator>
      <dc:date>2021-01-05T19:46:15Z</dc:date>
    </item>
    <item>
      <title>Re: File time counter</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/file-time-counter/m-p/9981199#M119637</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/4988405"&gt;@kresh.bell&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Check out the below link on&amp;nbsp;@Anonymous&lt;/a&gt;&amp;nbsp;Unofficial Inventor blog, which is explaining the same thing you are trying to achieve.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://clintbrown.co.uk/2020/12/12/ilogic-file-open-timer/" target="_blank" rel="noopener"&gt;https://clintbrown.co.uk/2020/12/12/ilogic-file-open-timer/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope this will be helpful.&lt;/P&gt;</description>
      <pubDate>Wed, 06 Jan 2021 07:03:34 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/file-time-counter/m-p/9981199#M119637</guid>
      <dc:creator>dutt.thakar</dc:creator>
      <dc:date>2021-01-06T07:03:34Z</dc:date>
    </item>
    <item>
      <title>Re: File time counter</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/file-time-counter/m-p/9981379#M119639</link>
      <description>&lt;P&gt;&lt;SPAN class="JLqJ4b ChMk0b"&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="JLqJ4b ChMk0b"&gt;&lt;SPAN&gt;thanks but i didn't mean that.&lt;/SPAN&gt;&lt;/SPAN&gt; &lt;SPAN class="JLqJ4b ChMk0b"&gt;&lt;SPAN&gt;I work on multiple projects at the same time.&lt;/SPAN&gt;&lt;/SPAN&gt; &lt;SPAN class="JLqJ4b ChMk0b"&gt;&lt;SPAN&gt;I would like to know how much time I have worked on a project without having to write down the time on paper&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 06 Jan 2021 09:16:56 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/file-time-counter/m-p/9981379#M119639</guid>
      <dc:creator>kresh.bell</dc:creator>
      <dc:date>2021-01-06T09:16:56Z</dc:date>
    </item>
    <item>
      <title>Re: File time counter</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/file-time-counter/m-p/9981714#M119652</link>
      <description>&lt;P&gt;OK.&amp;nbsp; I think I understand now.&amp;nbsp; I'm thinking you might need something like an Addon or a standalone app to accomplish that, instead of iLogic rules or VBA macros.&amp;nbsp; You need something that will automatically activate in the background, no mater what documents you may be opening, working with, or closing, and stay active in the background until all documents (or the application) are closed, then it will automatically stop and write elapsed time data to a static file on your hard drive, which can later be accessed and multiple session times summed up to a total project time.&amp;nbsp; Sounds like it may be doable though.&amp;nbsp; Unfortunately I may not be a lot of help there, because our company doesn't currently allow any employees Admin rights on their own PC's, so creating Addins is not possible for me at this time.&lt;/P&gt;&lt;P&gt;&amp;nbsp; The closest non-addin solution I can think of right now would be something like the following:&lt;/P&gt;&lt;P&gt;An external iLogic rule that is set-up within your Event Triggers dialog, under the "All Documents" tab, under "New Document", "After Open Document", and "Close Document", so it will be fired by all these events.&amp;nbsp; Then at the top of your rule, to avoid unnecessary runs/processes, have some code that checks (for when Open has triggered it) if any other documents are already open.&amp;nbsp; If no other docs are open, write this event start time to file.&amp;nbsp; If other docs are already open, your still working, so ignore it and exit the rule.&amp;nbsp; Also, at the top as a check (for when Close has triggered it), see if any docs are left open.&amp;nbsp; If no docs are open, it just closed the last one, so write this finish time to file.&amp;nbsp; Then later in the rule, you can have some code to retrieve and sum up (calculate) all current entries within that data file (likely Excel file), and offer an option to display it.&amp;nbsp; At least that's what's rolling around in my head.&amp;nbsp; Does that make sense to you?&lt;/P&gt;&lt;P&gt;I hope this helps in some way.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If this solved your problem, or answered your question, please click &lt;SPAN style="background-color: green; color: white;"&gt;&lt;STRONG&gt;ACCEPT SOLUTION&lt;/STRONG&gt;&lt;/SPAN&gt;.&lt;BR /&gt;Or, if this helped you, please click 'LIKE' &lt;SPAN&gt;&lt;img class="lia-deferred-image lia-image-emoji" src="https://forums.autodesk.com/html/@7401B55A0A518861312A0F851CD29320/emoticons/1f44d.png" alt=":thumbs_up:" title=":thumbs_up:" /&gt;&lt;/SPAN&gt;.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 06 Jan 2021 12:14:49 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/file-time-counter/m-p/9981714#M119652</guid>
      <dc:creator>WCrihfield</dc:creator>
      <dc:date>2021-01-06T12:14:49Z</dc:date>
    </item>
  </channel>
</rss>

