Hi, I want to run dynamo description with this code.
string path = @".dyn path";
IDictionary<string, string> journalData = new Dictionary<string, string>
{
{ Dynamo.Applications.JournalKeys.ShowUiKey, false.ToString() }, // don't show DynamoUI at runtime
{ Dynamo.Applications.JournalKeys.AutomationModeKey, true.ToString() }, //run journal automatically
{ Dynamo.Applications.JournalKeys.DynPathKey, "" }, //run node at this file path
{ Dynamo.Applications.JournalKeys.DynPathExecuteKey, true.ToString() }, // The journal file can specify if the Dynamo workspace opened from DynPathKey will be executed or not. If we are in automation mode the workspace will be executed regardless of this key.
{ Dynamo.Applications.JournalKeys.ForceManualRunKey, false.ToString() }, // don't run in manual mode
{ Dynamo.Applications.JournalKeys.ModelShutDownKey, true.ToString() },
{ Dynamo.Applications.JournalKeys.ModelNodesInfo, false.ToString() }
};
DynamoRevitCommandData dynamoRevitCommandData = new DynamoRevitCommandData();
dynamoRevitCommandData.Application = uiApp;
dynamoRevitCommandData.JournalData = journalData;
DynamoRevit dynamoRevit = new DynamoRevit();
Result externalCommandResult = dynamoRevit.ExecuteCommand(dynamoRevitCommandData);
DynamoRevit.RevitDynamoModel.OpenFileFromPath(path, true);
List<NodeModel> nodeModels = DynamoRevit.RevitDynamoModel.CurrentWorkspace.Nodes.ToList();
List<NodeModel> isInputNodes = new List<NodeModel>();
List<NodeModel> isOutputNodes = new List<NodeModel>();
foreach (NodeModel node in nodeModels)
{
if (node.IsSetAsInput) isInputNodes.Add(node);
if (node.IsSetAsOutput) isOutputNodes.Add(node);
}
After running Dynamo once, the code works without any problems.
However, if I run the next code without running Dynamo, I get this error.
(In Herer : dynamoRevit.ExecuteCommand(dynamoRevitCommandData)
I think I should load assemblies about Dynamo before run that code.
How can I do?