Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TABLE Entity implementation #314

Open
wants to merge 14 commits into
base: master
Choose a base branch
from
Binary file added samples/table_samples/table_AC1032.dwg
Binary file not shown.
13,954 changes: 13,954 additions & 0 deletions samples/table_samples/table_AC1032.dxf

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/ACadSharp.Tests/IO/ColorTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public ColorTests(ITestOutputHelper output) : base(output)

[Theory]
[MemberData(nameof(ColorSamplesFilePaths))]
public void ColorDwg(FileModel test)
public void BasicColorTest(FileModel test)
{
bool isDxf = Path.GetExtension(test.FileName).Equals(".dxf");
CadDocument doc = this.readDocument(test);
Expand Down
31 changes: 31 additions & 0 deletions src/ACadSharp.Tests/IO/TableEntityTests.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
using Xunit;
using Xunit.Abstractions;
using ACadSharp.Tests.TestModels;
using ACadSharp.Entities;
using System.Linq;

namespace ACadSharp.Tests.IO
{
public class TableEntityTests : IOTestsBase
{
public static TheoryData<FileModel> TableSamplesFilePaths { get; } = new();

static TableEntityTests()
{
loadSamples("table_samples", "*", TableSamplesFilePaths);
}

public TableEntityTests(ITestOutputHelper output) : base(output)
{
}

[Theory]
[MemberData(nameof(TableSamplesFilePaths))]
public void TableEntityDwg(FileModel test)
{
CadDocument doc = this.readDocument(test);

TableEntity table = (TableEntity)doc.Entities.First();
}
}
}
2 changes: 1 addition & 1 deletion src/ACadSharp/DxfFileToken.cs
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ public static class DxfFileToken
public const string Entity3DFace = "3DFACE";
public const string Entity3DSolid = "3DSOLID";
public const string EntityProxyEntity = "ACAD_PROXY_ENTITY";
public const string EntityTable = "ACAD_TABLE";
public const string EntityArc = "ARC";
public const string EntityAttributeDefinition = "ATTDEF";
public const string EntityAttribute = "ATTRIB";
Expand Down Expand Up @@ -92,7 +93,6 @@ public static class DxfFileToken
public const string EntitySpline = "SPLINE";
public const string EntitySun = "SUN";
public const string EntitySurface = "SURFACE";
public const string EntityTable = "TABLE";
public const string EntityText = "TEXT";
public const string EntityTolerance = "TOLERANCE";
public const string EntityTrace = "TRACE";
Expand Down
1 change: 1 addition & 0 deletions src/ACadSharp/DxfSubclassMarker.cs
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ public static class DxfSubclassMarker
public const string PolyfaceMeshFace = "AcDbFaceRecord";
public const string Shape = "AcDbShape";
public const string Solid = "AcDbTrace";
public const string TableEntity = "AcDbTable";
public const string Trace = "AcDbTrace";
public const string Text = "AcDbText";
public const string Tolerance = "AcDbFcf";
Expand Down
16 changes: 8 additions & 8 deletions src/ACadSharp/Entities/Insert.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public override ObjectType ObjectType
public override string SubclassMarker => DxfSubclassMarker.Insert;

/// <summary>
/// Gets the insert block definition
/// Gets the insert block definition.
/// </summary>
[DxfCodeValue(DxfReferenceType.Name, 2)]
public BlockRecord Block { get; internal set; }
Expand All @@ -53,19 +53,19 @@ public override ObjectType ObjectType
public XYZ InsertPoint { get; set; } = XYZ.Zero;

/// <summary>
/// X scale factor
/// X scale factor.
/// </summary>
[DxfCodeValue(41)]
public double XScale { get; set; } = 1;

/// <summary>
/// Y scale factor
/// Y scale factor.
/// </summary>
[DxfCodeValue(42)]
public double YScale { get; set; } = 1;

/// <summary>
/// Z scale factor
/// Z scale factor.
/// </summary>
[DxfCodeValue(43)]
public double ZScale { get; set; } = 1;
Expand All @@ -88,25 +88,25 @@ public override ObjectType ObjectType
/// <summary>
/// Column count
/// </summary>
[DxfCodeValue(70)]
[DxfCodeValue(DxfReferenceType.Optional, 70)]
public ushort ColumnCount { get; set; } = 1;

/// <summary>
/// Row count
/// </summary>
[DxfCodeValue(71)]
[DxfCodeValue(DxfReferenceType.Optional, 71)]
public ushort RowCount { get; set; } = 1;

/// <summary>
/// Column spacing
/// </summary>
[DxfCodeValue(44)]
[DxfCodeValue(DxfReferenceType.Optional, 44)]
public double ColumnSpacing { get; set; } = 0;

/// <summary>
/// Row spacing
/// </summary>
[DxfCodeValue(45)]
[DxfCodeValue(DxfReferenceType.Optional, 45)]
public double RowSpacing { get; set; } = 0;

/// <summary>
Expand Down
Loading
Loading