Skip to content

Commit cda9ddf

Browse files
committed
Merge branch 'master' of https://github.com/DomCR/ACadSharp
2 parents f89fc61 + e66ab64 commit cda9ddf

File tree

5 files changed

+15
-10
lines changed

5 files changed

+15
-10
lines changed

.github/workflows/build_n_test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,4 @@ jobs:
2424
run: |
2525
dotnet restore
2626
dotnet build --configuration Release --no-restore
27-
dotnet test --configuration Release --no-build --verbosity normal
27+
dotnet test --configuration Release --no-build --verbosity normal

src/ACadSharp.Tests/ACadSharp.Tests.csproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@
1212
</PropertyGroup>
1313

1414
<ItemGroup>
15-
<PackageReference Include="coverlet.msbuild" Version="6.0.2">
15+
<PackageReference Include="coverlet.msbuild" Version="6.0.4">
1616
<PrivateAssets>all</PrivateAssets>
1717
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
1818
</PackageReference>
19-
<PackageReference Include="coverlet.collector" Version="6.0.2">
19+
<PackageReference Include="coverlet.collector" Version="6.0.4">
2020
<PrivateAssets>all</PrivateAssets>
2121
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
2222
</PackageReference>
@@ -25,7 +25,7 @@
2525
<PackageReference Include="MSTest.TestFramework" Version="3.*" />
2626
<PackageReference Include="xunit" Version="2.*" />
2727
<PackageReference Include="xunit.extensibility.core" Version="2.*" />
28-
<PackageReference Include="xunit.runner.visualstudio" Version="2.*">
28+
<PackageReference Include="xunit.runner.visualstudio" Version="3.0.1">
2929
<PrivateAssets>all</PrivateAssets>
3030
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
3131
</PackageReference>

src/ACadSharp/IO/DXF/DxfDocumentBuilder.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,6 @@ public DxfDocumentBuilder(ACadVersion version, CadDocument document, DxfReaderCo
2626

2727
public override void BuildDocument()
2828
{
29-
this.buildDictionaries();
30-
3129
if (this.ModelSpaceTemplate == null)
3230
{
3331
BlockRecord record = BlockRecord.ModelSpace;
@@ -37,11 +35,13 @@ public override void BuildDocument()
3735
}
3836

3937
this.ModelSpaceTemplate.OwnedObjectsHandlers.AddRange(this.ModelSpaceEntities);
40-
38+
4139
this.RegisterTables();
4240

4341
this.BuildTables();
4442

43+
this.buildDictionaries();
44+
4545
//Assign the owners for the different objects
4646
foreach (CadTemplate template in this.cadObjectsTemplates.Values)
4747
{

src/ACadSharp/IO/DXF/DxfStreamReader/DxfBlockSectionReader.cs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ private void readBlock()
5959

6060
string name = null;
6161
BlockRecord record = null;
62+
CadBlockRecordTemplate recordTemplate = null;
6263

6364
while (this._reader.DxfCode != DxfCode.Start)
6465
{
@@ -112,7 +113,7 @@ private void readBlock()
112113
{
113114
record = new BlockRecord(name);
114115
record.BlockEntity = blckEntity;
115-
CadBlockRecordTemplate recordTemplate = new CadBlockRecordTemplate(record);
116+
recordTemplate = new CadBlockRecordTemplate(record);
116117

117118
this._builder.BlockRecords.Add(record);
118119

@@ -121,6 +122,10 @@ private void readBlock()
121122
this._builder.ModelSpaceTemplate = recordTemplate;
122123
}
123124
}
125+
else
126+
{
127+
recordTemplate = new CadBlockRecordTemplate(record);
128+
}
124129

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

147152
//Add the object and the template to the builder
148153
this._builder.AddTemplate(entityTemplate);
149-
record.Entities.Add(entityTemplate.CadObject);
154+
recordTemplate.OwnedObjectsHandlers.Add(entityTemplate.CadObject.Handle);
150155
}
151156

152157
this.readBlockEnd(record.BlockEnd);

src/ACadSharp/IO/DXF/DxfStreamReader/DxfTablesSectionReader.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public override void Read()
3434
if (this._reader.ValueAsString == DxfFileToken.TableEntry)
3535
this.readTable();
3636
else
37-
throw new DxfException($"Unexpected token at the begining of a table: {this._reader.ValueAsString}", this._reader.Position);
37+
throw new DxfException($"Unexpected token at the beginning of a table: {this._reader.ValueAsString}", this._reader.Position);
3838

3939

4040
if (this._reader.ValueAsString == DxfFileToken.EndTable)

0 commit comments

Comments
 (0)