Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
DomCR committed Jan 24, 2025
2 parents f89fc61 + e66ab64 commit cda9ddf
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build_n_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@ jobs:
run: |
dotnet restore
dotnet build --configuration Release --no-restore
dotnet test --configuration Release --no-build --verbosity normal
dotnet test --configuration Release --no-build --verbosity normal
6 changes: 3 additions & 3 deletions src/ACadSharp.Tests/ACadSharp.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="coverlet.msbuild" Version="6.0.2">
<PackageReference Include="coverlet.msbuild" Version="6.0.4">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="coverlet.collector" Version="6.0.2">
<PackageReference Include="coverlet.collector" Version="6.0.4">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
Expand All @@ -25,7 +25,7 @@
<PackageReference Include="MSTest.TestFramework" Version="3.*" />
<PackageReference Include="xunit" Version="2.*" />
<PackageReference Include="xunit.extensibility.core" Version="2.*" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.*">
<PackageReference Include="xunit.runner.visualstudio" Version="3.0.1">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
Expand Down
6 changes: 3 additions & 3 deletions src/ACadSharp/IO/DXF/DxfDocumentBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@ public DxfDocumentBuilder(ACadVersion version, CadDocument document, DxfReaderCo

public override void BuildDocument()
{
this.buildDictionaries();

if (this.ModelSpaceTemplate == null)
{
BlockRecord record = BlockRecord.ModelSpace;
Expand All @@ -37,11 +35,13 @@ public override void BuildDocument()
}

this.ModelSpaceTemplate.OwnedObjectsHandlers.AddRange(this.ModelSpaceEntities);

this.RegisterTables();

this.BuildTables();

this.buildDictionaries();

//Assign the owners for the different objects
foreach (CadTemplate template in this.cadObjectsTemplates.Values)
{
Expand Down
9 changes: 7 additions & 2 deletions src/ACadSharp/IO/DXF/DxfStreamReader/DxfBlockSectionReader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ private void readBlock()

string name = null;
BlockRecord record = null;
CadBlockRecordTemplate recordTemplate = null;

while (this._reader.DxfCode != DxfCode.Start)
{
Expand Down Expand Up @@ -112,7 +113,7 @@ private void readBlock()
{
record = new BlockRecord(name);
record.BlockEntity = blckEntity;
CadBlockRecordTemplate recordTemplate = new CadBlockRecordTemplate(record);
recordTemplate = new CadBlockRecordTemplate(record);

this._builder.BlockRecords.Add(record);

Expand All @@ -121,6 +122,10 @@ private void readBlock()
this._builder.ModelSpaceTemplate = recordTemplate;
}
}
else
{
recordTemplate = new CadBlockRecordTemplate(record);
}

while (this._reader.ValueAsString != DxfFileToken.EndBlock)
{
Expand All @@ -146,7 +151,7 @@ private void readBlock()

//Add the object and the template to the builder
this._builder.AddTemplate(entityTemplate);
record.Entities.Add(entityTemplate.CadObject);
recordTemplate.OwnedObjectsHandlers.Add(entityTemplate.CadObject.Handle);
}

this.readBlockEnd(record.BlockEnd);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public override void Read()
if (this._reader.ValueAsString == DxfFileToken.TableEntry)
this.readTable();
else
throw new DxfException($"Unexpected token at the begining of a table: {this._reader.ValueAsString}", this._reader.Position);
throw new DxfException($"Unexpected token at the beginning of a table: {this._reader.ValueAsString}", this._reader.Position);


if (this._reader.ValueAsString == DxfFileToken.EndTable)
Expand Down

0 comments on commit cda9ddf

Please sign in to comment.