One useful thing you can do is insert code to create timers. Creating timers in a journal file allows us to test how long Revit takes to perform certain operations. So, we can create a journal file with specific tasks and operations that we plan to time. When creating a journal file to use for whatever purposes you need to be very specific about the tasks you do. In order to make it easier to read/edit the journal, excessive view manipulation, and "errors" should be avoided. Rather the specific tasks should carried out with the least possible mouse movement (shortcuts help). Once you've written your journal file, it is much easier to edit it if it has been cleaned (see the end of this post). When "writing" a journal file it is important that you always have the original file available that you start with, otherwise the journal will not run correctly. Another note, it is possible to save when creating a journal file, however when running the journal it must be able to exactly replicate the saving conditions. Writing journals with Workshared files also creates some difficulties, your best bet is to work with a detached copy, and not save.
With the clean journal file to create timers some basic code needs to be inserted at the beginning, after the line that contains "username":
Set fso = CreateObject("Scripting.FileSystemObject") 'create external file object
Set outf = fso.OpenTextFile("c:\My Temp\Journal Results\TimeResults.txt", 2, True) 'insert path for results file
Dim sTime,eTime,comment 'initialize variables
The first line starts the process, the second line "Set out f..." establishes where the results from the timers will be saved, and the last line "Dim..." sets the variables for the timers. After that, it is only a matter of actually creating the timers themselves.
Each timer is broke into a start and end. The end code looks like this (remember any line that starts with ( ' ) is a comment):
'stop timer code eTime = DateDiff("s", sTime, Time) 'put this at end of sequence to be timed. outf.WriteLine eTime & " Seconds of Elapsed Time for:" & comment 'end of code
I usually start with the end code, as you may recall it is easier to find "transaction complete" then the start. Once I have my end code in, I look for the start of the operation I want to time, and then I add the start code that looks like this:
'start timer code sTime = Time 'put this at start of sequence to be timed. comment = "Test Sequence Blah Blah" 'comment to specify what we are timing. 'stuff to time here
With the start code, its important to note that you need to add a comment to describe or name the timer where it says: comment = "Test Sequence Blah Blah"

Once you're code is inserted, you should be all set to run the journal. To run the journal, you will want to drag and drop the Journal file onto the Revit.exe icon located under ..\Program Files\Revit flavor\Program

If you're interested, pop over to this AUGI thread. You'll find our benchmarker utility, and a couple of journal and revit files available for testing your machine(s). We've also tested using project files, however simply due to size, I can't release those. You'll also find a utility for cleaning the journal files, to make them easier to read.
1 comment:
this is useful :)
Post a Comment