Revit has had journal files from the very beginning. The main use was to assist in test coverage by allowing the Quality Analyst to record common use cases for later play back against future builds protecting functionality. Journals were a testing force multiplier.
As journals used VBscript we've successfully modified them to read from text files to automate sheet creation, model geometry, and upgrade families.
In this post I'm going to share an idea to use a journal to visualize command usage and sequence - something of great interest to a software designer as it could uncover patterns of usage and common workflows. I'll mention that Autodesk does collect command frequency usage via our CIP program but this can only tell you how often a command is used. More meaningful usage data remains ellusive but not in journals.
Process a Journal File
To get the data I need I just want a list of all commands in the order they occur and nothing else. A journal file contains this but its lost in the noise. Here is a line that contains a command:
Jrn.Command "Internal" , "Create a default 3D orthographic view. , ID_VIEW_DEFAULT_3DVIEW"
What I want is the last command ID or description - in this case the creation of a default 3D view.
To condense a journal file a there is a great text processing tool in Perl. I downloaded the free version of Activeperl and here is a good perl reference.
I created "process_journal.pl" which contains the following code:
open(OUT,">JournalProcessed.txt") or die "Can't open $filename to write";
open(INPUT, "journal.txt") or die "Can't open journal.txt";
while (<INPUT>)
{
$this_line = $_;
if (/Jrn.Command\s*".+?"\s*,\s*"(.+?)\s*,\s*(\w+)"/) {
# $1 is command description, $2 is ID
print OUT $2 . " " ;
}
}
close INPUT;
In pseudo code:
- open journal.txt
- read a line
- look for the lines that have "Jrn.Command" and extract the description and command ID storing these in two variables $1 and $2
- Print out the variable $2(Command ID) to a new file JournalProcessed.txt and add a trailing space
- loop through journal.txt
The output of JounralProcessed.txt looks like this:
ID_STARTUP_PAGE ID_FILE_NEW_WITH_TEMPLATE1 ID_FAMILY_NEW ID_REVIT_FILE_CLOSE...
It's a long string of command IDs separated by spaces.
Visualization
With a little searching I found someone has done the heavy lifting for me on the IBM Manyeyes website. On this site you can upload tables and choose many pre-baked visualizations. In my case I didn't even need a table! Their "Phrase net" visualization only requires only a block of text. The Phrasenet renders words with the font size relative to the word frequency and connects these using directional arrows that are also weighted by the relative number of connections. A lot of data is encoded using this simple method.
Real World Test
So now I have a tool that can process a journal and another that can help me look at it. The next question is "What to look at?" Every journal file is different depending on the task at hand. I could look at journal files from different disciplines or compare files from different phases in a project (creation vs. editing)
For this post I'll process a journal donated by co-conspirator Zach over at Buildz. He gave me the journal file used to make TROGDOR the Burninator. Here is trogdor in all his incendiary glory:

Here is a snippet of the processed journal:
ID_REVIT_FILE_NEW ID_FAMILY_NEW ID_OBJECT_3D_CURVE ID_ZOOM_IN ID_BUTTON_SELECT ID_OBJECT_POINT ID_OBJECTS_CURVE_CIRCLE ID_SKETCH_PLANE_TOOL ID_BUTTON_SELECT ID_EDIT_SCALE ID_BUTTON_DELETE ID_EDIT_SCALE ID_EDIT_SCALE ID_BUTTON_SELECT ID_SKETCH_PLANE_TOOL ID_BUTTON_SELECT ID_SKETCH_PLANE_TOOL ID_BUTTON_SELECT ID_ZOOM_IN ID_OBJECTS_CURVE_LINE ID_BUTTON_SELECT ID_OBJECT_POINT ID_BUTTON_SELECT ID_SKETCH_PLANE_TOOL ID_OBJECTS_CURVE_CIRCLE ID_BUTTON_SELECT ID_EDIT_UNDO ID_EDIT_UNDO ID_EDIT_UNDO ID_EDIT_UNDO ID_IMAGE_WIREFRAME ID_BUTTON_SELECT ID_BUTTON_DELETE ID_BUTTON_DELETE ID_BUTTON_DELETE...
and visualized in ManyEyes:

We can see heavy use of Select, ESC, Points, Sketch Plane, and Zoom. Points are by far selected the most and the sketch plan tool has a high affinity with drawing lines (id_objects_curve_(circle))
The visualization allows me to select nodes and move them around. Here is a different arrangement:

And a link to the live visualization so you can play yourself:


Happy visualizing!
_erik
Recent Comments