Journal File Magic & Exporting Groups to File (part 1)

The Revit API does not provide access to the “Save As – Group” command, but maybe you have a lot of groups that you want to export. One approach to consider it modifying a journal file to automate the process. This is a somewhat brittle approach that can’t always be used when the API comes up short, but it is nice when it works.

To get started, I opened an RVT, exported a group, and exited from Revit. This creates a journal file in C:\Users\harry\AppData\Local\Autodesk\Revit\Autodesk Revit 2024\Journals

But that journal file has a ton of stuff (it is a 294KB file!) So the first step is to remove all the comments (the lines that start with a single quote ‘ character or some spaces then a ‘) and also lines that start with Jrn.Directive and some other entries that we don’t care about.

Here is a tool to cleanup that journal file and get rid of a lot of stuff that isn’t helpful for this exercise

https://bitbucket.org/BoostYourBIM/journalcleaner/src/master/JournalCleaner/bin/Release/net6.0/publish/win-x86/ – click on “view raw” to download the file

Put JournalCleaner.exe in the same folder as one or more journal files, run the command, and for each journal file it will create a “cleaned” version of the journal. In this case, we gone from a 2,500 line journal file, to one with only a couple dozen lines!


Dim Jrn
Set Jrn = CrsJournalScript
Jrn.Data _
“JournalDefaultTemplate” , “Imperial Multi-discipline=$AllUsersAppData\Templates\English-Imperial\Default-Multi-discipline.rte, Metric Multi-discipline=$AllUsersAppData\Templates\English\Default-Multi-Discipline_Metric.rte”
Jrn.Data _
“JournalDefaultViewDiscipline” , “Coordination”
Jrn.Command “Internal” , “Display Profile Dialog , ID_DISPLAY_PROFILE_DIALOG”
Jrn.Command “Internal” , ” , ID_REVIT_MODEL_BROWSER_OPEN”
Jrn.Command “Ribbon” , “Model Browser , ID_REVIT_MODEL_BROWSER”
Jrn.Command “Ribbon” , “Open an existing project , ID_REVIT_FILE_OPEN”
Jrn.Data _
“File Name” , “IDOK” , “..\..\..\..\..\..\Documents\groups.rvt”
Jrn.Data _
“WorksetConfig” , “Custom” , 0
Jrn.LButtonUp 0 , 453 , 206
Jrn.Data _
“DroppedMouseAction” , “no active editor”
Jrn.Command “Ribbon” , “Save a loaded group , ID_SAVE_GROUP”
Jrn.Data _
“Save Group File Name” , “..\..\..\..\..\..\Documents\Same as group name.rvt”
Jrn.Data _
“Save Group Index” , “0”
Jrn.Data _
“Save Group Include Attached” , “1”
Jrn.Data _
“Transaction Successful” , “Create Type Previews”
Jrn.Data _
“Transaction Successful” , “Save a loaded group”
Jrn.Data _
“Transaction Successful” , “Save a loaded group”
Jrn.Command “Internal” , “Quit the application; prompts to save projects , ID_APP_EXIT”
Jrn.Command “Internal” , ” , ID_REVIT_MODEL_BROWSER_OPEN”

In the next post, we will talk about a bit more manual cleanup to this journal file, and then how to read data from external file and more magic.

3 thoughts on “Journal File Magic & Exporting Groups to File (part 1)

  1. Excellent, I look forward for the second part. I saw some Autodesk University videos talking about Journal automation, but the resources were missing and I could never learn this :/
    Many thanks for your posts, I have learnt so much Revit API with them.

Leave a comment