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

DomCR / ACadSharp / 13115488098

03 Feb 2025 02:16PM UTC coverage: 75.824% (-0.4%) from 76.226%
13115488098

push

github

web-flow
Merge pull request #546 from DomCR/issue-529_geodata

Issue 529 geodata

5407 of 7857 branches covered (68.82%)

Branch coverage included in aggregate %.

178 of 394 new or added lines in 14 files covered. (45.18%)

2 existing lines in 1 file now uncovered.

21455 of 27570 relevant lines covered (77.82%)

39131.95 hits per line

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

50.65
/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,120✔
23
                        {
2,075✔
24
                                CadObject item = this.Holder.Objects.Dequeue();
2,075✔
25

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

30
                protected void writeObject<T>(T co)
31
                        where T : CadObject
32
                {
2,075✔
33
                        switch (co)
2,075!
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}");
×
44
                                        return;
×
45
                        }
46

47

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

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

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

57
                        switch (co)
2,075!
58
                        {
59
                                case BookColor bookColor:
60
                                        this.writeBookColor(bookColor);
×
61
                                        return;
×
62
                                case CadDictionary cadDictionary:
63
                                        this.writeDictionary(cadDictionary);
1,519✔
64
                                        return;
1,519✔
65
                                case DictionaryVariable dictvar:
66
                                        this.writeDictionaryVariable(dictvar);
×
67
                                        break;
×
68
                                case GeoData geodata:
NEW
69
                                        this.writeGeoData(geodata);
×
NEW
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 Scale scale:
90
                                        this.writeScale(scale);
425✔
91
                                        break;
425✔
92
                                case SortEntitiesTable sortensTable:
93
                                        this.writeSortentsTable(sortensTable);
24✔
94
                                        break;
24✔
95
                                case XRecord record:
96
                                        this.writeXRecord(record);
×
97
                                        break;
×
98
                                default:
99
                                        throw new NotImplementedException($"Object not implemented : {co.GetType().FullName}");
×
100
                        }
101

102
                        this.writeExtendedData(co.ExtendedData);
549✔
103
                }
2,075✔
104

105
                protected void writeBookColor(BookColor color)
106
                {
×
107
                        this._writer.Write(DxfCode.Subclass, DxfSubclassMarker.DbColor);
×
108

109
                        this._writer.Write(62, color.Color.GetApproxIndex());
×
110
                        this._writer.WriteTrueColor(420, color.Color);
×
111
                        this._writer.Write(430, color.Name);
×
112
                }
×
113

114
                protected void writeDictionary(CadDictionary e)
115
                {
1,519✔
116
                        this._writer.Write(DxfCode.Subclass, DxfSubclassMarker.Dictionary);
1,519✔
117

118
                        this._writer.Write(280, e.HardOwnerFlag);
1,519✔
119
                        this._writer.Write(281, (int)e.ClonningFlags);
1,519✔
120

121
                        foreach (NonGraphicalObject item in e)
7,206✔
122
                        {
1,495✔
123
                                if (item is XRecord && !this.Configuration.WriteXRecords)
1,495✔
124
                                {
341✔
125
                                        return;
341✔
126
                                }
127

128
                                this._writer.Write(3, item.Name);
1,154✔
129
                                this._writer.Write(350, item.Handle);
1,154✔
130
                        }
1,154✔
131

132
                        //Add the entries as objects
133
                        foreach (CadObject item in e)
5,840✔
134
                        {
1,153✔
135
                                this.Holder.Objects.Enqueue(item);
1,153✔
136
                        }
1,153✔
137
                }
1,519✔
138

139
                protected void writeDictionaryVariable(DictionaryVariable dictvar)
140
                {
×
141
                        DxfClassMap map = DxfClassMap.Create<DictionaryVariable>();
×
142

143
                        this._writer.Write(100, DxfSubclassMarker.DictionaryVariables);
×
144

145
                        this._writer.Write(1, dictvar.Value, map);
×
146
                        this._writer.Write(280, dictvar.ObjectSchemaNumber, map);
×
147
                }
×
148

149
                protected void writePlotSettings(PlotSettings plot)
150
                {
50✔
151
                        DxfClassMap map = DxfClassMap.Create<PlotSettings>();
50✔
152

153
                        this._writer.Write(100, DxfSubclassMarker.PlotSettings);
50✔
154

155
                        this._writer.Write(1, plot.PageName, map);
50✔
156
                        this._writer.Write(2, plot.SystemPrinterName, map);
50✔
157

158
                        this._writer.Write(4, plot.PaperSize, map);
50✔
159

160
                        this._writer.Write(6, plot.PlotViewName, map);
50✔
161
                        this._writer.Write(7, plot.StyleSheet, map);
50✔
162

163
                        this._writer.Write(40, plot.UnprintableMargin.Left, map);
50✔
164
                        this._writer.Write(41, plot.UnprintableMargin.Bottom, map);
50✔
165
                        this._writer.Write(42, plot.UnprintableMargin.Right, map);
50✔
166
                        this._writer.Write(43, plot.UnprintableMargin.Top, map);
50✔
167
                        this._writer.Write(44, plot.PaperWidth, map);
50✔
168
                        this._writer.Write(45, plot.PaperHeight, map);
50✔
169
                        this._writer.Write(46, plot.PlotOriginX, map);
50✔
170
                        this._writer.Write(47, plot.PlotOriginY, map);
50✔
171
                        this._writer.Write(48, plot.WindowLowerLeftX, map);
50✔
172
                        this._writer.Write(49, plot.WindowLowerLeftY, map);
50✔
173

174
                        this._writer.Write(140, plot.WindowUpperLeftX, map);
50✔
175
                        this._writer.Write(141, plot.WindowUpperLeftY, map);
50✔
176
                        this._writer.Write(142, plot.NumeratorScale, map);
50✔
177
                        this._writer.Write(143, plot.DenominatorScale, map);
50✔
178

179
                        this._writer.Write(70, (short)plot.Flags, map);
50✔
180

181
                        this._writer.Write(72, (short)plot.PaperUnits, map);
50✔
182
                        this._writer.Write(73, (short)plot.PaperRotation, map);
50✔
183
                        this._writer.Write(74, (short)plot.PlotType, map);
50✔
184
                        this._writer.Write(75, plot.ScaledFit, map);
50✔
185
                        this._writer.Write(76, (short)plot.ShadePlotMode, map);
50✔
186
                        this._writer.Write(77, (short)plot.ShadePlotResolutionMode, map);
50✔
187
                        this._writer.Write(78, plot.ShadePlotDPI, map);
50✔
188
                        this._writer.Write(147, plot.PrintScale, map);
50✔
189

190
                        this._writer.Write(148, plot.PaperImageOrigin.X, map);
50✔
191
                        this._writer.Write(149, plot.PaperImageOrigin.Y, map);
50✔
192
                }
50✔
193

194
                protected void writeScale(Scale scale)
195
                {
425✔
196
                        this._writer.Write(100, DxfSubclassMarker.Scale);
425✔
197

198
                        this._writer.Write(70, 0);
425✔
199
                        this._writer.Write(300, scale.Name);
425✔
200
                        this._writer.Write(140, scale.PaperUnits);
425✔
201
                        this._writer.Write(141, scale.DrawingUnits);
425✔
202
                        this._writer.Write(290, scale.IsUnitScale ? (short)1 : (short)0);
425✔
203
                }
425✔
204

205
                protected void writeGeoData(GeoData geodata)
NEW
206
                {
×
NEW
207
                        DxfClassMap map = DxfClassMap.Create<GeoData>();
×
208

NEW
209
                        this._writer.Write(100, DxfSubclassMarker.GeoData, map);
×
210

NEW
211
                        switch (this.Version)
×
212
                        {
213
                                case ACadVersion.Unknown:
214
                                case ACadVersion.MC0_0:
215
                                case ACadVersion.AC1_2:
216
                                case ACadVersion.AC1_4:
217
                                case ACadVersion.AC1_50:
218
                                case ACadVersion.AC2_10:
219
                                case ACadVersion.AC1002:
220
                                case ACadVersion.AC1003:
221
                                case ACadVersion.AC1004:
222
                                case ACadVersion.AC1006:
223
                                case ACadVersion.AC1009:
224
                                case ACadVersion.AC1012:
225
                                case ACadVersion.AC1014:
226
                                case ACadVersion.AC1015:
227
                                case ACadVersion.AC1018:
228
                                case ACadVersion.AC1021:
NEW
229
                                        this._writer.Write(90, 1, map);
×
NEW
230
                                        break;
×
231
                                case ACadVersion.AC1024:
NEW
232
                                        this._writer.Write(90, 2, map);
×
NEW
233
                                        break;
×
234
                                case ACadVersion.AC1027:
235
                                case ACadVersion.AC1032:
NEW
236
                                        this._writer.Write(90, 3, map);
×
NEW
237
                                        break;
×
238
                        }
239

NEW
240
                        if (geodata.HostBlock != null)
×
NEW
241
                        {
×
NEW
242
                                this._writer.Write(330, geodata.HostBlock.Handle, map);
×
NEW
243
                        }
×
244

NEW
245
                        this._writer.Write(70, (short)geodata.CoordinatesType, map);
×
246

NEW
247
                        if (this.Version <= ACadVersion.AC1021)
×
NEW
248
                        {
×
NEW
249
                                this._writer.Write(40, geodata.ReferencePoint.Y, map);
×
NEW
250
                                this._writer.Write(41, geodata.ReferencePoint.X, map);
×
NEW
251
                                this._writer.Write(42, geodata.ReferencePoint.Z, map);
×
NEW
252
                                this._writer.Write(91, (int)geodata.HorizontalUnits, map);
×
253

NEW
254
                                this._writer.Write(10, geodata.DesignPoint, map);
×
NEW
255
                                this._writer.Write(11, XYZ.Zero, map);
×
256

NEW
257
                                this._writer.Write(210, geodata.UpDirection, map);
×
258

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

NEW
261
                                this._writer.Write(43, 1.0, map);
×
NEW
262
                                this._writer.Write(44, 1.0, map);
×
NEW
263
                                this._writer.Write(45, 1.0, map);
×
264

NEW
265
                                this._writer.Write(301, geodata.CoordinateSystemDefinition, map);
×
NEW
266
                                this._writer.Write(302, geodata.GeoRssTag, map);
×
267

NEW
268
                                this._writer.Write(46, geodata.UserSpecifiedScaleFactor, map);
×
269

NEW
270
                                this._writer.Write(303, string.Empty, map);
×
NEW
271
                                this._writer.Write(304, string.Empty, map);
×
272

NEW
273
                                this._writer.Write(305, geodata.ObservationFromTag, map);
×
NEW
274
                                this._writer.Write(306, geodata.ObservationToTag, map);
×
NEW
275
                                this._writer.Write(307, geodata.ObservationCoverageTag, map);
×
276

NEW
277
                                this._writer.Write(93, geodata.Points.Count, map);
×
NEW
278
                                foreach (var pt in geodata.Points)
×
NEW
279
                                {
×
NEW
280
                                        this._writer.Write(12, pt.Source, map);
×
NEW
281
                                        this._writer.Write(13, pt.Destination, map);
×
NEW
282
                                }
×
NEW
283
                                this._writer.Write(96, geodata.Faces.Count, map);
×
NEW
284
                                foreach (var face in geodata.Faces)
×
NEW
285
                                {
×
NEW
286
                                        this._writer.Write(97, face.Index1, map);
×
NEW
287
                                        this._writer.Write(98, face.Index2, map);
×
NEW
288
                                        this._writer.Write(99, face.Index3, map);
×
NEW
289
                                }
×
NEW
290
                                this._writer.Write(3, "CIVIL3D_DATA_BEGIN", map);
×
291

NEW
292
                                this._writer.Write(292, false, map);
×
NEW
293
                                this._writer.Write(14, geodata.ReferencePoint.Convert<XY>(), map);
×
NEW
294
                                this._writer.Write(15, geodata.ReferencePoint.Convert<XY>(), map);
×
NEW
295
                                this._writer.Write(93, 0, map);
×
NEW
296
                                this._writer.Write(94, 0, map);
×
NEW
297
                                this._writer.Write(293, false, map);
×
298

NEW
299
                                this._writer.Write(16, XY.Zero, map);
×
NEW
300
                                this._writer.Write(17, XY.Zero, map);
×
301

NEW
302
                                this._writer.Write(54, MathHelper.RadToDeg(System.Math.PI / 2.0 - geodata.NorthDirection.GetAngle()), map);
×
NEW
303
                                this._writer.Write(140, System.Math.PI / 2.0 - geodata.NorthDirection.GetAngle(), map);
×
304

NEW
305
                                this._writer.Write(95, (int)geodata.ScaleEstimationMethod, map);
×
NEW
306
                                this._writer.Write(141, geodata.UserSpecifiedScaleFactor, map);
×
NEW
307
                                this._writer.Write(294, geodata.EnableSeaLevelCorrection, map);
×
NEW
308
                                this._writer.Write(142, geodata.SeaLevelElevation, map);
×
NEW
309
                                this._writer.Write(143, geodata.CoordinateProjectionRadius, map);
×
310

NEW
311
                                this._writer.Write(4, "CIVIL3D_DATA_END", map);
×
NEW
312
                        }
×
313
                        else
NEW
314
                        {
×
NEW
315
                                this._writer.Write(10, geodata.DesignPoint, map);
×
NEW
316
                                this._writer.Write(11, geodata.ReferencePoint, map);
×
NEW
317
                                this._writer.Write(40, geodata.VerticalUnitScale, map);
×
NEW
318
                                this._writer.Write(91, (int)geodata.HorizontalUnits, map);
×
NEW
319
                                this._writer.Write(41, geodata.VerticalUnitScale, map);
×
NEW
320
                                this._writer.Write(92, (int)geodata.VerticalUnits, map);
×
321

NEW
322
                                this._writer.Write(210, geodata.UpDirection, map);
×
323

NEW
324
                                this._writer.Write(12, geodata.NorthDirection, map);
×
325

NEW
326
                                this._writer.Write(95, geodata.ScaleEstimationMethod, map);
×
NEW
327
                                this._writer.Write(141, geodata.UserSpecifiedScaleFactor, map);
×
NEW
328
                                this._writer.Write(294, geodata.EnableSeaLevelCorrection, map);
×
NEW
329
                                this._writer.Write(142, geodata.SeaLevelElevation, map);
×
NEW
330
                                this._writer.Write(143, geodata.CoordinateProjectionRadius, map);
×
331

NEW
332
                                this.writeLongTextValue(301, 303, geodata.CoordinateSystemDefinition);
×
333

NEW
334
                                this._writer.Write(302, geodata.GeoRssTag, map);
×
NEW
335
                                this._writer.Write(305, geodata.ObservationFromTag, map);
×
NEW
336
                                this._writer.Write(306, geodata.ObservationToTag, map);
×
NEW
337
                                this._writer.Write(307, geodata.ObservationCoverageTag, map);
×
338

NEW
339
                                this._writer.Write(93, geodata.Points.Count, map);
×
NEW
340
                                foreach (var pt in geodata.Points)
×
NEW
341
                                {
×
NEW
342
                                        this._writer.Write(13, pt.Source, map);
×
NEW
343
                                        this._writer.Write(14, pt.Destination, map);
×
NEW
344
                                }
×
345

NEW
346
                                this._writer.Write(96, geodata.Faces.Count, map);
×
347

NEW
348
                                foreach (var face in geodata.Faces)
×
NEW
349
                                {
×
NEW
350
                                        this._writer.Write(97, face.Index1, map);
×
NEW
351
                                        this._writer.Write(98, face.Index2, map);
×
NEW
352
                                        this._writer.Write(99, face.Index3, map);
×
NEW
353
                                }
×
NEW
354
                        }
×
NEW
355
                }
×
356

357
                protected void writeGroup(Group group)
358
                {
×
359
                        this._writer.Write(100, DxfSubclassMarker.Group);
×
360

361
                        this._writer.Write(300, group.Description);
×
362
                        this._writer.Write(70, group.IsUnnamed ? (short)1 : (short)0);
×
363
                        this._writer.Write(71, group.Selectable ? (short)1 : (short)0);
×
364

365
                        foreach (Entity entity in group.Entities.Values)
×
366
                        {
×
367
                                this._writer.WriteHandle(340, entity);
×
368
                        }
×
369
                }
×
370

371
                protected void writeImageDefinition(ImageDefinition definition)
372
                {
7✔
373
                        DxfClassMap map = DxfClassMap.Create<ImageDefinition>();
7✔
374

375
                        this._writer.Write(100, DxfSubclassMarker.RasterImageDef);
7✔
376

377
                        this._writer.Write(90, definition.ClassVersion, map);
7✔
378
                        this._writer.Write(1, definition.FileName, map);
7✔
379

380
                        this._writer.Write(10, definition.Size, map);
7✔
381

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

384
                        this._writer.Write(281, (byte)definition.Units, map);
7✔
385
                }
7✔
386

387
                protected void writeLayout(Layout layout)
388
                {
50✔
389
                        DxfClassMap map = DxfClassMap.Create<Layout>();
50✔
390

391
                        this.writePlotSettings(layout);
50✔
392

393
                        this._writer.Write(100, DxfSubclassMarker.Layout);
50✔
394

395
                        this._writer.Write(1, layout.Name, map);
50✔
396

397
                        //this._writer.Write(70, (short) 1,map);
398
                        this._writer.Write(71, layout.TabOrder, map);
50✔
399

400
                        this._writer.Write(10, layout.MinLimits, map);
50✔
401
                        this._writer.Write(11, layout.MaxLimits, map);
50✔
402
                        this._writer.Write(12, layout.InsertionBasePoint, map);
50✔
403
                        this._writer.Write(13, layout.Origin, map);
50✔
404
                        this._writer.Write(14, layout.MinExtents, map);
50✔
405
                        this._writer.Write(15, layout.MaxExtents, map);
50✔
406
                        this._writer.Write(16, layout.XAxis, map);
50✔
407
                        this._writer.Write(17, layout.YAxis, map);
50✔
408

409
                        this._writer.Write(146, layout.Elevation, map);
50✔
410

411
                        this._writer.Write(76, (short)0, map);
50✔
412

413
                        this._writer.WriteHandle(330, layout.AssociatedBlock, map);
50✔
414
                }
50✔
415

416
                protected void writeMLineStyle(MLineStyle style)
417
                {
25✔
418
                        DxfClassMap map = DxfClassMap.Create<MLineStyle>();
25✔
419

420
                        this._writer.Write(100, DxfSubclassMarker.MLineStyle);
25✔
421

422
                        this._writer.Write(2, style.Name, map);
25✔
423

424
                        this._writer.Write(70, (short)style.Flags, map);
25✔
425

426
                        this._writer.Write(3, style.Description, map);
25✔
427

428
                        this._writer.Write(62, style.FillColor.GetApproxIndex(), map);
25✔
429

430
                        this._writer.Write(51, style.StartAngle, map);
25✔
431
                        this._writer.Write(52, style.EndAngle, map);
25✔
432
                        this._writer.Write(71, (short)style.Elements.Count, map);
25✔
433
                        foreach (MLineStyle.Element element in style.Elements)
75!
434
                        {
×
435
                                this._writer.Write(49, element.Offset, map);
×
436
                                this._writer.Write(62, element.Color.Index, map);
×
437
                                this._writer.Write(6, element.LineType.Name, map);
×
438
                        }
×
439
                }
25✔
440

441
                protected void writeMultiLeaderStyle(MultiLeaderStyle style)
442
                {
25✔
443
                        DxfClassMap map = DxfClassMap.Create<MultiLeaderStyle>();
25✔
444

445
                        this._writer.Write(100, DxfSubclassMarker.MLeaderStyle);
25✔
446

447
                        this._writer.Write(179, 2);
25✔
448
                        //        this._writer.Write(2, style.Name, map);
449
                        this._writer.Write(170, (short)style.ContentType, map);
25✔
450
                        this._writer.Write(171, (short)style.MultiLeaderDrawOrder, map);
25✔
451
                        this._writer.Write(172, (short)style.LeaderDrawOrder, map);
25✔
452
                        this._writer.Write(90, style.MaxLeaderSegmentsPoints, map);
25✔
453
                        this._writer.Write(40, style.FirstSegmentAngleConstraint, map);
25✔
454
                        this._writer.Write(41, style.SecondSegmentAngleConstraint, map);
25✔
455
                        this._writer.Write(173, (short)style.PathType, map);
25✔
456
                        this._writer.WriteCmColor(91, style.LineColor, map);
25✔
457
                        this._writer.WriteHandle(340, style.LeaderLineType);
25✔
458
                        this._writer.Write(92, (short)style.LeaderLineWeight, map);
25✔
459
                        this._writer.Write(290, style.EnableLanding, map);
25✔
460
                        this._writer.Write(42, style.LandingGap, map);
25✔
461
                        this._writer.Write(291, style.EnableDogleg, map);
25✔
462
                        this._writer.Write(43, style.LandingDistance, map);
25✔
463
                        this._writer.Write(3, style.Description, map);
25✔
464
                        this._writer.WriteHandle(341, style.Arrowhead);
25✔
465
                        this._writer.Write(44, style.ArrowheadSize, map);
25✔
466
                        this._writer.Write(300, style.DefaultTextContents, map);
25✔
467
                        this._writer.WriteHandle(342, style.TextStyle);
25✔
468
                        this._writer.Write(174, (short)style.TextLeftAttachment, map);
25✔
469
                        this._writer.Write(178, (short)style.TextRightAttachment, map);
25✔
470
                        this._writer.Write(175, style.TextAngle, map);
25✔
471
                        this._writer.Write(176, (short)style.TextAlignment, map);
25✔
472
                        this._writer.WriteCmColor(93, style.TextColor, map);
25✔
473
                        this._writer.Write(45, style.TextHeight, map);
25✔
474
                        this._writer.Write(292, style.TextFrame, map);
25✔
475
                        this._writer.Write(297, style.TextAlignAlwaysLeft, map);
25✔
476
                        this._writer.Write(46, style.AlignSpace, map);
25✔
477
                        this._writer.WriteHandle(343, style.BlockContent);
25✔
478
                        this._writer.WriteCmColor(94, style.BlockContentColor, map);
25✔
479

480
                        //        Write 3 doubles since group codes do not conform vector group codes
481
                        this._writer.Write(47, style.BlockContentScale.X, map);
25✔
482
                        this._writer.Write(49, style.BlockContentScale.Y, map);
25✔
483
                        this._writer.Write(140, style.BlockContentScale.Z, map);
25✔
484

485
                        this._writer.Write(293, style.EnableBlockContentScale, map);
25✔
486
                        this._writer.Write(141, style.BlockContentRotation, map);
25✔
487
                        this._writer.Write(294, style.EnableBlockContentRotation, map);
25✔
488
                        this._writer.Write(177, (short)style.BlockContentConnection, map);
25✔
489
                        this._writer.Write(142, style.ScaleFactor, map);
25✔
490
                        this._writer.Write(295, style.OverwritePropertyValue, map);
25✔
491
                        this._writer.Write(296, style.IsAnnotative, map);
25✔
492
                        this._writer.Write(143, style.BreakGapSize, map);
25✔
493
                        this._writer.Write(271, (short)style.TextAttachmentDirection, map);
25✔
494
                        this._writer.Write(272, (short)style.TextBottomAttachment, map);
25✔
495
                        this._writer.Write(273, (short)style.TextTopAttachment, map);
25✔
496
                        this._writer.Write(298, false); //        undocumented
25✔
497
                }
25✔
498

499
                private void writeSortentsTable(SortEntitiesTable e)
500
                {
24✔
501
                        this._writer.Write(DxfCode.Subclass, DxfSubclassMarker.SortentsTable);
24✔
502

503
                        this._writer.WriteHandle(330, e.BlockOwner);
24✔
504

505
                        foreach (SortEntitiesTable.Sorter item in e.Sorters)
360✔
506
                        {
144✔
507
                                this._writer.WriteHandle(331, item.Entity);
144✔
508
                                this._writer.Write(5, item.Handle);
144✔
509
                        }
144✔
510
                }
24✔
511

512
                protected void writeXRecord(XRecord e)
513
                {
×
514
                        this._writer.Write(DxfCode.Subclass, DxfSubclassMarker.XRecord);
×
515

516
                        foreach (var item in e.Entries)
×
517
                        {
×
518
                                this._writer.Write(item.Code, item.Value);
×
519
                        }
×
520
                }
×
521
        }
522
}
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