Skip to content

Commit

Permalink
assign seqend before adding an item
Browse files Browse the repository at this point in the history
  • Loading branch information
DomCR committed Sep 15, 2023
1 parent af84ddd commit bee777e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
10 changes: 5 additions & 5 deletions ACadSharp/IO/Templates/CadInsertTemplate.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,11 @@ public override void Build(CadDocumentBuilder builder)
insert.Block = block;
}

if (builder.TryGetCadObject<Seqend>(this.SeqendHandle, out Seqend seqend))
{
insert.Attributes.Seqend = seqend;
}

if (this.FirstAttributeHandle.HasValue)
{
var attributes = getEntitiesCollection<AttributeEntity>(builder, FirstAttributeHandle.Value, EndAttributeHandle.Value);
Expand All @@ -59,11 +64,6 @@ public override void Build(CadDocumentBuilder builder)
}
}
}

if (builder.TryGetCadObject<Seqend>(this.SeqendHandle, out Seqend seqend))
{
insert.Attributes.Seqend = seqend;
}
}
}
}
10 changes: 5 additions & 5 deletions ACadSharp/IO/Templates/CadPolyfaceMeshTemplate.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,11 @@ public override void Build(CadDocumentBuilder builder)

PolyfaceMesh polyfaceMesh = (PolyfaceMesh)this.CadObject;

if (builder.TryGetCadObject<Seqend>(this.SeqendHandle, out Seqend seqend))
{
polyfaceMesh.Vertices.Seqend = seqend;
}

if (this.FirstVerticeHandle.HasValue)
{
IEnumerable<Entity> vertices = this.getEntitiesCollection<Entity>(builder, this.FirstVerticeHandle.Value, this.LastVerticeHandle.Value);
Expand All @@ -39,11 +44,6 @@ public override void Build(CadDocumentBuilder builder)
}
}
}

if (builder.TryGetCadObject<Seqend>(this.SeqendHandle, out Seqend seqend))
{
polyfaceMesh.Vertices.Seqend = seqend;
}
}

private void addItemToPolyface(CadObject item, CadDocumentBuilder builder)
Expand Down

0 comments on commit bee777e

Please sign in to comment.