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

DomCR / ACadSharp / 16399014406

20 Jul 2025 10:41AM UTC coverage: 75.129% (+0.09%) from 75.043%
16399014406

push

github

web-flow
Merge pull request #715 from DomCR/issue-712-pdfunderlay-writer

Issue 712 pdfunderlay writer

5899 of 8639 branches covered (68.28%)

Branch coverage included in aggregate %.

174 of 253 new or added lines in 18 files covered. (68.77%)

12 existing lines in 3 files now uncovered.

23517 of 30515 relevant lines covered (77.07%)

80247.46 hits per line

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

52.47
/src/ACadSharp/IO/DXF/DxfStreamWriter/DxfObjectsSectionWriter.cs
1
using ACadSharp.Entities;
2
using ACadSharp.Objects;
3
using ACadSharp.Objects.Evaluations;
4
using CSMath;
5
using CSUtilities.Converters;
6
using System;
7
using System.Linq;
8

9
namespace ACadSharp.IO.DXF
10
{
11
        internal class DxfObjectsSectionWriter : DxfSectionWriterBase
12
        {
13
                public override string SectionName { get { return DxfFileToken.ObjectsSection; } }
135✔
14

15
                public DxfObjectsSectionWriter(IDxfStreamWriter writer, CadDocument document, CadObjectHolder holder, DxfWriterConfiguration configuration)
16
                        : base(writer, document, holder, configuration)
45✔
17
                {
45✔
18
                }
45✔
19

20
                protected override void writeSection()
21
                {
45✔
22
                        while (this.Holder.Objects.Any())
2,180✔
23
                        {
2,135✔
24
                                CadObject item = this.Holder.Objects.Dequeue();
2,135✔
25

26
                                this.writeObject(item);
2,135✔
27
                        }
2,135✔
28
                }
45✔
29

30
                protected void writeObject<T>(T co)
31
                        where T : CadObject
32
                {
2,135✔
33
                        switch (co)
2,135✔
34
                        {
35
                                case AcdbPlaceHolder:
36
                                case EvaluationGraph:
37
                                case Material:
38
                                case MultiLeaderAnnotContext:
39
                                case VisualStyle:
40
                                case ImageDefinitionReactor:
41
                                case UnknownNonGraphicalObject:
42
                                case XRecord:
43
                                        this.notify($"Object not implemented : {co.GetType().FullName}");
19✔
44
                                        return;
19✔
45
                        }
46

47

48
                        if (co is XRecord && !this.Configuration.WriteXRecords)
2,116!
49
                        {
×
50
                                return;
×
51
                        }
52

53
                        this._writer.Write(DxfCode.Start, co.ObjectName);
2,116✔
54

55
                        this.writeCommonObjectData(co);
2,116✔
56

57
                        switch (co)
2,116!
58
                        {
59
                                case BookColor bookColor:
60
                                        this.writeBookColor(bookColor);
×
61
                                        return;
×
62
                                case CadDictionary cadDictionary:
63
                                        this.writeDictionary(cadDictionary);
1,537✔
64
                                        return;
1,537✔
65
                                case DictionaryVariable dictvar:
66
                                        this.writeDictionaryVariable(dictvar);
×
67
                                        break;
×
68
                                case GeoData geodata:
69
                                        this.writeGeoData(geodata);
×
70
                                        break;
×
71
                                case Group group:
72
                                        this.writeGroup(group);
×
73
                                        break;
×
74
                                case ImageDefinition imageDefinition:
75
                                        this.writeImageDefinition(imageDefinition);
7✔
76
                                        return;
7✔
77
                                case Layout layout:
78
                                        this.writeLayout(layout);
50✔
79
                                        break;
50✔
80
                                case MLineStyle mlStyle:
81
                                        this.writeMLineStyle(mlStyle);
25✔
82
                                        break;
25✔
83
                                case MultiLeaderStyle multiLeaderlStyle:
84
                                        this.writeMultiLeaderStyle(multiLeaderlStyle);
25✔
85
                                        break;
25✔
86
                                case PlotSettings plotSettings:
87
                                        this.writePlotSettings(plotSettings);
×
88
                                        break;
×
89
                                case PdfUnderlayDefinition pdfUnderlayDefinition:
90
                                        this.writePdfUnderlayDefinition(pdfUnderlayDefinition);
7✔
91
                                        break;
7✔
92
                                case RasterVariables rasterVariables:
NEW
93
                                        this.writeRasterVariables(rasterVariables);
×
NEW
94
                                        break;
×
95
                                case Scale scale:
96
                                        this.writeScale(scale);
425✔
97
                                        break;
425✔
98
                                case SortEntitiesTable sortensTable:
99
                                        this.writeSortentsTable(sortensTable);
40✔
100
                                        break;
40✔
101
                                case XRecord record:
102
                                        this.writeXRecord(record);
×
103
                                        break;
×
104
                                default:
105
                                        throw new NotImplementedException($"Object not implemented : {co.GetType().FullName}");
×
106
                        }
107

108
                        this.writeExtendedData(co.ExtendedData);
572✔
109
                }
2,135✔
110

111
                protected void writeBookColor(BookColor color)
112
                {
×
113
                        this._writer.Write(DxfCode.Subclass, DxfSubclassMarker.DbColor);
×
114

115
                        this._writer.Write(62, color.Color.GetApproxIndex());
×
116
                        this._writer.WriteTrueColor(420, color.Color);
×
117
                        this._writer.Write(430, color.Name);
×
118
                }
×
119

120
                protected void writeDictionary(CadDictionary e)
121
                {
1,537✔
122
                        this._writer.Write(DxfCode.Subclass, DxfSubclassMarker.Dictionary);
1,537✔
123

124
                        this._writer.Write(280, e.HardOwnerFlag);
1,537✔
125
                        this._writer.Write(281, (int)e.ClonningFlags);
1,537✔
126

127
                        foreach (NonGraphicalObject item in e)
8,062✔
128
                        {
1,947✔
129
                                if (item is XRecord && !this.Configuration.WriteXRecords)
1,947✔
130
                                {
443✔
131
                                        return;
443✔
132
                                }
133

134
                                this._writer.Write(3, item.Name);
1,504✔
135
                                this._writer.Write(350, item.Handle);
1,504✔
136
                        }
1,504✔
137

138
                        //Add the entries as objects
139
                        foreach (CadObject item in e)
6,064✔
140
                        {
1,391✔
141
                                this.Holder.Objects.Enqueue(item);
1,391✔
142
                        }
1,391✔
143
                }
1,537✔
144

145
                protected void writeDictionaryVariable(DictionaryVariable dictvar)
146
                {
×
147
                        DxfClassMap map = DxfClassMap.Create<DictionaryVariable>();
×
148

149
                        this._writer.Write(100, DxfSubclassMarker.DictionaryVariables);
×
150

151
                        this._writer.Write(1, dictvar.Value, map);
×
152
                        this._writer.Write(280, dictvar.ObjectSchemaNumber, map);
×
153
                }
×
154

155
                protected void writePlotSettings(PlotSettings plot)
156
                {
50✔
157
                        DxfClassMap map = DxfClassMap.Create<PlotSettings>();
50✔
158

159
                        this._writer.Write(100, DxfSubclassMarker.PlotSettings);
50✔
160

161
                        this._writer.Write(1, plot.PageName, map);
50✔
162
                        this._writer.Write(2, plot.SystemPrinterName, map);
50✔
163

164
                        this._writer.Write(4, plot.PaperSize, map);
50✔
165

166
                        this._writer.Write(6, plot.PlotViewName, map);
50✔
167
                        this._writer.Write(7, plot.StyleSheet, map);
50✔
168

169
                        this._writer.Write(40, plot.UnprintableMargin.Left, map);
50✔
170
                        this._writer.Write(41, plot.UnprintableMargin.Bottom, map);
50✔
171
                        this._writer.Write(42, plot.UnprintableMargin.Right, map);
50✔
172
                        this._writer.Write(43, plot.UnprintableMargin.Top, map);
50✔
173
                        this._writer.Write(44, plot.PaperWidth, map);
50✔
174
                        this._writer.Write(45, plot.PaperHeight, map);
50✔
175
                        this._writer.Write(46, plot.PlotOriginX, map);
50✔
176
                        this._writer.Write(47, plot.PlotOriginY, map);
50✔
177
                        this._writer.Write(48, plot.WindowLowerLeftX, map);
50✔
178
                        this._writer.Write(49, plot.WindowLowerLeftY, map);
50✔
179

180
                        this._writer.Write(140, plot.WindowUpperLeftX, map);
50✔
181
                        this._writer.Write(141, plot.WindowUpperLeftY, map);
50✔
182
                        this._writer.Write(142, plot.NumeratorScale, map);
50✔
183
                        this._writer.Write(143, plot.DenominatorScale, map);
50✔
184

185
                        this._writer.Write(70, (short)plot.Flags, map);
50✔
186

187
                        this._writer.Write(72, (short)plot.PaperUnits, map);
50✔
188
                        this._writer.Write(73, (short)plot.PaperRotation, map);
50✔
189
                        this._writer.Write(74, (short)plot.PlotType, map);
50✔
190
                        this._writer.Write(75, plot.ScaledFit, map);
50✔
191
                        this._writer.Write(76, (short)plot.ShadePlotMode, map);
50✔
192
                        this._writer.Write(77, (short)plot.ShadePlotResolutionMode, map);
50✔
193
                        this._writer.Write(78, plot.ShadePlotDPI, map);
50✔
194
                        this._writer.Write(147, plot.PrintScale, map);
50✔
195

196
                        this._writer.Write(148, plot.PaperImageOrigin.X, map);
50✔
197
                        this._writer.Write(149, plot.PaperImageOrigin.Y, map);
50✔
198
                }
50✔
199

200
                protected void writePdfUnderlayDefinition(PdfUnderlayDefinition definition)
201
                {
7✔
202
                        DxfClassMap map = DxfClassMap.Create<PlotSettings>();
7✔
203

204
                        this._writer.Write(100, DxfSubclassMarker.UnderlayDefinition);
7✔
205

206
                        this._writer.Write(1, definition.File, map);
7✔
207
                        this._writer.Write(2, definition.Page, map);
7✔
208
                }
7✔
209

210
                protected void writeRasterVariables(RasterVariables variables)
NEW
211
                {
×
NEW
212
                        DxfClassMap map = DxfClassMap.Create<RasterVariables>();
×
213

NEW
214
                        this._writer.Write(100, DxfSubclassMarker.RasterVariables);
×
215

NEW
216
                        this._writer.Write(90, variables.ClassVersion, map);
×
NEW
217
                        this._writer.Write(70, variables.IsDisplayFrameShown ? 1 : 0, map);
×
NEW
218
                        this._writer.Write(71, (short) variables.DisplayQuality, map);
×
NEW
219
                        this._writer.Write(72, (short)variables.DisplayQuality, map);
×
NEW
220
                }
×
221

222
                protected void writeScale(Scale scale)
223
                {
425✔
224
                        this._writer.Write(100, DxfSubclassMarker.Scale);
425✔
225

226
                        this._writer.Write(70, 0);
425✔
227
                        this._writer.Write(300, scale.Name);
425✔
228
                        this._writer.Write(140, scale.PaperUnits);
425✔
229
                        this._writer.Write(141, scale.DrawingUnits);
425✔
230
                        this._writer.Write(290, scale.IsUnitScale ? (short)1 : (short)0);
425✔
231
                }
425✔
232

233
                protected void writeGeoData(GeoData geodata)
234
                {
×
235
                        DxfClassMap map = DxfClassMap.Create<GeoData>();
×
236

237
                        this._writer.Write(100, DxfSubclassMarker.GeoData, map);
×
238

239
                        switch (this.Version)
×
240
                        {
241
                                case ACadVersion.Unknown:
242
                                case ACadVersion.MC0_0:
243
                                case ACadVersion.AC1_2:
244
                                case ACadVersion.AC1_4:
245
                                case ACadVersion.AC1_50:
246
                                case ACadVersion.AC2_10:
247
                                case ACadVersion.AC1002:
248
                                case ACadVersion.AC1003:
249
                                case ACadVersion.AC1004:
250
                                case ACadVersion.AC1006:
251
                                case ACadVersion.AC1009:
252
                                case ACadVersion.AC1012:
253
                                case ACadVersion.AC1014:
254
                                case ACadVersion.AC1015:
255
                                case ACadVersion.AC1018:
256
                                case ACadVersion.AC1021:
257
                                        this._writer.Write(90, 1, map);
×
258
                                        break;
×
259
                                case ACadVersion.AC1024:
260
                                        this._writer.Write(90, 2, map);
×
261
                                        break;
×
262
                                case ACadVersion.AC1027:
263
                                case ACadVersion.AC1032:
264
                                        this._writer.Write(90, 3, map);
×
265
                                        break;
×
266
                        }
267

268
                        if (geodata.HostBlock != null)
×
269
                        {
×
270
                                this._writer.Write(330, geodata.HostBlock.Handle, map);
×
271
                        }
×
272

273
                        this._writer.Write(70, (short)geodata.CoordinatesType, map);
×
274

275
                        if (this.Version <= ACadVersion.AC1021)
×
276
                        {
×
277
                                this._writer.Write(40, geodata.ReferencePoint.Y, map);
×
278
                                this._writer.Write(41, geodata.ReferencePoint.X, map);
×
279
                                this._writer.Write(42, geodata.ReferencePoint.Z, map);
×
280
                                this._writer.Write(91, (int)geodata.HorizontalUnits, map);
×
281

282
                                this._writer.Write(10, geodata.DesignPoint, map);
×
283
                                this._writer.Write(11, XYZ.Zero, map);
×
284

285
                                this._writer.Write(210, geodata.UpDirection, map);
×
286

287
                                this._writer.Write(52, MathHelper.RadToDeg(System.Math.PI / 2.0 - geodata.NorthDirection.GetAngle()), map);
×
288

289
                                this._writer.Write(43, 1.0, map);
×
290
                                this._writer.Write(44, 1.0, map);
×
291
                                this._writer.Write(45, 1.0, map);
×
292

293
                                this._writer.Write(301, geodata.CoordinateSystemDefinition, map);
×
294
                                this._writer.Write(302, geodata.GeoRssTag, map);
×
295

296
                                this._writer.Write(46, geodata.UserSpecifiedScaleFactor, map);
×
297

298
                                this._writer.Write(303, string.Empty, map);
×
299
                                this._writer.Write(304, string.Empty, map);
×
300

301
                                this._writer.Write(305, geodata.ObservationFromTag, map);
×
302
                                this._writer.Write(306, geodata.ObservationToTag, map);
×
303
                                this._writer.Write(307, geodata.ObservationCoverageTag, map);
×
304

305
                                this._writer.Write(93, geodata.Points.Count, map);
×
306
                                foreach (var pt in geodata.Points)
×
307
                                {
×
308
                                        this._writer.Write(12, pt.Source, map);
×
309
                                        this._writer.Write(13, pt.Destination, map);
×
310
                                }
×
311
                                this._writer.Write(96, geodata.Faces.Count, map);
×
312
                                foreach (var face in geodata.Faces)
×
313
                                {
×
314
                                        this._writer.Write(97, face.Index1, map);
×
315
                                        this._writer.Write(98, face.Index2, map);
×
316
                                        this._writer.Write(99, face.Index3, map);
×
317
                                }
×
318
                                this._writer.Write(3, "CIVIL3D_DATA_BEGIN", map);
×
319

320
                                this._writer.Write(292, false, map);
×
321
                                this._writer.Write(14, geodata.ReferencePoint.Convert<XY>(), map);
×
322
                                this._writer.Write(15, geodata.ReferencePoint.Convert<XY>(), map);
×
323
                                this._writer.Write(93, 0, map);
×
324
                                this._writer.Write(94, 0, map);
×
325
                                this._writer.Write(293, false, map);
×
326

327
                                this._writer.Write(16, XY.Zero, map);
×
328
                                this._writer.Write(17, XY.Zero, map);
×
329

330
                                this._writer.Write(54, MathHelper.RadToDeg(System.Math.PI / 2.0 - geodata.NorthDirection.GetAngle()), map);
×
331
                                this._writer.Write(140, System.Math.PI / 2.0 - geodata.NorthDirection.GetAngle(), map);
×
332

333
                                this._writer.Write(95, (int)geodata.ScaleEstimationMethod, map);
×
334
                                this._writer.Write(141, geodata.UserSpecifiedScaleFactor, map);
×
335
                                this._writer.Write(294, geodata.EnableSeaLevelCorrection, map);
×
336
                                this._writer.Write(142, geodata.SeaLevelElevation, map);
×
337
                                this._writer.Write(143, geodata.CoordinateProjectionRadius, map);
×
338

339
                                this._writer.Write(4, "CIVIL3D_DATA_END", map);
×
340
                        }
×
341
                        else
342
                        {
×
343
                                this._writer.Write(10, geodata.DesignPoint, map);
×
344
                                this._writer.Write(11, geodata.ReferencePoint, map);
×
345
                                this._writer.Write(40, geodata.VerticalUnitScale, map);
×
346
                                this._writer.Write(91, (int)geodata.HorizontalUnits, map);
×
347
                                this._writer.Write(41, geodata.VerticalUnitScale, map);
×
348
                                this._writer.Write(92, (int)geodata.VerticalUnits, map);
×
349

350
                                this._writer.Write(210, geodata.UpDirection, map);
×
351

352
                                this._writer.Write(12, geodata.NorthDirection, map);
×
353

354
                                this._writer.Write(95, geodata.ScaleEstimationMethod, map);
×
355
                                this._writer.Write(141, geodata.UserSpecifiedScaleFactor, map);
×
356
                                this._writer.Write(294, geodata.EnableSeaLevelCorrection, map);
×
357
                                this._writer.Write(142, geodata.SeaLevelElevation, map);
×
358
                                this._writer.Write(143, geodata.CoordinateProjectionRadius, map);
×
359

360
                                this.writeLongTextValue(301, 303, geodata.CoordinateSystemDefinition);
×
361

362
                                this._writer.Write(302, geodata.GeoRssTag, map);
×
363
                                this._writer.Write(305, geodata.ObservationFromTag, map);
×
364
                                this._writer.Write(306, geodata.ObservationToTag, map);
×
365
                                this._writer.Write(307, geodata.ObservationCoverageTag, map);
×
366

367
                                this._writer.Write(93, geodata.Points.Count, map);
×
368
                                foreach (var pt in geodata.Points)
×
369
                                {
×
370
                                        this._writer.Write(13, pt.Source, map);
×
371
                                        this._writer.Write(14, pt.Destination, map);
×
372
                                }
×
373

374
                                this._writer.Write(96, geodata.Faces.Count, map);
×
375

376
                                foreach (var face in geodata.Faces)
×
377
                                {
×
378
                                        this._writer.Write(97, face.Index1, map);
×
379
                                        this._writer.Write(98, face.Index2, map);
×
380
                                        this._writer.Write(99, face.Index3, map);
×
381
                                }
×
382
                        }
×
383
                }
×
384

385
                protected void writeGroup(Group group)
386
                {
×
387
                        this._writer.Write(100, DxfSubclassMarker.Group);
×
388

389
                        this._writer.Write(300, group.Description);
×
390
                        this._writer.Write(70, group.IsUnnamed ? (short)1 : (short)0);
×
391
                        this._writer.Write(71, group.Selectable ? (short)1 : (short)0);
×
392

393
                        foreach (Entity entity in group.Entities)
×
394
                        {
×
395
                                this._writer.WriteHandle(340, entity);
×
396
                        }
×
397
                }
×
398

399
                protected void writeImageDefinition(ImageDefinition definition)
400
                {
7✔
401
                        DxfClassMap map = DxfClassMap.Create<ImageDefinition>();
7✔
402

403
                        this._writer.Write(100, DxfSubclassMarker.RasterImageDef);
7✔
404

405
                        this._writer.Write(90, definition.ClassVersion, map);
7✔
406
                        this._writer.Write(1, definition.FileName, map);
7✔
407

408
                        this._writer.Write(10, definition.Size, map);
7✔
409

410
                        this._writer.Write(280, definition.IsLoaded ? 1 : 0, map);
7!
411

412
                        this._writer.Write(281, (byte)definition.Units, map);
7✔
413
                }
7✔
414

415
                protected void writeLayout(Layout layout)
416
                {
50✔
417
                        DxfClassMap map = DxfClassMap.Create<Layout>();
50✔
418

419
                        this.writePlotSettings(layout);
50✔
420

421
                        this._writer.Write(100, DxfSubclassMarker.Layout);
50✔
422

423
                        this._writer.Write(1, layout.Name, map);
50✔
424

425
                        //this._writer.Write(70, (short) 1,map);
426
                        this._writer.Write(71, layout.TabOrder, map);
50✔
427

428
                        this._writer.Write(10, layout.MinLimits, map);
50✔
429
                        this._writer.Write(11, layout.MaxLimits, map);
50✔
430
                        this._writer.Write(12, layout.InsertionBasePoint, map);
50✔
431
                        this._writer.Write(13, layout.Origin, map);
50✔
432
                        this._writer.Write(14, layout.MinExtents, map);
50✔
433
                        this._writer.Write(15, layout.MaxExtents, map);
50✔
434
                        this._writer.Write(16, layout.XAxis, map);
50✔
435
                        this._writer.Write(17, layout.YAxis, map);
50✔
436

437
                        this._writer.Write(146, layout.Elevation, map);
50✔
438

439
                        this._writer.Write(76, (short)0, map);
50✔
440

441
                        this._writer.WriteHandle(330, layout.AssociatedBlock, map);
50✔
442
                }
50✔
443

444
                protected void writeMLineStyle(MLineStyle style)
445
                {
25✔
446
                        DxfClassMap map = DxfClassMap.Create<MLineStyle>();
25✔
447

448
                        this._writer.Write(100, DxfSubclassMarker.MLineStyle);
25✔
449

450
                        this._writer.Write(2, style.Name, map);
25✔
451

452
                        this._writer.Write(70, (short)style.Flags, map);
25✔
453

454
                        this._writer.Write(3, style.Description, map);
25✔
455

456
                        this._writer.Write(62, style.FillColor.GetApproxIndex(), map);
25✔
457

458
                        this._writer.Write(51, style.StartAngle, map);
25✔
459
                        this._writer.Write(52, style.EndAngle, map);
25✔
460
                        this._writer.Write(71, (short)style.Elements.Count, map);
25✔
461
                        foreach (MLineStyle.Element element in style.Elements)
75!
462
                        {
×
463
                                this._writer.Write(49, element.Offset, map);
×
464
                                this._writer.Write(62, element.Color.Index, map);
×
465
                                this._writer.Write(6, element.LineType.Name, map);
×
466
                        }
×
467
                }
25✔
468

469
                protected void writeMultiLeaderStyle(MultiLeaderStyle style)
470
                {
25✔
471
                        DxfClassMap map = DxfClassMap.Create<MultiLeaderStyle>();
25✔
472

473
                        this._writer.Write(100, DxfSubclassMarker.MLeaderStyle);
25✔
474

475
                        this._writer.Write(179, 2);
25✔
476
                        //        this._writer.Write(2, style.Name, map);
477
                        this._writer.Write(170, (short)style.ContentType, map);
25✔
478
                        this._writer.Write(171, (short)style.MultiLeaderDrawOrder, map);
25✔
479
                        this._writer.Write(172, (short)style.LeaderDrawOrder, map);
25✔
480
                        this._writer.Write(90, style.MaxLeaderSegmentsPoints, map);
25✔
481
                        this._writer.Write(40, style.FirstSegmentAngleConstraint, map);
25✔
482
                        this._writer.Write(41, style.SecondSegmentAngleConstraint, map);
25✔
483
                        this._writer.Write(173, (short)style.PathType, map);
25✔
484
                        this._writer.WriteCmColor(91, style.LineColor, map);
25✔
485
                        this._writer.WriteHandle(340, style.LeaderLineType);
25✔
486
                        this._writer.Write(92, (short)style.LeaderLineWeight, map);
25✔
487
                        this._writer.Write(290, style.EnableLanding, map);
25✔
488
                        this._writer.Write(42, style.LandingGap, map);
25✔
489
                        this._writer.Write(291, style.EnableDogleg, map);
25✔
490
                        this._writer.Write(43, style.LandingDistance, map);
25✔
491
                        this._writer.Write(3, style.Description, map);
25✔
492
                        this._writer.WriteHandle(341, style.Arrowhead);
25✔
493
                        this._writer.Write(44, style.ArrowheadSize, map);
25✔
494
                        this._writer.Write(300, style.DefaultTextContents, map);
25✔
495
                        this._writer.WriteHandle(342, style.TextStyle);
25✔
496
                        this._writer.Write(174, (short)style.TextLeftAttachment, map);
25✔
497
                        this._writer.Write(178, (short)style.TextRightAttachment, map);
25✔
498
                        this._writer.Write(175, style.TextAngle, map);
25✔
499
                        this._writer.Write(176, (short)style.TextAlignment, map);
25✔
500
                        this._writer.WriteCmColor(93, style.TextColor, map);
25✔
501
                        this._writer.Write(45, style.TextHeight, map);
25✔
502
                        this._writer.Write(292, style.TextFrame, map);
25✔
503
                        this._writer.Write(297, style.TextAlignAlwaysLeft, map);
25✔
504
                        this._writer.Write(46, style.AlignSpace, map);
25✔
505
                        this._writer.WriteHandle(343, style.BlockContent);
25✔
506
                        this._writer.WriteCmColor(94, style.BlockContentColor, map);
25✔
507

508
                        //        Write 3 doubles since group codes do not conform vector group codes
509
                        this._writer.Write(47, style.BlockContentScale.X, map);
25✔
510
                        this._writer.Write(49, style.BlockContentScale.Y, map);
25✔
511
                        this._writer.Write(140, style.BlockContentScale.Z, map);
25✔
512

513
                        this._writer.Write(293, style.EnableBlockContentScale, map);
25✔
514
                        this._writer.Write(141, style.BlockContentRotation, map);
25✔
515
                        this._writer.Write(294, style.EnableBlockContentRotation, map);
25✔
516
                        this._writer.Write(177, (short)style.BlockContentConnection, map);
25✔
517
                        this._writer.Write(142, style.ScaleFactor, map);
25✔
518
                        this._writer.Write(295, style.OverwritePropertyValue, map);
25✔
519
                        this._writer.Write(296, style.IsAnnotative, map);
25✔
520
                        this._writer.Write(143, style.BreakGapSize, map);
25✔
521
                        this._writer.Write(271, (short)style.TextAttachmentDirection, map);
25✔
522
                        this._writer.Write(272, (short)style.TextBottomAttachment, map);
25✔
523
                        this._writer.Write(273, (short)style.TextTopAttachment, map);
25✔
524
                        this._writer.Write(298, false); //        undocumented
25✔
525
                }
25✔
526

527
                private void writeSortentsTable(SortEntitiesTable e)
528
                {
40✔
529
                        this._writer.Write(DxfCode.Subclass, DxfSubclassMarker.SortentsTable);
40✔
530

531
                        this._writer.WriteHandle(330, e.BlockOwner);
40✔
532

533
                        foreach (SortEntitiesTable.Sorter item in e)
408✔
534
                        {
144✔
535
                                this._writer.WriteHandle(331, item.Entity);
144✔
536
                                this._writer.Write(5, item.SortHandle);
144✔
537
                        }
144✔
538
                }
40✔
539

540
                protected void writeXRecord(XRecord e)
541
                {
×
542
                        this._writer.Write(DxfCode.Subclass, DxfSubclassMarker.XRecord);
×
543

544
                        foreach (var item in e.Entries)
×
545
                        {
×
546
                                this._writer.Write(item.Code, item.Value);
×
547
                        }
×
548
                }
×
549
        }
550
}
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