Skip to content

Commit

Permalink
bild fix
Browse files Browse the repository at this point in the history
  • Loading branch information
DomCR committed Jan 2, 2025
1 parent 8095570 commit 1b7b9bd
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/ACadSharp/IO/Templates/EvaluationGraphTemplate.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,24 +5,27 @@ namespace ACadSharp.IO.Templates
{
internal class EvaluationGraphTemplate : CadTemplate<EvaluationGraph>
{
public IDictionary<EvaluationGraph.GraphNode, ulong> NodeHandles { get; } = new Dictionary<EvaluationGraph.GraphNode, ulong>();

public EvaluationGraphTemplate(EvaluationGraph evaluationGraph)
: base(evaluationGraph)
{
}

public IDictionary<EvaluationGraph.GraphNode, ulong> NodeHandles { get; } = new Dictionary<EvaluationGraph.GraphNode, ulong>();

public override void Build(CadDocumentBuilder builder)
{
base.Build(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);
}
}
}
Expand Down

0 comments on commit 1b7b9bd

Please sign in to comment.