Skip to content

Commit

Permalink
order in writer matters
Browse files Browse the repository at this point in the history
  • Loading branch information
DomCR committed Oct 18, 2023
1 parent 79cddbf commit 5ebba3e
Showing 1 changed file with 6 additions and 10 deletions.
16 changes: 6 additions & 10 deletions ACadSharp/IO/DWG/DwgStreamWriters/DwgObjectWriter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,22 +54,18 @@ public void Write()
this._writer.WriteRawLong(0xDCA);
}

this._objects.Enqueue(this._document.RootDictionary);

this.writeTable(this._document.AppIds);
this.writeBlockControl();
this.writeTable(this._document.Layers);
this.writeTable(this._document.LineTypes);
this.writeTable(this._document.TextStyles);
this.writeTable(this._document.UCSs);
this.writeTable(this._document.LineTypes);
this.writeTable(this._document.Views);
this.writeTable(this._document.UCSs);
this.writeTable(this._document.VPorts);
this.writeBlockControl();
this.writeTable(this._document.AppIds);
//For some reason the dimension must be writen the last
this.writeTable(this._document.DimensionStyles);

this.writeBlocks();

this.writeObjects();
this.writeBlockEntities();
}

private void writeBlockControl()
Expand Down Expand Up @@ -162,7 +158,7 @@ private void writeEntries<T>(Table<T> table)
}
}

private void writeBlocks()
private void writeBlockEntities()
{
foreach (BlockRecord blkRecord in this._document.BlockRecords)
{
Expand Down

0 comments on commit 5ebba3e

Please sign in to comment.