Skip to content

Commit

Permalink
Merge pull request #193 from DomCR/DxfReader-version-check
Browse files Browse the repository at this point in the history
Dxf reader version check
  • Loading branch information
DomCR authored Nov 10, 2023
2 parents 284765e + 28a7152 commit 11b1268
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 9 deletions.
8 changes: 0 additions & 8 deletions ACadSharp/Exceptions/DwgNotSupportedException.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,4 @@ public DwgNotSupportedException() : base($"Dwg version not recognised") { }

public DwgNotSupportedException(ACadVersion version) : base($"Dwg version not supported: {version}") { }
}

[Serializable]
public class DxfNotSupportedException : NotSupportedException
{
public DxfNotSupportedException() : base($"Dxf version not recognised") { }

public DxfNotSupportedException(ACadVersion version) : base($"Dxf version not supported: {version}") { }
}
}
12 changes: 12 additions & 0 deletions ACadSharp/Exceptions/DxfNotSupportedException.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
using System;

namespace ACadSharp.Exceptions
{
[Serializable]
public class DxfNotSupportedException : NotSupportedException
{
public DxfNotSupportedException() : base($"Dxf version not recognised") { }

public DxfNotSupportedException(ACadVersion version) : base($"Dxf version not supported: {version}") { }
}
}
5 changes: 4 additions & 1 deletion ACadSharp/IO/DXF/DxfStreamReader/DxfSectionReaderBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -716,6 +716,9 @@ private bool readViewport(CadEntityTemplate template, DxfMap map, string subclas
case 69:
tmp.ViewportId = this._reader.ValueAsShort;
return true;
case 331:
tmp.FrozenLayerHandles.Add(this._reader.ValueAsHandle);
return true;
case 348:
tmp.VisualStyleHandle = this._reader.ValueAsHandle;
return true;
Expand Down Expand Up @@ -999,7 +1002,7 @@ private CadHatchTemplate.CadBoundaryPathTemplate readLoop()
if (template.Path.Flags.HasFlag(BoundaryPathFlags.Polyline))
{
Hatch.BoundaryPath.Edge pl = new Hatch.BoundaryPath.Polyline();
this._builder.Notify($"Hatch.BoundaryPath.Polyline not implemented", NotificationType.Error);
this._builder.Notify($"Hatch.BoundaryPath.Polyline not implemented", NotificationType.NotImplemented);

return null;
}
Expand Down

0 comments on commit 11b1268

Please sign in to comment.