diff --git a/src/ACadSharp/IO/Templates/EvaluationGraphTemplate.cs b/src/ACadSharp/IO/Templates/EvaluationGraphTemplate.cs index 9dcb57c1..210ec3da 100644 --- a/src/ACadSharp/IO/Templates/EvaluationGraphTemplate.cs +++ b/src/ACadSharp/IO/Templates/EvaluationGraphTemplate.cs @@ -5,14 +5,13 @@ namespace ACadSharp.IO.Templates { internal class EvaluationGraphTemplate : CadTemplate { + public IDictionary NodeHandles { get; } = new Dictionary(); public EvaluationGraphTemplate(EvaluationGraph evaluationGraph) : base(evaluationGraph) { } - public IDictionary NodeHandles { get; } = new Dictionary(); - public override void Build(CadDocumentBuilder builder) { base.Build(builder); @@ -20,9 +19,13 @@ public override void Build(CadDocumentBuilder builder) foreach (EvaluationGraph.GraphNode node in this.CadObject.Nodes) { var nodeHandle = this.NodeHandles[node]; - if (builder.TryGetCadObject(nodeHandle, out CadObject nodeObject)) + if (builder.TryGetCadObject(nodeHandle, out EvaluationExpression evExpression)) + { + node.NodeObject = evExpression; + } + else { - node.NodeObject = nodeObject; + builder.Notify($"Evaluation graph with handle {this.CadObject.Handle} couldn't find the EvaluationExpression with handle {nodeHandle}", NotificationType.Warning); } } }