Skip to content

Commit 3364540

Browse files
authored
Merge pull request #583 from DomCR/issue-580_dxfclasses-dwgwriter-fix
Dwg DxfClasses writer fix
2 parents d4e1bf1 + ab29f3c commit 3364540

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

Diff for: src/ACadSharp/IO/DWG/DwgStreamReaders/DwgClassesReader.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ public DxfClassCollection Read()
108108
this.notify($"Invalid DxfClass id value: {dxfClass.ItemClassId} for {dxfClass.CppClassName}", NotificationType.Error);
109109
}
110110

111-
if (this._fileHeader.AcadVersion >= ACadVersion.AC1018)
111+
if (this.R2004Plus)
112112
{
113113
//BL : Number of objects created of this type in the current DB(DXF 91).
114114
dxfClass.InstanceCount = this._sreader.ReadBitLong();

Diff for: src/ACadSharp/IO/DWG/DwgStreamWriters/DwgClassesWriter.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -84,9 +84,9 @@ public void Write()
8484
//BL : Number of objects created of this type in the current DB(DXF 91).
8585
this._writer.WriteBitLong(c.InstanceCount);
8686
//BS : Dwg Version
87-
this._writer.WriteBitShort((short)this._document.Header.Version);
87+
this._writer.WriteBitLong((short)this._document.Header.Version);
8888
//BS : Maintenance release version.
89-
this._writer.WriteBitShort(this._document.Header.MaintenanceVersion);
89+
this._writer.WriteBitLong(this._document.Header.MaintenanceVersion);
9090
//BL : Unknown(normally 0L)
9191
this._writer.WriteBitLong(0);
9292
//BL : Unknown(normally 0L)

0 commit comments

Comments
 (0)