ExternalCommandData.JournalData Property

ExternalCommandDataJournalData Property

A data map that can be used to read and write data to the Autodesk Revit journal file.

Namespace: Autodesk.Revit.UI
Assembly: RevitAPIUI (in RevitAPIUI.dll) Version: 25.0.0.0 (25.0.0.0)
Syntax
public IDictionary<string, string> JournalData { get; set; }
Public Property JournalData As IDictionary(Of String, String)
	Get
	Set
public:
property IDictionary<String^, String^>^ JournalData {
	IDictionary<String^, String^>^ get ();
	void set (IDictionary<String^, String^>^ value);
}
member JournalData : IDictionary<string, string> with get, set

Property Value

IDictionaryString, String
Remarks
The data map is a string to string map that can be used to store data in the Revit journal file at the end of execution of the external command. If the command is then executed from the journal file during playback this data is then passed to the external command in this Data property so the external command can execute with this passed data in a UI-less mode, hence providing non interactive journal playback for automated testing purposes. For more information on Revit's journaling features contact the Autodesk Developer Network.
Example
void WriteJournalData(ExternalCommandData commandData)
{
    // Get the StringStringMap class which can write data into.
    IDictionary<String, String> dataMap = commandData.JournalData;
    dataMap.Clear();

    // Begin to add the support data
    dataMap.Add("Name", "Autodesk.Revit");
    dataMap.Add("Information", "This is an example.");
    dataMap.Add("Greeting", "Hello Everyone.");
}

/// <summary>
/// This sample shows how to get data from journal file. 
/// </summary>
void ReadJournalData(ExternalCommandData commandData)
{
    // Get the StringStringMap class which can write data into.
    IDictionary<String, String> dataMap = commandData.JournalData;

    // Begin to get the support data.
    String prompt = "Name: " + dataMap["Name"];
    prompt += "\nInformation: " + dataMap["Information"];
    prompt += "\nGreeting: " + dataMap["Greeting"];

    TaskDialog.Show("Revit",prompt);
}
Private Sub WriteJournalData(commandData As ExternalCommandData)
    ' Get the StringStringMap class which can write data into.
    Dim dataMap As IDictionary(Of [String], [String]) = commandData.JournalData
    dataMap.Clear()

    ' Begin to add the support data
    dataMap.Add("Name", "Autodesk.Revit")
    dataMap.Add("Information", "This is an example.")
    dataMap.Add("Greeting", "Hello Everyone.")
End Sub

' <summary>
' This sample shows how to get data from journal file. 
' </summary>
Private Sub ReadJournalData(commandData As ExternalCommandData)
    ' Get the StringStringMap class which can write data into.
    Dim dataMap As IDictionary(Of [String], [String]) = commandData.JournalData

    ' Begin to get the support data.
    Dim prompt As [String] = "Name: " & dataMap("Name")
    prompt += vbLf & "Information: " & dataMap("Information")
    prompt += vbLf & "Greeting: " & dataMap("Greeting")

    TaskDialog.Show("Revit", prompt)
End Sub

No code example is currently available or this language may not be supported.

No code example is currently available or this language may not be supported.

See Also