• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

DomCR / ACadSharp / 13725521959

07 Mar 2025 05:01PM UTC coverage: 76.08% (-0.03%) from 76.11%
13725521959

push

github

DomCR
init

5468 of 7887 branches covered (69.33%)

Branch coverage included in aggregate %.

15 of 34 new or added lines in 6 files covered. (44.12%)

15 existing lines in 5 files now uncovered.

21557 of 27635 relevant lines covered (78.01%)

75800.0 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

93.08
/src/ACadSharp/IO/DXF/DxfStreamReader/DxfObjectsSectionReader.cs
1
using ACadSharp.IO.Templates;
2
using ACadSharp.Objects;
3
using ACadSharp.Objects.Evaluations;
4
using System;
5
using System.Diagnostics;
6
using System.Linq;
7
using static ACadSharp.IO.Templates.CadEvaluationGraphTemplate;
8

9
namespace ACadSharp.IO.DXF
10
{
11
        internal class DxfObjectsSectionReader : DxfSectionReaderBase
12
        {
13
                public delegate bool ReadObjectDelegate<T>(CadTemplate template, DxfMap map) where T : CadObject;
14

15
                public DxfObjectsSectionReader(IDxfStreamReader reader, DxfDocumentBuilder builder)
16
                        : base(reader, builder)
206✔
17
                {
206✔
18
                }
206✔
19

20
                public override void Read()
21
                {
206✔
22
                        //Advance to the first value in the section
23
                        this._reader.ReadNext();
206✔
24

25
                        //Loop until the section ends
26
                        while (this._reader.ValueAsString != DxfFileToken.EndSection)
58,841✔
27
                        {
58,635✔
28
                                CadTemplate template = null;
58,635✔
29

30
                                try
31
                                {
58,635✔
32
                                        template = this.readObject();
58,635✔
33
                                }
58,251✔
34
                                catch (Exception ex)
384✔
35
                                {
384✔
36
                                        if (!this._builder.Configuration.Failsafe)
384!
37
                                                throw;
×
38

39
                                        this._builder.Notify($"Error while reading an object at line {this._reader.Position}", NotificationType.Error, ex);
384✔
40

41
                                        while (this._reader.DxfCode != DxfCode.Start)
6,144✔
42
                                                this._reader.ReadNext();
5,760✔
43
                                }
384✔
44

45
                                if (template == null)
58,635✔
46
                                        continue;
752✔
47

48
                                //Add the object and the template to the builder
49
                                this._builder.AddTemplate(template);
57,883✔
50
                        }
57,883✔
51
                }
206✔
52

53
                private CadTemplate readObject()
54
                {
58,635✔
55
                        switch (this._reader.ValueAsString)
58,635!
56
                        {
57
                                case DxfFileToken.ObjectDBColor:
58
                                        return this.readObjectCodes<BookColor>(new CadNonGraphicalObjectTemplate(new BookColor()), this.readBookColor);
192✔
59
                                case DxfFileToken.ObjectDictionary:
60
                                        return this.readObjectCodes<CadDictionary>(new CadDictionaryTemplate(), this.readDictionary);
19,268✔
61
                                case DxfFileToken.ObjectDictionaryWithDefault:
62
                                        return this.readObjectCodes<CadDictionaryWithDefault>(new CadDictionaryWithDefaultTemplate(), this.readDictionaryWithDefault);
194✔
63
                                case DxfFileToken.ObjectLayout:
64
                                        return this.readObjectCodes<Layout>(new CadLayoutTemplate(), this.readLayout);
798✔
65
                                case DxfFileToken.ObjectEvalGraph:
66
                                        return this.readObjectCodes<EvaluationGraph>(new CadEvaluationGraphTemplate(), this.readEvaluationGraph);
192✔
67
                                case DxfFileToken.ObjectDictionaryVar:
68
                                        return this.readObjectCodes<DictionaryVariable>(new CadTemplate<DictionaryVariable>(new DictionaryVariable()), this.readObjectSubclassMap);
2,757✔
69
                                case DxfFileToken.ObjectPdfDefinition:
70
                                        return this.readObjectCodes<PdfUnderlayDefinition>(new CadNonGraphicalObjectTemplate(new PdfUnderlayDefinition()), this.readObjectSubclassMap);
×
71
                                case DxfFileToken.ObjectSortEntsTable:
72
                                        return this.readSortentsTable();
576✔
73
                                case DxfFileToken.TableGroup:
74
                                        return this.readObjectCodes<Group>(new CadGroupTemplate(), this.readGroup);
384✔
75
                                case DxfFileToken.ObjectGeoData:
76
                                        return this.readObjectCodes<GeoData>(new CadGeoDataTemplate(), this.readGeoData);
2✔
77
                                case DxfFileToken.ObjectScale:
78
                                        return this.readObjectCodes<Scale>(new CadTemplate<Scale>(new Scale()), this.readScale);
6,606✔
79
                                case DxfFileToken.ObjectTableContent:
80
                                        return this.readObjectCodes<TableContent>(new CadTableContentTemplate(), this.readTableContent);
384✔
81
                                case DxfFileToken.ObjectVisualStyle:
82
                                        return this.readObjectCodes<VisualStyle>(new CadTemplate<VisualStyle>(new VisualStyle()), this.readVisualStyle);
4,656✔
83
                                case DxfFileToken.ObjectXRecord:
84
                                        return this.readObjectCodes<XRecord>(new CadXRecordTemplate(), this.readXRecord);
15,154✔
85
                                default:
86
                                        DxfMap map = DxfMap.Create<CadObject>();
7,472✔
87
                                        CadUnknownNonGraphicalObjectTemplate unknownEntityTemplate = null;
7,472✔
88
                                        if (this._builder.DocumentToBuild.Classes.TryGetByName(this._reader.ValueAsString, out Classes.DxfClass dxfClass))
7,472✔
89
                                        {
7,104✔
90
                                                this._builder.Notify($"NonGraphicalObject not supported read as an UnknownNonGraphicalObject: {this._reader.ValueAsString}", NotificationType.NotImplemented);
7,104✔
91
                                                unknownEntityTemplate = new CadUnknownNonGraphicalObjectTemplate(new UnknownNonGraphicalObject(dxfClass));
7,104✔
92
                                        }
7,104✔
93
                                        else
94
                                        {
368✔
95
                                                this._builder.Notify($"UnknownNonGraphicalObject not supported: {this._reader.ValueAsString}", NotificationType.NotImplemented);
368✔
96
                                        }
368✔
97

98
                                        this._reader.ReadNext();
7,472✔
99

100
                                        do
101
                                        {
381,592✔
102
                                                if (unknownEntityTemplate != null && this._builder.KeepUnknownEntities)
381,592✔
103
                                                {
45,088✔
104
                                                        this.readCommonCodes(unknownEntityTemplate, out bool isExtendedData, map);
45,088✔
105
                                                        if (isExtendedData)
45,088✔
106
                                                                continue;
72✔
107
                                                }
45,016✔
108

109
                                                this._reader.ReadNext();
381,520✔
110
                                        }
381,520✔
111
                                        while (this._reader.DxfCode != DxfCode.Start);
381,592✔
112

113
                                        return unknownEntityTemplate;
7,472✔
114
                        }
115
                }
58,251✔
116

117
                protected CadTemplate readObjectCodes<T>(CadTemplate template, ReadObjectDelegate<T> readObject)
118
                        where T : CadObject
119
                {
50,587✔
120
                        this._reader.ReadNext();
50,587✔
121

122
                        DxfMap map = DxfMap.Create<T>();
50,587✔
123

124
                        while (this._reader.DxfCode != DxfCode.Start)
1,654,784✔
125
                        {
1,604,581✔
126
                                if (!readObject(template, map))
1,604,581✔
127
                                {
941,917✔
128
                                        this.readCommonCodes(template, out bool isExtendedData, map);
941,917✔
129
                                        if (isExtendedData)
941,917✔
130
                                                continue;
4,921✔
131
                                }
936,996✔
132

133
                                if (this._reader.DxfCode != DxfCode.Start)
1,599,660✔
134
                                        this._reader.ReadNext();
1,584,314✔
135
                        }
1,599,660✔
136

137
                        return template;
50,203✔
138
                }
50,203✔
139

140
                private bool readObjectSubclassMap(CadTemplate template, DxfMap map)
141
                {
16,542✔
142
                        switch (this._reader.Code)
16,542✔
143
                        {
144
                                default:
145
                                        return this.tryAssignCurrentValue(template.CadObject, map.SubClasses[template.CadObject.SubclassMarker]);
16,542✔
146
                        }
147
                }
16,542✔
148

149
                private bool readPlotSettings(CadTemplate template, DxfMap map)
150
                {
25,252✔
151
                        switch (this._reader.Code)
25,252✔
152
                        {
153
                                default:
154
                                        return this.tryAssignCurrentValue(template.CadObject, map.SubClasses[DxfSubclassMarker.PlotSettings]);
25,252✔
155
                        }
156
                }
25,252✔
157

158
                private bool readEvaluationGraph(CadTemplate template, DxfMap map)
159
                {
1,536✔
160
                        CadEvaluationGraphTemplate tmp = template as CadEvaluationGraphTemplate;
1,536✔
161
                        EvaluationGraph evGraph = tmp.CadObject;
1,536✔
162

163
                        switch (this._reader.Code)
1,536✔
164
                        {
165
                                case 91:
166
                                        while (this._reader.Code == 91)
2,496✔
167
                                        {
2,304✔
168
                                                GraphNodeTemplate nodeTemplate = new GraphNodeTemplate();
2,304✔
169
                                                EvaluationGraph.Node node = nodeTemplate.Node;
2,304✔
170

171
                                                node.Index = this._reader.ValueAsInt;
2,304✔
172

173
                                                this._reader.ExpectedCode(93);
2,304✔
174
                                                node.Flags = this._reader.ValueAsInt;
2,304✔
175

176
                                                this._reader.ExpectedCode(95);
2,304✔
177
                                                node.NextNodeIndex = this._reader.ValueAsInt;
2,304✔
178

179
                                                this._reader.ExpectedCode(360);
2,304✔
180
                                                nodeTemplate.ExpressionHandle = this._reader.ValueAsHandle;
2,304✔
181

182
                                                this._reader.ExpectedCode(92);
2,304✔
183
                                                node.Data1 = this._reader.ValueAsInt;
2,304✔
184
                                                this._reader.ExpectedCode(92);
2,304✔
185
                                                node.Data2 = this._reader.ValueAsInt;
2,304✔
186
                                                this._reader.ExpectedCode(92);
2,304✔
187
                                                node.Data3 = this._reader.ValueAsInt;
2,304✔
188
                                                this._reader.ExpectedCode(92);
2,304✔
189
                                                node.Data4 = this._reader.ValueAsInt;
2,304✔
190

191
                                                this._reader.ReadNext();
2,304✔
192

193
                                                tmp.NodeTemplates.Add(nodeTemplate);
2,304✔
194
                                        }
2,304✔
195

196
                                        return this.checkObjectEnd(template, map, this.readEvaluationGraph);
192✔
197
                                case 92:
198
                                        //Edges
199
                                        while (this._reader.Code == 92)
2,112✔
200
                                        {
1,920✔
201
                                                this._reader.ExpectedCode(93);
1,920✔
202
                                                this._reader.ExpectedCode(94);
1,920✔
203
                                                this._reader.ExpectedCode(91);
1,920✔
204
                                                this._reader.ExpectedCode(91);
1,920✔
205
                                                this._reader.ExpectedCode(92);
1,920✔
206
                                                this._reader.ExpectedCode(92);
1,920✔
207
                                                this._reader.ExpectedCode(92);
1,920✔
208
                                                this._reader.ExpectedCode(92);
1,920✔
209
                                                this._reader.ExpectedCode(92);
1,920✔
210

211
                                                this._reader.ReadNext();
1,920✔
212
                                        }
1,920✔
213

214
                                        return this.checkObjectEnd(template, map, this.readEvaluationGraph);
192✔
215
                                default:
216
                                        return this.tryAssignCurrentValue(template.CadObject, map.SubClasses[DxfSubclassMarker.EvalGraph]);
1,152✔
217
                        }
218
                }
1,536✔
219

220
                private bool readLayout(CadTemplate template, DxfMap map)
221
                {
51,406✔
222
                        CadLayoutTemplate tmp = template as CadLayoutTemplate;
51,406✔
223

224
                        switch (this._reader.Code)
51,406✔
225
                        {
226
                                case 330:
227
                                        tmp.PaperSpaceBlockHandle = this._reader.ValueAsHandle;
1,596✔
228
                                        return true;
1,596✔
229
                                case 331:
230
                                        tmp.LasActiveViewportHandle = (this._reader.ValueAsHandle);
770✔
231
                                        return true;
770✔
232
                                default:
233
                                        if (!this.tryAssignCurrentValue(template.CadObject, map.SubClasses[DxfSubclassMarker.Layout]))
49,040✔
234
                                        {
25,252✔
235
                                                return this.readPlotSettings(template, map);
25,252✔
236
                                        }
237
                                        return true;
23,788✔
238
                        }
239
                }
51,406✔
240

241
                private bool readGroup(CadTemplate template, DxfMap map)
NEW
242
                {
×
NEW
243
                        CadLayoutTemplate tmp = template as CadLayoutTemplate;
×
244

NEW
245
                        switch (this._reader.Code)
×
246
                        {
247
                                default:
NEW
248
                                        return this.tryAssignCurrentValue(template.CadObject, map.SubClasses[tmp.CadObject.SubclassMarker]);
×
249
                        }
NEW
250
                }
×
251

252
                private bool readGeoData(CadTemplate template, DxfMap map)
253
                {
102✔
254
                        CadGeoDataTemplate tmp = template as CadGeoDataTemplate;
102✔
255

256
                        switch (this._reader.Code)
102✔
257
                        {
258
                                case 40 when tmp.CadObject.Version == GeoDataVersion.R2009:
2✔
259
                                        tmp.CadObject.ReferencePoint = new CSMath.XYZ(
1✔
260
                                                tmp.CadObject.ReferencePoint.X,
1✔
261
                                                this._reader.ValueAsDouble,
1✔
262
                                                tmp.CadObject.ReferencePoint.Z
1✔
263
                                                );
1✔
264
                                        return true;
1✔
265
                                case 41 when tmp.CadObject.Version == GeoDataVersion.R2009:
2✔
266
                                        tmp.CadObject.ReferencePoint = new CSMath.XYZ(
1✔
267
                                                this._reader.ValueAsDouble,
1✔
268
                                                tmp.CadObject.ReferencePoint.Y,
1✔
269
                                                tmp.CadObject.ReferencePoint.Z
1✔
270
                                                );
1✔
271
                                        return true;
1✔
272
                                case 42 when tmp.CadObject.Version == GeoDataVersion.R2009:
1✔
273
                                        tmp.CadObject.ReferencePoint = new CSMath.XYZ(
1✔
274
                                                tmp.CadObject.ReferencePoint.X,
1✔
275
                                                tmp.CadObject.ReferencePoint.Y,
1✔
276
                                                this._reader.ValueAsDouble
1✔
277
                                                );
1✔
278
                                        return true;
1✔
279
                                case 46 when tmp.CadObject.Version == GeoDataVersion.R2009:
1✔
280
                                        tmp.CadObject.HorizontalUnitScale = this._reader.ValueAsDouble;
1✔
281
                                        return true;
1✔
282
                                case 52 when tmp.CadObject.Version == GeoDataVersion.R2009:
1✔
283
                                        double angle = System.Math.PI / 2.0 - this._reader.ValueAsAngle;
1✔
284
                                        tmp.CadObject.NorthDirection = new CSMath.XY(Math.Cos(angle), Math.Sin(angle));
1✔
285
                                        return true;
1✔
286
                                // Number of Geo-Mesh points
287
                                case 93:
288
                                        var npts = this._reader.ValueAsInt;
3✔
289
                                        for (int i = 0; i < npts; i++)
54✔
290
                                        {
24✔
291
                                                this._reader.ReadNext();
24✔
292
                                                double sourceX = this._reader.ValueAsDouble;
24✔
293
                                                this._reader.ReadNext();
24✔
294
                                                double sourceY = this._reader.ValueAsDouble;
24✔
295

296
                                                this._reader.ReadNext();
24✔
297
                                                double destX = this._reader.ValueAsDouble;
24✔
298
                                                this._reader.ReadNext();
24✔
299
                                                double destY = this._reader.ValueAsDouble;
24✔
300

301
                                                tmp.CadObject.Points.Add(new GeoData.GeoMeshPoint
24✔
302
                                                {
24✔
303
                                                        Source = new CSMath.XY(sourceX, sourceY),
24✔
304
                                                        Destination = new CSMath.XY(destX, destY)
24✔
305
                                                });
24✔
306
                                        }
24✔
307
                                        return true;
3✔
308
                                // Number of Geo-Mesh points
309
                                case 96:
310
                                        var nfaces = this._reader.ValueAsInt;
2✔
311
                                        for (int i = 0; i < nfaces; i++)
4!
312
                                        {
×
313
                                                this._reader.ReadNext();
×
314
                                                Debug.Assert(this._reader.Code == 97);
×
315
                                                int index1 = this._reader.ValueAsInt;
×
316
                                                this._reader.ReadNext();
×
317
                                                Debug.Assert(this._reader.Code == 98);
×
318
                                                int index2 = this._reader.ValueAsInt;
×
319
                                                this._reader.ReadNext();
×
320
                                                Debug.Assert(this._reader.Code == 99);
×
321
                                                int index3 = this._reader.ValueAsInt;
×
322

323
                                                tmp.CadObject.Faces.Add(new GeoData.GeoMeshFace
×
324
                                                {
×
325
                                                        Index1 = index1,
×
326
                                                        Index2 = index2,
×
327
                                                        Index3 = index3
×
328
                                                });
×
329
                                        }
×
330
                                        return true;
2✔
331
                                case 303:
332
                                        tmp.CadObject.CoordinateSystemDefinition += this._reader.ValueAsString;
13✔
333
                                        return true;
13✔
334
                                //Obsolete codes for version GeoDataVersion.R2009
335
                                case 3:
336
                                case 4:
337
                                case 14:
338
                                case 24:
339
                                case 15:
340
                                case 25:
341
                                case 43:
342
                                case 44:
343
                                case 45:
344
                                case 94:
345
                                case 293:
346
                                case 16:
347
                                case 26:
348
                                case 17:
349
                                case 27:
350
                                case 54:
351
                                case 140:
352
                                case 304:
353
                                case 292:
354
                                        return true;
19✔
355
                                default:
356
                                        return this.tryAssignCurrentValue(template.CadObject, map.SubClasses[tmp.CadObject.SubclassMarker]);
60✔
357
                        }
358
                }
102✔
359

360
                private bool readScale(CadTemplate template, DxfMap map)
361
                {
59,250✔
362
                        switch (this._reader.Code)
59,250✔
363
                        {
364
                                // Undocumented codes
365
                                case 70:
366
                                        //Always 0
367
                                        return true;
6,606✔
368
                                default:
369
                                        return this.tryAssignCurrentValue(template.CadObject, map.SubClasses[DxfSubclassMarker.Scale]);
52,644✔
370
                        }
371
                }
59,250✔
372

373
                private bool readTableContent(CadTemplate template, DxfMap map)
374
                {
888,576✔
375
                        switch (this._reader.Code)
888,576✔
376
                        {
377
                                default:
378
                                        return this.tryAssignCurrentValue(template.CadObject, map.SubClasses[DxfSubclassMarker.TableContent]);
888,576✔
379
                        }
380
                }
888,576✔
381

382
                private bool readVisualStyle(CadTemplate template, DxfMap map)
383
                {
346,908✔
384
                        switch (this._reader.Code)
346,908✔
385
                        {
386
                                // Undocumented codes
387
                                case 176:
388
                                case 177:
389
                                case 420:
390
                                        return true;
119,122✔
391
                                default:
392
                                        return this.tryAssignCurrentValue(template.CadObject, map.SubClasses[DxfSubclassMarker.VisualStyle]);
227,786✔
393
                        }
394
                }
346,908✔
395

396
                private bool readXRecord(CadTemplate template, DxfMap map)
397
                {
58,184✔
398
                        CadXRecordTemplate tmp = template as CadXRecordTemplate;
58,184✔
399

400
                        switch (this._reader.Code)
58,184✔
401
                        {
402
                                case 100 when this._reader.ValueAsString == DxfSubclassMarker.XRecord:
15,154✔
403
                                        this.readXRecordEntries(tmp);
15,154✔
404
                                        return true;
15,154✔
405
                                default:
406
                                        return this.tryAssignCurrentValue(template.CadObject, map.SubClasses[DxfSubclassMarker.XRecord]);
43,030✔
407
                        }
408
                }
58,184✔
409

410
                private void readXRecordEntries(CadXRecordTemplate template)
411
                {
15,154✔
412
                        this._reader.ReadNext();
15,154✔
413

414
                        while (this._reader.DxfCode != DxfCode.Start)
830,680✔
415
                        {
815,526✔
416
                                switch (this._reader.GroupCodeValue)
815,526!
417
                                {
418
                                        case GroupCodeValueType.Handle:
419
                                                template.AddHandleReference(this._reader.Code, this._reader.ValueAsHandle);
×
420
                                                break;
×
421
                                        default:
422
                                                template.CadObject.CreateEntry(this._reader.Code, this._reader.Value);
815,526✔
423
                                                break;
815,526✔
424
                                }
425

426
                                this._reader.ReadNext();
815,526✔
427
                        }
815,526✔
428
                }
15,154✔
429

430
                private bool readBookColor(CadTemplate template, DxfMap map)
431
                {
1,376✔
432
                        CadNonGraphicalObjectTemplate tmp = template as CadNonGraphicalObjectTemplate;
1,376✔
433
                        BookColor color = tmp.CadObject as BookColor;
1,376✔
434

435
                        switch (this._reader.Code)
1,376✔
436
                        {
437
                                case 430:
438
                                        color.Name = this._reader.ValueAsString;
160✔
439
                                        return true;
160✔
440
                                default:
441
                                        return this.tryAssignCurrentValue(template.CadObject, map.SubClasses[DxfSubclassMarker.DbColor]);
1,216✔
442
                        }
443
                }
1,376✔
444

445
                private bool readDictionary(CadTemplate template, DxfMap map)
446
                {
180,699✔
447
                        CadDictionaryTemplate tmp = template as CadDictionaryTemplate;
180,699✔
448
                        CadDictionary cadDictionary = tmp.CadObject;
180,699✔
449

450
                        switch (this._reader.Code)
180,699✔
451
                        {
452
                                case 280:
453
                                        cadDictionary.HardOwnerFlag = this._reader.ValueAsBool;
13,185✔
454
                                        return true;
13,185✔
455
                                case 281:
456
                                        cadDictionary.ClonningFlags = (DictionaryCloningFlags)this._reader.Value;
19,462✔
457
                                        return true;
19,462✔
458
                                case 3:
459
                                        tmp.Entries.Add(this._reader.ValueAsString, null);
40,814✔
460
                                        return true;
40,814✔
461
                                case 350: // Soft-owner ID/handle to entry object 
462
                                case 360: // Hard-owner ID/handle to entry object
463
                                        tmp.Entries[tmp.Entries.LastOrDefault().Key] = this._reader.ValueAsHandle;
40,814✔
464
                                        return true;
40,814✔
465
                                default:
466
                                        return this.tryAssignCurrentValue(template.CadObject, map.SubClasses[DxfSubclassMarker.Dictionary]);
66,424✔
467
                        }
468
                }
180,699✔
469

470
                private bool readDictionaryWithDefault(CadTemplate template, DxfMap map)
471
                {
1,746✔
472
                        CadDictionaryWithDefaultTemplate tmp = template as CadDictionaryWithDefaultTemplate;
1,746✔
473

474
                        switch (this._reader.Code)
1,746✔
475
                        {
476
                                case 340:
477
                                        tmp.DefaultEntryHandle = this._reader.ValueAsHandle;
194✔
478
                                        return true;
194✔
479
                                default:
480
                                        if (!this.tryAssignCurrentValue(template.CadObject, map.SubClasses[DxfSubclassMarker.DictionaryWithDefault]))
1,552!
481
                                        {
1,552✔
482
                                                return this.readDictionary(template, map);
1,552✔
483
                                        }
484
                                        return true;
×
485
                        }
486
                }
1,746✔
487

488
                private CadTemplate readSortentsTable()
489
                {
576✔
490
                        SortEntitiesTable sortTable = new SortEntitiesTable();
576✔
491
                        CadSortensTableTemplate template = new CadSortensTableTemplate(sortTable);
576✔
492

493
                        //Jump the 0 marker
494
                        this._reader.ReadNext();
576✔
495

496
                        this.readCommonObjectData(template);
576✔
497

498
                        System.Diagnostics.Debug.Assert(DxfSubclassMarker.SortentsTable == this._reader.ValueAsString);
576✔
499

500
                        //Jump the 100 marker
501
                        this._reader.ReadNext();
576✔
502

503
                        (ulong?, ulong?) pair = (null, null);
576✔
504

505
                        while (this._reader.DxfCode != DxfCode.Start)
4,224✔
506
                        {
3,648✔
507
                                switch (this._reader.Code)
3,648!
508
                                {
509
                                        case 5:
510
                                                pair.Item1 = this._reader.ValueAsHandle;
1,536✔
511
                                                break;
1,536✔
512
                                        case 330:
513
                                                template.BlockOwnerHandle = this._reader.ValueAsHandle;
576✔
514
                                                break;
576✔
515
                                        case 331:
516
                                                pair.Item2 = this._reader.ValueAsHandle;
1,536✔
517
                                                break;
1,536✔
518
                                        default:
519
                                                this._builder.Notify($"Group Code not handled {this._reader.GroupCodeValue} for {typeof(SortEntitiesTable)}, code : {this._reader.Code} | value : {this._reader.ValueAsString}");
×
520
                                                break;
×
521
                                }
522

523
                                if (pair.Item1.HasValue && pair.Item2.HasValue)
3,648✔
524
                                {
1,536✔
525
                                        template.Values.Add((pair.Item1.Value, pair.Item2.Value));
1,536✔
526
                                        pair = (null, null);
1,536✔
527
                                }
1,536✔
528

529
                                this._reader.ReadNext();
3,648✔
530
                        }
3,648✔
531

532
                        return template;
576✔
533
                }
576✔
534
        }
535
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc