Speed increases when moving mouse over inventor window
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I was looping over all ControlDefinition when i noticed something strange. If i move over the inventor window then my program becomes much faster. I did notice this before (on a addon that i maintain) but was never able to prove it. But now i could with the code below. (Its a class of a program that i use to write/test ilogic rules. For people who want to try it the complete program it can be found on github. )
Public Class ThisRule
Sub Main()
Dim doc As PartDocument = ThisDoc.Document
Dim sw As Stopwatch = New Stopwatch()
Dim list As List(Of Integer) = New List(Of Integer)()
Dim i = 0
For Each def As ControlDefinition In ThisApplication.CommandManager.ControlDefinitions
i = i + 1
list.Add(sw.ElapsedMilliseconds)
If i = 25 Then
Dim ave = list.Average()
Console.SetCursorPosition(1, 1)
Console.WriteLine(ave)
list.Clear()
i = 0
End If
sw.Restart()
Next
End Sub
end Class
i found for 25 iterations my computer needs on avarage:
- 180 to 190 miliseconds when my mouse is not moving or not on the Inventor window.
- 10 to 15 miliseconds when my mouse is moving over the inventor window.
That is a huge difference.
Did someone else notice this behaviour?
Is this a bug?
Can we exploit this to speed up long runing tasks. (like configurators)?
Jelte de Jong
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.
Blog: hjalte.nl - github.com