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

DomCR / ACadSharp / 13357939998

16 Feb 2025 07:04PM UTC coverage: 76.044% (+0.02%) from 76.027%
13357939998

push

github

web-flow
Merge pull request #562 from DomCR/dwgWriter-compressed

Dwg writer compressed

5454 of 7879 branches covered (69.22%)

Branch coverage included in aggregate %.

592 of 668 new or added lines in 3 files covered. (88.62%)

12 existing lines in 2 files now uncovered.

21531 of 27607 relevant lines covered (77.99%)

75888.98 hits per line

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

87.75
/src/ACadSharp/Header/CadHeader.cs
1
using ACadSharp.Attributes;
2
using ACadSharp.Entities;
3
using ACadSharp.Objects;
4
using ACadSharp.Tables;
5
using ACadSharp.Types.Units;
6
using CSMath;
7
using CSUtilities.Extensions;
8
using System;
9
using System.Collections.Generic;
10
using System.Linq;
11
using System.Reflection;
12

13
namespace ACadSharp.Header
14
{
15
        public class CadHeader
16
        {
17
                /// <summary>
18
                /// Sets the zero (0) base angle with respect to the current UCS.
19
                /// </summary>
20
                /// <remarks>
21
                /// System variable ANGBASE
22
                /// </remarks>
23
                [CadSystemVariable("$ANGBASE", 50)]
24
                public double AngleBase { get; set; } = 0.0d;
1,195✔
25

26
                /// <summary>
27
                /// Sets the direction of positive angles.
28
                /// </summary>
29
                /// <remarks>
30
                /// System variable ANGDIR.
31
                /// </remarks>
32
                [CadSystemVariable("$ANGDIR", 70)]
33
                public AngularDirection AngularDirection { get; set; } = AngularDirection.ClockWise;
1,195✔
34

35
                /// <summary>
36
                /// Sets units for angles.
37
                /// </summary>
38
                /// <remarks>
39
                /// System variable AUNITS.
40
                /// </remarks>
41
                [CadSystemVariable("$AUNITS", 70)]
42
                public AngularUnitFormat AngularUnit { get; set; } = AngularUnitFormat.DecimalDegrees;
1,195✔
43

44
                /// <summary>
45
                /// Sets the display precision for angular units and coordinates.
46
                /// </summary>
47
                /// <remarks>
48
                /// System variable AUPREC.
49
                /// </remarks>
50
                [CadSystemVariable("$AUPREC", 70)]
51
                public short AngularUnitPrecision
52
                {
53
                        get
54
                        {
120✔
55
                                return this._angularUnitPrecision;
120✔
56
                        }
120✔
57
                        set
58
                        {
434✔
59
                                ObjectExtensions.InRange(value, 0, 8, "AUPREC valid values are from 0 to 8");
434✔
60
                                this._angularUnitPrecision = value;
434✔
61
                        }
434✔
62
                }
63

64
                /// <summary>
65
                /// Arrow block name for leaders
66
                /// </summary>
67
                /// <remarks>
68
                /// System variable DIMLDRBLK
69
                /// </remarks>
70
                [CadSystemVariable("$DIMLDRBLK", 1)]
71
                public string ArrowBlockName { get; set; } = string.Empty;
859✔
72

73
                /// <summary>
74
                /// </summary>
75
                /// <remarks>
76
                /// System variable DIMASO <br/>
77
                /// Obsolete; see DIMASSOC
78
                /// </remarks>
79
                [CadSystemVariable("$DIMASO", 70)]
80
                public bool AssociatedDimensions { get; set; } = true;
1,093✔
81

82
                /// <summary>
83
                /// Controls display of attributes.
84
                /// </summary>
85
                /// <remarks>
86
                /// System variable ATTMODE.
87
                /// </remarks>
88
                [CadSystemVariable("$ATTMODE", 70)]
89
                public AttributeVisibilityMode AttributeVisibility { get; set; } = AttributeVisibilityMode.Normal;
1,195✔
90

91
                /// <summary>
92
                /// System variable BLIPMODE        ??
93
                /// </summary>
94
                [CadSystemVariable("$BLIPMODE", 70)]
95
                public bool BlipMode { get; set; }
66✔
96

97
                /// <remarks>
98
                /// System variable CAMERADISPLAY
99
                /// </remarks>
100
                [CadSystemVariable("$CAMERADISPLAY", 290)]
101
                public bool CameraDisplayObjects { get; set; }
257✔
102

103
                /// <remarks>
104
                /// System variable CAMERAHEIGHT
105
                /// </remarks>
106
                [CadSystemVariable("$CAMERAHEIGHT", 40)]
107
                public double CameraHeight { get; set; }
257✔
108

109
                /// <summary>
110
                /// Sets the chamfer angle when CHAMMODE is set to 1.
111
                /// </summary>
112
                /// <remarks>
113
                /// System variable CHAMFERD.
114
                /// </remarks>
115
                [CadSystemVariable("$CHAMFERD", 40)]
116
                public double ChamferAngle { get; set; } = 0.0d;
1,057✔
117

118
                /// <summary>
119
                /// Sets the first chamfer distance when CHAMMODE is set to 0.
120
                /// </summary>
121
                /// <remarks>
122
                /// System variable CHAMFERA.
123
                /// </remarks>
124
                [CadSystemVariable("$CHAMFERA", 40)]
125
                public double ChamferDistance1 { get; set; } = 0.0d;
1,093✔
126

127
                /// <summary>
128
                /// Sets the second chamfer distance when CHAMMODE is set to 0.
129
                /// </summary>
130
                /// <remarks>
131
                /// System variable CHAMFERB.
132
                /// </remarks>
133
                [CadSystemVariable("$CHAMFERB", 40)]
134
                public double ChamferDistance2 { get; set; } = 0.0d;
1,093✔
135

136
                /// <summary>
137
                /// Sets the chamfer length when CHAMMODE is set to 1.
138
                /// </summary>
139
                /// <remarks>
140
                /// System variable CHAMFERC.
141
                /// </remarks>
142
                [CadSystemVariable("$CHAMFERC", 40)]
143
                public double ChamferLength { get; set; } = 0.0d;
1,057✔
144

145
                /// <summary>
146
                /// Drawing code page.
147
                /// </summary>
148
                /// <remarks>
149
                /// System variable DWGCODEPAGE
150
                /// </remarks>
151
                [CadSystemVariable("$DWGCODEPAGE", 3)]
152
                public string CodePage { get; set; } = "ANSI_1252";
1,217✔
153

154
                /// <summary>
155
                /// Local date/time of drawing creation (see Special Handling of Date/Time Variables).
156
                /// </summary>
157
                /// <remarks>
158
                /// System variable TDCREATE.
159
                /// </remarks>
160
                [CadSystemVariable("$TDCREATE", 40)]
161
                public DateTime CreateDateTime { get; set; } = DateTime.Now;
1,217✔
162

163
                /// <summary>
164
                /// Controls the ellipse type created with ELLIPSE.
165
                /// </summary>
166
                /// <remarks>
167
                /// System variable PELLIPSE.
168
                /// </remarks>
169
                [CadSystemVariable("$PELLIPSE", 70)]
170
                public bool CreateEllipseAsPolyline { get; set; } = false;
839✔
171

172
                /// <summary>
173
                /// Current entity color number.
174
                /// </summary>
175
                /// <remarks>
176
                /// System variable CECOLOR.
177
                /// </remarks>
178
                [CadSystemVariable("$CECOLOR", 62)]
179
                public Color CurrentEntityColor { get; set; } = Color.ByLayer;
1,200✔
180

181
                /// <summary>
182
                /// Current entity linetype scale.
183
                /// </summary>
184
                /// <remarks>
185
                /// System variable CELTSCALE.
186
                /// </remarks>
187
                [CadSystemVariable("$CELTSCALE", 40)]
188
                public double CurrentEntityLinetypeScale { get; set; } = 1.0d;
1,159✔
189

190
                /// <summary>
191
                /// Line weight of new objects
192
                /// </summary>
193
                /// <remarks>
194
                /// System variable CELWEIGHT
195
                /// </remarks>
196
                [CadSystemVariable("$CELWEIGHT", 370)]
197
                public LineweightType CurrentEntityLineWeight { get; set; } = LineweightType.ByLayer;
1,129✔
198

199
                /// <summary>
200
                /// Plot style type of new objects
201
                /// </summary>
202
                /// <remarks>
203
                /// System variable CEPSNTYPE
204
                /// </remarks>
205
                [CadSystemVariable("$CEPSNTYPE", 380)]
206
                public EntityPlotStyleType CurrentEntityPlotStyle { get; set; }
554✔
207

208
                public Layer CurrentLayer
209
                {
210
                        get
211
                        {
61✔
212
                                if (this.Document == null)
61✔
213
                                {
5✔
214
                                        return this._currentLayer;
5✔
215
                                }
216
                                else
217
                                {
56✔
218
                                        return this.Document.Layers[this.CurrentLayerName];
56✔
219
                                }
220
                        }
61✔
221
                        private set
NEW
222
                        {
×
NEW
223
                                this._currentLayer = value;
×
NEW
224
                        }
×
225
                }
226

227
                /// <summary>
228
                /// Sets the current layer.
229
                /// </summary>
230
                /// <remarks>
231
                /// System variable CLAYER
232
                /// </remarks>
233
                [CadSystemVariable("$CLAYER", true, 8)]
234
                public string CurrentLayerName
235
                {
236
                        get { return this._currentLayer.Name; }
510✔
237
                        set
238
                        {
413✔
239
                                if (this.Document != null)
413✔
240
                                {
147✔
241
                                        this._currentLayer = this.Document.Layers[value];
147✔
242
                                }
147✔
243
                                else
244
                                {
266✔
245
                                        this._currentLayer = new Layer(value);
266✔
246
                                }
266✔
247
                        }
413✔
248
                }
249

250
                public LineType CurrentLineType
251
                {
252
                        get
253
                        {
51✔
254
                                if (this.Document == null)
51!
NEW
255
                                {
×
NEW
256
                                        return this._currentLineType;
×
257
                                }
258
                                else
259
                                {
51✔
260
                                        return this.Document.LineTypes[this.CurrentLineTypeName];
51✔
261
                                }
262
                        }
51✔
263
                        private set
NEW
264
                        {
×
NEW
265
                                _currentLineType = value;
×
NEW
266
                        }
×
267
                }
268

269
                /// <summary>
270
                /// Sets the linetype of new objects.
271
                /// </summary>
272
                /// <remarks>
273
                /// System variable CELTYPE.
274
                /// </remarks>
275
                [CadSystemVariable("$CELTYPE", true, 6)]
276
                public string CurrentLineTypeName
277
                {
278
                        get { return this._currentLineType.Name; }
486✔
279
                        set
280
                        {
413✔
281
                                if (this.Document != null)
413✔
282
                                {
147✔
283
                                        this._currentLineType = this.Document.LineTypes[value];
147✔
284
                                }
147✔
285
                                else
286
                                {
266✔
287
                                        this._currentLineType = new LineType(value);
266✔
288
                                }
266✔
289
                        }
413✔
290
                }
291

292
                public MLineStyle CurrentMLineStyle
293
                {
294
                        get
NEW
295
                        {
×
NEW
296
                                if (this.Document == null)
×
NEW
297
                                {
×
NEW
298
                                        return this._currentMLineStyle;
×
299
                                }
300
                                else
NEW
301
                                {
×
NEW
302
                                        return this.Document.MLineStyles[this.CurrentMultiLineStyleName];
×
303
                                }
NEW
304
                        }
×
305
                        private set
NEW
306
                        {
×
NEW
307
                                this._currentMLineStyle = value;
×
NEW
308
                        }
×
309
                }
310

311
                /// <summary>
312
                /// Current multiline justification.
313
                /// </summary>
314
                /// <remarks>
315
                /// System variable CMLJUST.
316
                /// </remarks>
317
                [CadSystemVariable("$CMLJUST", 70)]
318
                public VerticalAlignmentType CurrentMultilineJustification { get; set; } = VerticalAlignmentType.Top;
1,159✔
319

320
                /// <summary>
321
                /// Current multiline scale.
322
                /// </summary>
323
                /// <remarks>
324
                /// System variable CMLSCALE.
325
                /// </remarks>
326
                [CadSystemVariable("$CMLSCALE", 40)]
327
                public double CurrentMultilineScale { get; set; } = 20.0d;
1,159✔
328

329
                /// <summary>
330
                /// Current multiline style name.
331
                /// </summary>
332
                /// <remarks>
333
                /// System variable CMLSTYLE.
334
                /// </remarks>
335
                [CadSystemVariable("$CMLSTYLE", true, 2)]
336
                public string CurrentMultiLineStyleName
337
                {
338
                        get { return this._currentMLineStyle.Name; }
270✔
339
                        set
340
                        {
230✔
341
                                if (this.Document != null)
230!
NEW
342
                                {
×
NEW
343
                                        this._currentMLineStyle = this.Document.MLineStyles[value];
×
NEW
344
                                }
×
345
                                else
346
                                {
230✔
347
                                        this._currentMLineStyle = new MLineStyle(value);
230✔
348
                                }
230✔
349
                        }
230✔
350
                }
351

352
                public TextStyle CurrentTextStyle
353
                {
354
                        get
355
                        {
56✔
356
                                if (this.Document == null)
56!
NEW
357
                                {
×
NEW
358
                                        return this._currentTextStyle;
×
359
                                }
360
                                else
361
                                {
56✔
362
                                        return this.Document.TextStyles[this.TextStyleName];
56✔
363
                                }
364
                        }
56✔
365
                        private set
NEW
366
                        {
×
NEW
367
                                this._currentTextStyle = value;
×
NEW
368
                        }
×
369
                }
370

371
                /// <remarks>
372
                /// System variable DGNFRAME
373
                /// </remarks>
374
                [CadSystemVariable("$DGNFRAME", 280)]
375
                public char DgnUnderlayFramesVisibility { get; set; }
257✔
376

377
                /// <summary>
378
                /// Alternate dimensioning suffix
379
                /// </summary>
380
                /// <remarks>
381
                /// System variable DIMAPOST
382
                /// </remarks>
383
                [CadSystemVariable("$DIMAPOST", 1)]
384
                public string DimensionAlternateDimensioningSuffix
385
                {
386
                        get { return this.DimensionStyleOverrides.AlternateDimensioningSuffix; }
90✔
387
                        set
388
                        {
422✔
389
                                this.DimensionStyleOverrides.AlternateDimensioningSuffix = value;
422✔
390
                        }
422✔
391
                }
392

393
                /// <summary>
394
                /// Alternate unit decimal places
395
                /// </summary>
396
                /// <remarks>
397
                /// System variable DIMALTD
398
                /// </remarks>
399
                [CadSystemVariable("$DIMALTD", 70)]
400
                public short DimensionAlternateUnitDecimalPlaces
401
                {
402
                        get { return this.DimensionStyleOverrides.AlternateUnitDecimalPlaces; }
90✔
403
                        set
404
                        {
422✔
405
                                this.DimensionStyleOverrides.AlternateUnitDecimalPlaces = value;
422✔
406
                        }
422✔
407
                }
408

409
                /// <summary>
410
                /// Alternate unit dimensioning performed if nonzero
411
                /// </summary>
412
                /// <remarks>
413
                /// System variable DIMALT
414
                /// </remarks>
415
                [CadSystemVariable("$DIMALT", 70)]
416
                public bool DimensionAlternateUnitDimensioning
417
                {
418
                        get { return this.DimensionStyleOverrides.AlternateUnitDimensioning; }
90✔
419
                        set
420
                        {
422✔
421
                                this.DimensionStyleOverrides.AlternateUnitDimensioning = value;
422✔
422
                        }
422✔
423
                }
424

425
                /// <summary>
426
                /// Units format for alternate units of all dimension style family members except angular
427
                /// </summary>
428
                /// <remarks>
429
                /// System variable DIMALTU
430
                /// </remarks>
431
                [CadSystemVariable("$DIMALTU", 70)]
432
                public LinearUnitFormat DimensionAlternateUnitFormat
433
                {
434
                        get { return this.DimensionStyleOverrides.AlternateUnitFormat; }
90✔
435
                        set
436
                        {
386✔
437
                                this.DimensionStyleOverrides.AlternateUnitFormat = value;
386✔
438
                        }
386✔
439
                }
440

441
                /// <summary>
442
                /// Determines rounding of alternate units
443
                /// </summary>
444
                /// <remarks>
445
                /// System variable DIMALTRND
446
                /// </remarks>
447
                [CadSystemVariable("$DIMALTRND", 40)]
448
                public double DimensionAlternateUnitRounding
449
                {
450
                        get { return this.DimensionStyleOverrides.AlternateUnitRounding; }
75✔
451
                        set
452
                        {
361✔
453
                                this.DimensionStyleOverrides.AlternateUnitRounding = value;
361✔
454
                        }
361✔
455
                }
456

457
                /// <summary>
458
                /// Alternate unit scale factor
459
                /// </summary>
460
                /// <remarks>
461
                /// System variable DIMALTF
462
                /// </remarks>
463
                [CadSystemVariable("$DIMALTF", 40)]
464
                public double DimensionAlternateUnitScaleFactor
465
                {
466
                        get { return this.DimensionStyleOverrides.AlternateUnitScaleFactor; }
90✔
467
                        set
468
                        {
422✔
469
                                this.DimensionStyleOverrides.AlternateUnitScaleFactor = value;
422✔
470
                        }
422✔
471
                }
472

473
                /// <summary>
474
                /// Number of decimal places for tolerance values of an alternate units dimension
475
                /// </summary>
476
                /// <remarks>
477
                /// System variable DIMALTTD
478
                /// </remarks>
479
                [CadSystemVariable("$DIMALTTD", 70)]
480
                public short DimensionAlternateUnitToleranceDecimalPlaces
481
                {
482
                        get { return this.DimensionStyleOverrides.AlternateUnitToleranceDecimalPlaces; }
90✔
483
                        set
484
                        {
386✔
485
                                this.DimensionStyleOverrides.AlternateUnitToleranceDecimalPlaces = value;
386✔
486
                        }
386✔
487
                }
488

489
                /// <summary>
490
                /// Controls suppression of zeros for alternate tolerance values
491
                /// </summary>
492
                /// <remarks>
493
                /// System variable DIMALTTZ
494
                /// </remarks>
495
                [CadSystemVariable("$DIMALTTZ", 70)]
496
                public ZeroHandling DimensionAlternateUnitToleranceZeroHandling
497
                {
498
                        get { return this.DimensionStyleOverrides.AlternateUnitToleranceZeroHandling; }
90✔
499
                        set
500
                        {
386✔
501
                                this.DimensionStyleOverrides.AlternateUnitToleranceZeroHandling = value;
386✔
502
                        }
386✔
503
                }
504

505
                /// <summary>
506
                /// Controls suppression of zeros for alternate unit dimension values
507
                /// </summary>
508
                /// <remarks>
509
                /// System variable DIMALTZ
510
                /// </remarks>
511
                [CadSystemVariable("$DIMALTZ", 70)]
512
                public ZeroHandling DimensionAlternateUnitZeroHandling
513
                {
514
                        get { return this.DimensionStyleOverrides.AlternateUnitZeroHandling; }
90✔
515
                        set
516
                        {
386✔
517
                                this.DimensionStyleOverrides.AlternateUnitZeroHandling = value;
386✔
518
                        }
386✔
519
                }
520

521
                /// <summary>
522
                /// Undocumented
523
                /// </summary>
524
                /// <remarks>
525
                /// System variable DIMALTMZF
526
                /// </remarks>
527
                [CadSystemVariable("$DIMALTMZF", 40)]
528
                public double DimensionAltMzf
529
                {
530
                        get { return this.DimensionStyleOverrides.AltMzf; }
45✔
531
                        set
532
                        {
74✔
533
                                this.DimensionStyleOverrides.AltMzf = value;
74✔
534
                        }
74✔
535
                }
536

537
                /// <summary>
538
                /// Undocumented
539
                /// </summary>
540
                /// <remarks>
541
                /// System variable DIMALTMZS
542
                /// </remarks>
543
                [CadSystemVariable("$DIMALTMZS", 6)]
544
                public string DimensionAltMzs
545
                {
546
                        get { return this.DimensionStyleOverrides.AltMzs; }
45✔
547
                        set
548
                        {
74✔
549
                                this.DimensionStyleOverrides.AltMzs = value;
74✔
550
                        }
74✔
551
                }
552

553
                /// <summary>
554
                /// Number of precision places displayed in angular dimensions
555
                /// </summary>
556
                /// <remarks>
557
                /// System variable DIMADEC
558
                /// </remarks>
559
                [CadSystemVariable("$DIMADEC", 70)]
560
                public short DimensionAngularDimensionDecimalPlaces
561
                {
562
                        get { return this.DimensionStyleOverrides.AngularDimensionDecimalPlaces; }
90✔
563
                        set
564
                        {
386✔
565
                                this.DimensionStyleOverrides.AngularDimensionDecimalPlaces = value;
386✔
566
                        }
386✔
567
                }
568

569
                /// <summary>
570
                /// Angle format for angular dimensions
571
                /// </summary>
572
                /// <remarks>
573
                /// System variable DIMAUNIT
574
                /// </remarks>
575
                [CadSystemVariable("$DIMAUNIT", 70)]
576
                public AngularUnitFormat DimensionAngularUnit
577
                {
578
                        get { return this.DimensionStyleOverrides.AngularUnit; }
75✔
579
                        set
580
                        {
361✔
581
                                this.DimensionStyleOverrides.AngularUnit = value;
361✔
582
                        }
361✔
583
                }
584

585
                /// <summary>
586
                /// Controls suppression of zeros for angular dimensions
587
                /// </summary>
588
                /// <remarks>
589
                /// System variable DIMAZIN
590
                /// </remarks>
591
                [CadSystemVariable("$DIMAZIN", 70)]
592
                public ZeroHandling DimensionAngularZeroHandling
593
                {
594
                        get { return this.DimensionStyleOverrides.AngularZeroHandling; }
75✔
595
                        set
596
                        {
361✔
597
                                this.DimensionStyleOverrides.AngularZeroHandling = value;
361✔
598
                        }
361✔
599
                }
600

601
                /// <summary>
602
                /// Undocumented
603
                /// </summary>
604
                /// <remarks>
605
                /// System variable DIMARCSYM
606
                /// </remarks>
607
                [CadSystemVariable("$DIMARCSYM", 70)]
608
                public ArcLengthSymbolPosition DimensionArcLengthSymbolPosition
609
                {
610
                        get { return this.DimensionStyleOverrides.ArcLengthSymbolPosition; }
48✔
611
                        set
612
                        {
241✔
613
                                this.DimensionStyleOverrides.ArcLengthSymbolPosition = value;
241✔
614
                        }
241✔
615
                }
616

617
                /// <summary>
618
                /// Dimensioning arrow size
619
                /// </summary>
620
                /// <remarks>
621
                /// System variable DIMASZ
622
                /// </remarks>
623
                [CadSystemVariable("$DIMASZ", 40)]
624
                public double DimensionArrowSize
625
                {
626
                        get { return this.DimensionStyleOverrides.ArrowSize; }
90✔
627
                        set
628
                        {
422✔
629
                                this.DimensionStyleOverrides.ArrowSize = value;
422✔
630
                        }
422✔
631
                }
632

633
                /// <summary>
634
                /// Controls the associativity of dimension objects
635
                /// </summary>
636
                /// <remarks>
637
                /// System variable DIMASSOC
638
                /// </remarks>
639
                [CadSystemVariable("$DIMASSOC", 280)]
640
                public DimensionAssociation DimensionAssociativity { get; set; } = DimensionAssociation.CreateExplodedDimensions;
963✔
641

642
                /// <summary>
643
                /// Arrow block name
644
                /// </summary>
645
                /// <remarks>
646
                /// System variable DIMBLK
647
                /// </remarks>
648
                [CadSystemVariable("$DIMBLK", 1)]
649
                public string DimensionBlockName { get; set; } = string.Empty;
925✔
650

651
                /// <summary>
652
                /// First arrow block name
653
                /// </summary>
654
                /// <remarks>
655
                /// System variable DIMBLK1
656
                /// </remarks>
657
                [CadSystemVariable("$DIMBLK1", 1)]
658
                public string DimensionBlockNameFirst { get; set; }
284✔
659

660
                /// <summary>
661
                /// Second arrow block name
662
                /// </summary>
663
                /// <remarks>
664
                /// System variable DIMBLK2
665
                /// </remarks>
666
                [CadSystemVariable("$DIMBLK2", 1)]
667
                public string DimensionBlockNameSecond { get; set; }
284✔
668

669
                /// <summary>
670
                /// Size of center mark/lines
671
                /// </summary>
672
                /// <remarks>
673
                /// System variable DIMCEN
674
                /// </remarks>
675
                [CadSystemVariable("$DIMCEN", 40)]
676
                public double DimensionCenterMarkSize
677
                {
678
                        get { return this.DimensionStyleOverrides.CenterMarkSize; }
90✔
679
                        set
680
                        {
422✔
681
                                this.DimensionStyleOverrides.CenterMarkSize = value;
422✔
682
                        }
422✔
683
                }
684

685
                /// <summary>
686
                /// Cursor functionality for user-positioned text
687
                /// </summary>
688
                /// <remarks>
689
                /// System variable DIMUPT
690
                /// </remarks>
691
                [CadSystemVariable("$DIMUPT", 70)]
692
                public bool DimensionCursorUpdate
693
                {
694
                        get { return this.DimensionStyleOverrides.CursorUpdate; }
90✔
695
                        set
696
                        {
386✔
697
                                this.DimensionStyleOverrides.CursorUpdate = value;
386✔
698
                        }
386✔
699
                }
700

701
                /// <summary>
702
                /// Number of decimal places for the tolerance values of a primary units dimension
703
                /// </summary>
704
                /// <remarks>
705
                /// System variable DIMDEC
706
                /// </remarks>
707
                [CadSystemVariable("$DIMDEC", 70)]
708
                public short DimensionDecimalPlaces
709
                {
710
                        get { return this.DimensionStyleOverrides.DecimalPlaces; }
90✔
711
                        set
712
                        {
386✔
713
                                this.DimensionStyleOverrides.DecimalPlaces = value;
386✔
714
                        }
386✔
715
                }
716

717
                /// <summary>
718
                /// Single-character decimal separator used when creating dimensions whose unit format is decimal
719
                /// </summary>
720
                /// <remarks>
721
                /// System variable DIMLUNIT
722
                /// </remarks>
723
                [CadSystemVariable("$DIMDSEP", 70)]
724
                public char DimensionDecimalSeparator
725
                {
726
                        get { return this.DimensionStyleOverrides.DecimalSeparator; }
75✔
727
                        set
728
                        {
361✔
729
                                this.DimensionStyleOverrides.DecimalSeparator = value;
361✔
730
                        }
361✔
731
                }
732

733
                /// <summary>
734
                /// Controls dimension text and arrow placement when space is not sufficient to place both within the extension lines
735
                /// </summary>
736
                /// <remarks>
737
                /// System variable DIMATFIT
738
                /// </remarks>
739
                [CadSystemVariable("$DIMATFIT", 70)]
740
                public TextArrowFitType DimensionDimensionTextArrowFit
741
                {
742
                        get { return this.DimensionStyleOverrides.DimensionTextArrowFit; }
75✔
743
                        set
744
                        {
361✔
745
                                this.DimensionStyleOverrides.DimensionTextArrowFit = value;
361✔
746
                        }
361✔
747
                }
748

749
                /// <summary>
750
                /// Dimension extension line color
751
                /// </summary>
752
                /// <remarks>
753
                /// System variable DIMCLRE
754
                /// </remarks>
755
                [CadSystemVariable("$DIMCLRE", 70)]
756
                public Color DimensionExtensionLineColor
757
                {
758
                        get { return this.DimensionStyleOverrides.ExtensionLineColor; }
90✔
759
                        set
760
                        {
422✔
761
                                this.DimensionStyleOverrides.ExtensionLineColor = value;
422✔
762
                        }
422✔
763
                }
764

765
                /// <summary>
766
                /// Extension line extension
767
                /// </summary>
768
                /// <remarks>
769
                /// System variable DIMEXE
770
                /// </remarks>
771
                [CadSystemVariable("$DIMEXE", 40)]
772
                public double DimensionExtensionLineExtension
773
                {
774
                        get { return this.DimensionStyleOverrides.ExtensionLineExtension; }
90✔
775
                        set
776
                        {
422✔
777
                                this.DimensionStyleOverrides.ExtensionLineExtension = value;
422✔
778
                        }
422✔
779
                }
780

781
                /// <summary>
782
                /// Extension line offset
783
                /// </summary>
784
                /// <remarks>
785
                /// System variable DIMEXO
786
                /// </remarks>
787
                [CadSystemVariable("$DIMEXO", 40)]
788
                public double DimensionExtensionLineOffset
789
                {
790
                        get { return this.DimensionStyleOverrides.ExtensionLineOffset; }
90✔
791
                        set
792
                        {
422✔
793
                                this.DimensionStyleOverrides.ExtensionLineOffset = value;
422✔
794
                        }
422✔
795
                }
796

797
                /// <remarks>
798
                /// System variable DIMFIT
799
                /// </remarks>
800
                [CadSystemVariable("$DIMFIT", 70)]
801
                public short DimensionFit
802
                {
803
                        get { return this.DimensionStyleOverrides.DimensionFit; }
15✔
804
                        set
805
                        {
25✔
806
                                this.DimensionStyleOverrides.DimensionFit = value;
25✔
807
                        }
25✔
808
                }
809

810
                /// <summary>
811
                /// Undocumented
812
                /// </summary>
813
                /// <remarks>
814
                /// System variable DIMFXL
815
                /// </remarks>
816
                [CadSystemVariable("$DIMFXL", 40)]
817
                public double DimensionFixedExtensionLineLength
818
                {
819
                        get { return this.DimensionStyleOverrides.FixedExtensionLineLength; }
48✔
820
                        set
821
                        {
241✔
822
                                this.DimensionStyleOverrides.FixedExtensionLineLength = value;
241✔
823
                        }
241✔
824
                }
825

826
                /// <summary>
827
                /// Undocumented
828
                /// </summary>
829
                /// <remarks>
830
                /// System variable DIMFRAC
831
                /// </remarks>
832
                [CadSystemVariable("$DIMFRAC", 70)]
833
                public FractionFormat DimensionFractionFormat
834
                {
835
                        get { return this.DimensionStyleOverrides.FractionFormat; }
75✔
836
                        set
837
                        {
361✔
838
                                this.DimensionStyleOverrides.FractionFormat = value;
361✔
839
                        }
361✔
840
                }
841

842
                /// <summary>
843
                /// Vertical justification for tolerance values
844
                /// </summary>
845
                /// <remarks>
846
                /// System variable DIMTOL
847
                /// </remarks>
848
                [CadSystemVariable("$DIMTOL", 70)]
849
                public bool DimensionGenerateTolerances
850
                {
851
                        get { return this.DimensionStyleOverrides.GenerateTolerances; }
90✔
852
                        set
853
                        {
422✔
854
                                this.DimensionStyleOverrides.GenerateTolerances = value;
422✔
855
                        }
422✔
856
                }
857

858
                /// <summary>
859
                /// Undocumented
860
                /// </summary>
861
                /// <remarks>
862
                /// System variable DIMFXLON
863
                /// </remarks>
864
                [CadSystemVariable("$DIMFXLON", 70)]
865
                public bool DimensionIsExtensionLineLengthFixed
866
                {
867
                        get { return this.DimensionStyleOverrides.IsExtensionLineLengthFixed; }
48✔
868
                        set
869
                        {
241✔
870
                                this.DimensionStyleOverrides.IsExtensionLineLengthFixed = value;
241✔
871
                        }
241✔
872
                }
873

874
                /// <summary>
875
                /// Undocumented
876
                /// </summary>
877
                /// <remarks>
878
                /// System variable DIMJOGANG
879
                /// </remarks>
880
                [CadSystemVariable("$DIMJOGANG", 40)]
881
                public double DimensionJoggedRadiusDimensionTransverseSegmentAngle
882
                {
883
                        get { return this.DimensionStyleOverrides.JoggedRadiusDimensionTransverseSegmentAngle; }
48✔
884
                        set
885
                        {
241✔
886
                                this.DimensionStyleOverrides.JoggedRadiusDimensionTransverseSegmentAngle = value;
241✔
887
                        }
241✔
888
                }
889

890
                /// <summary>
891
                /// Dimension limits generated if nonzero
892
                /// </summary>
893
                /// <remarks>
894
                /// System variable DIMLIM
895
                /// </remarks>
896
                [CadSystemVariable("$DIMLIM", 70)]
897
                public bool DimensionLimitsGeneration
898
                {
899
                        get { return this.DimensionStyleOverrides.LimitsGeneration; }
90✔
900
                        set
901
                        {
422✔
902
                                this.DimensionStyleOverrides.LimitsGeneration = value;
422✔
903
                        }
422✔
904
                }
905

906
                /// <summary>
907
                /// Linear measurements scale factor
908
                /// </summary>
909
                /// <remarks>
910
                /// System variable DIMLFAC
911
                /// </remarks>
912
                [CadSystemVariable("$DIMLFAC", 40)]
913
                public double DimensionLinearScaleFactor
914
                {
915
                        get { return this.DimensionStyleOverrides.LinearScaleFactor; }
90✔
916
                        set
917
                        {
422✔
918
                                this.DimensionStyleOverrides.LinearScaleFactor = value;
422✔
919
                        }
422✔
920
                }
921

922
                /// <summary>
923
                /// Sets units for all dimension types except Angular
924
                /// </summary>
925
                /// <remarks>
926
                /// System variable DIMLUNIT
927
                /// </remarks>
928
                [CadSystemVariable("$DIMLUNIT", 70)]
929
                public LinearUnitFormat DimensionLinearUnitFormat
930
                {
931
                        get { return this.DimensionStyleOverrides.LinearUnitFormat; }
75✔
932
                        set
933
                        {
361✔
934
                                this.DimensionStyleOverrides.LinearUnitFormat = value;
361✔
935
                        }
361✔
936
                }
937

938
                /// <summary>
939
                /// Dimension line color
940
                /// </summary>
941
                /// <remarks>
942
                /// System variable DIMCLRD
943
                /// </remarks>
944
                [CadSystemVariable("$DIMCLRD", 70)]
945
                public Color DimensionLineColor
946
                {
947
                        get { return this.DimensionStyleOverrides.DimensionLineColor; }
90✔
948
                        set
949
                        {
422✔
950
                                this.DimensionStyleOverrides.DimensionLineColor = value;
422✔
951
                        }
422✔
952
                }
953

954
                /// <summary>
955
                /// Dimension line extension
956
                /// </summary>
957
                /// <remarks>
958
                /// System variable DIMDLE
959
                /// </remarks>
960
                [CadSystemVariable("$DIMDLE", 40)]
961
                public double DimensionLineExtension
962
                {
963
                        get { return this.DimensionStyleOverrides.DimensionLineExtension; }
90✔
964
                        set
965
                        {
422✔
966
                                this.DimensionStyleOverrides.DimensionLineExtension = value;
422✔
967
                        }
422✔
968
                }
969

970
                /// <summary>
971
                /// Undocumented
972
                /// </summary>
973
                /// <remarks>
974
                /// System variable DIMGAP
975
                /// </remarks>
976
                [CadSystemVariable("$DIMGAP", 40)]
977
                public double DimensionLineGap
978
                {
979
                        get { return this.DimensionStyleOverrides.DimensionLineGap; }
90✔
980
                        set
981
                        {
422✔
982
                                this.DimensionStyleOverrides.DimensionLineGap = value;
422✔
983
                        }
422✔
984
                }
985

986
                /// <summary>
987
                /// Dimension line increment
988
                /// </summary>
989
                /// <remarks>
990
                /// System variable DIMDLI
991
                /// </remarks>
992
                [CadSystemVariable("$DIMDLI", 40)]
993
                public double DimensionLineIncrement
994
                {
995
                        get { return this.DimensionStyleOverrides.DimensionLineIncrement; }
90✔
996
                        set
997
                        {
422✔
998
                                this.DimensionStyleOverrides.DimensionLineIncrement = value;
422✔
999
                        }
422✔
1000
                }
1001

1002
                /// <summary>
1003
                /// Undocumented
1004
                /// </summary>
1005
                /// <remarks>
1006
                /// System variable DIMLTYPE
1007
                /// </remarks>
1008
                [CadSystemVariable("$DIMLTYPE", 6)]
1009
                public string DimensionLineType { get; set; } = "ByBlock";
787✔
1010

1011
                /// <summary>
1012
                /// Dimension line lineweight
1013
                /// </summary>
1014
                /// <remarks>
1015
                /// System variable DIMLWD
1016
                /// </remarks>
1017
                [CadSystemVariable("$DIMLWD", 70)]
1018
                public LineweightType DimensionLineWeight
1019
                {
1020
                        get { return this.DimensionStyleOverrides.DimensionLineWeight; }
75✔
1021
                        set
1022
                        {
361✔
1023
                                this.DimensionStyleOverrides.DimensionLineWeight = value;
361✔
1024
                        }
361✔
1025
                }
1026

1027
                /// <summary>
1028
                /// Minus tolerance
1029
                /// </summary>
1030
                /// <remarks>
1031
                /// System variable DIMTM
1032
                /// </remarks>
1033
                [CadSystemVariable("$DIMTM", 40)]
1034
                public double DimensionMinusTolerance
1035
                {
1036
                        get { return this.DimensionStyleOverrides.MinusTolerance; }
90✔
1037
                        set
1038
                        {
422✔
1039
                                this.DimensionStyleOverrides.MinusTolerance = value;
422✔
1040
                        }
422✔
1041
                }
1042

1043
                /// <summary>
1044
                /// Undocumented
1045
                /// </summary>
1046
                /// <remarks>
1047
                /// System variable DIMMZF
1048
                /// </remarks>
1049
                [CadSystemVariable("$DIMMZF", 40)]
1050
                public double DimensionMzf
1051
                {
1052
                        get { return this.DimensionStyleOverrides.Mzf; }
45✔
1053
                        set
1054
                        {
74✔
1055
                                this.DimensionStyleOverrides.Mzf = value;
74✔
1056
                        }
74✔
1057
                }
1058

1059
                /// <summary>
1060
                /// Undocumented
1061
                /// </summary>
1062
                /// <remarks>
1063
                /// System variable DIMMZS
1064
                /// </remarks>
1065
                [CadSystemVariable("$DIMMZS", 6)]
1066
                public string DimensionMzs
1067
                {
1068
                        get { return this.DimensionStyleOverrides.Mzs; }
45✔
1069
                        set
1070
                        {
74✔
1071
                                this.DimensionStyleOverrides.Mzs = value;
74✔
1072
                        }
74✔
1073
                }
1074

1075
                /// <summary>
1076
                /// Plus tolerance
1077
                /// </summary>
1078
                /// <remarks>
1079
                /// System variable DIMTP
1080
                /// </remarks>
1081
                [CadSystemVariable("$DIMTP", 40)]
1082
                public double DimensionPlusTolerance
1083
                {
1084
                        get { return this.DimensionStyleOverrides.PlusTolerance; }
90✔
1085
                        set
1086
                        {
422✔
1087
                                this.DimensionStyleOverrides.PlusTolerance = value;
422✔
1088
                        }
422✔
1089
                }
1090

1091
                /// <summary>
1092
                /// Undocumented
1093
                /// </summary>
1094
                /// <remarks>
1095
                /// System variable DIMPOST
1096
                /// </remarks>
1097
                [CadSystemVariable("$DIMPOST", 1)]
1098
                public string DimensionPostFix
1099
                {
1100
                        get { return this.DimensionStyleOverrides.PostFix; }
90✔
1101
                        set
1102
                        {
422✔
1103
                                this.DimensionStyleOverrides.PostFix = value;
422✔
1104
                        }
422✔
1105
                }
1106

1107
                /// <summary>
1108
                /// Rounding value for dimension distances
1109
                /// </summary>
1110
                /// <remarks>
1111
                /// System variable DIMRND
1112
                /// </remarks>
1113
                [CadSystemVariable("$DIMRND", 40)]
1114
                public double DimensionRounding
1115
                {
1116
                        get { return this.DimensionStyleOverrides.Rounding; }
90✔
1117
                        set
1118
                        {
422✔
1119
                                this.DimensionStyleOverrides.Rounding = value;
422✔
1120
                        }
422✔
1121
                }
1122

1123
                /// <summary>
1124
                /// Overall dimensioning scale factor
1125
                /// </summary>
1126
                /// <remarks>
1127
                /// System variable DIMSCALE
1128
                /// </remarks>
1129
                [CadSystemVariable("$DIMSCALE", 40)]
1130
                public double DimensionScaleFactor
1131
                {
1132
                        get { return this.DimensionStyleOverrides.ScaleFactor; }
90✔
1133
                        set
1134
                        {
422✔
1135
                                this.DimensionStyleOverrides.ScaleFactor = value;
422✔
1136
                        }
422✔
1137
                }
1138

1139
                /// <summary>
1140
                /// Use separate arrow blocks if nonzero
1141
                /// </summary>
1142
                /// <remarks>
1143
                /// System variable DIMSAH
1144
                /// </remarks>
1145
                [CadSystemVariable("$DIMSAH", 70)]
1146
                public bool DimensionSeparateArrowBlocks
1147
                {
1148
                        get { return this.DimensionStyleOverrides.SeparateArrowBlocks; }
90✔
1149
                        set
1150
                        {
422✔
1151
                                this.DimensionStyleOverrides.SeparateArrowBlocks = value;
422✔
1152
                        }
422✔
1153
                }
1154

1155
                public DimensionStyle DimensionStyleOverrides
1156
                {
1157
                        get
1158
                        {
27,731✔
1159
                                if (this.Document == null)
27,731✔
1160
                                {
25,795✔
1161
                                        return this._dimensionStyleOverrides;
25,795✔
1162
                                }
1163
                                else
1164
                                {
1,936✔
1165
                                        return this.Document.DimensionStyles[this.DimensionStyleOverridesName];
1,936✔
1166
                                }
1167
                        }
27,731✔
1168
                        private set
NEW
1169
                        {
×
NEW
1170
                                this._dimensionStyleOverrides = value;
×
NEW
1171
                        }
×
1172
                }
1173

1174
                /// <summary>
1175
                /// Dimension style name
1176
                /// </summary>
1177
                /// <remarks>
1178
                /// System variable DIMSTYLE
1179
                /// </remarks>
1180
                [CadSystemVariable("$DIMSTYLE", true, 2)]
1181
                public string DimensionStyleOverridesName
1182
                {
1183
                        get { return this._dimensionStyleOverrides.Name; }
6,078✔
1184
                        set
1185
                        {
413✔
1186
                                if (this.Document != null)
413✔
1187
                                {
147✔
1188
                                        this._dimensionStyleOverrides = this.Document.DimensionStyles[value];
147✔
1189
                                }
147✔
1190
                                else
1191
                                {
266✔
1192
                                        this._dimensionStyleOverrides = new DimensionStyle(value);
266✔
1193
                                }
266✔
1194
                        }
413✔
1195
                }
1196

1197
                /// <summary>
1198
                /// Suppression of first extension line
1199
                /// </summary>
1200
                /// <remarks>
1201
                /// System variable DIMSD1
1202
                /// </remarks>
1203
                [CadSystemVariable("$DIMSD1", 70)]
1204
                public bool DimensionSuppressFirstDimensionLine
1205
                {
1206
                        get { return this.DimensionStyleOverrides.SuppressFirstDimensionLine; }
15✔
1207
                        set
1208
                        {
243✔
1209
                                this.DimensionStyleOverrides.SuppressFirstDimensionLine = value;
243✔
1210
                        }
243✔
1211
                }
1212

1213
                /// <summary>
1214
                /// First extension line suppressed if nonzero
1215
                /// </summary>
1216
                /// <remarks>
1217
                /// System variable DIMSE1
1218
                /// </remarks>
1219
                [CadSystemVariable("$DIMSE1", 70)]
1220
                public bool DimensionSuppressFirstExtensionLine
1221
                {
1222
                        get { return this.DimensionStyleOverrides.SuppressFirstExtensionLine; }
165✔
1223
                        set
1224
                        {
565✔
1225
                                this.DimensionStyleOverrides.SuppressFirstExtensionLine = value;
565✔
1226
                        }
565✔
1227
                }
1228

1229
                /// <summary>
1230
                /// Suppress outside-extensions dimension lines if nonzero
1231
                /// </summary>
1232
                /// <remarks>
1233
                /// System variable DIMSOXD
1234
                /// </remarks>
1235
                [CadSystemVariable("$DIMSOXD", 70)]
1236
                public bool DimensionSuppressOutsideExtensions
1237
                {
1238
                        get { return this.DimensionStyleOverrides.SuppressOutsideExtensions; }
90✔
1239
                        set
1240
                        {
422✔
1241
                                this.DimensionStyleOverrides.SuppressOutsideExtensions = value;
422✔
1242
                        }
422✔
1243
                }
1244

1245
                /// <summary>
1246
                /// Suppression of second extension line
1247
                /// </summary>
1248
                /// <remarks>
1249
                /// System variable DIMSD2
1250
                /// </remarks>
1251
                [CadSystemVariable("$DIMSD2", 70)]
1252
                public bool DimensionSuppressSecondDimensionLine
1253
                {
1254
                        get { return this.DimensionStyleOverrides.SuppressSecondDimensionLine; }
15✔
1255
                        set
1256
                        {
243✔
1257
                                this.DimensionStyleOverrides.SuppressSecondDimensionLine = value;
243✔
1258
                        }
243✔
1259
                }
1260

1261
                /// <summary>
1262
                /// Second extension line suppressed if nonzero
1263
                /// </summary>
1264
                /// <remarks>
1265
                /// System variable DIMSE2
1266
                /// </remarks>
1267
                [CadSystemVariable("$DIMSE2", 70)]
1268
                public bool DimensionSuppressSecondExtensionLine
1269
                {
1270
                        get { return this.DimensionStyleOverrides.SuppressSecondExtensionLine; }
165✔
1271
                        set
1272
                        {
565✔
1273
                                this.DimensionStyleOverrides.SuppressSecondExtensionLine = value;
565✔
1274
                        }
565✔
1275
                }
1276

1277
                /// <summary>
1278
                /// Undocumented
1279
                /// </summary>
1280
                /// <remarks>
1281
                /// System variable DIMLTEX1
1282
                /// </remarks>
1283
                [CadSystemVariable("$DIMLTEX1", 6)]
1284
                public string DimensionTex1 { get; set; } = "ByBlock";
787✔
1285

1286
                /// <summary>
1287
                /// Undocumented
1288
                /// </summary>
1289
                /// <remarks>
1290
                /// System variable DIMLTEX2
1291
                /// </remarks>
1292
                [CadSystemVariable("$DIMLTEX2", 6)]
1293
                public string DimensionTex2 { get; set; } = "ByBlock";
787✔
1294

1295
                /// <summary>
1296
                /// Undocumented
1297
                /// </summary>
1298
                /// <remarks>
1299
                /// System variable DIMTFILLCLR
1300
                /// </remarks>
1301
                [CadSystemVariable(DxfReferenceType.Ignored, "$DIMTFILLCLR", 62)]
1302
                public Color DimensionTextBackgroundColor
1303
                {
1304
                        get { return this.DimensionStyleOverrides.TextBackgroundColor; }
48✔
1305
                        set
1306
                        {
241✔
1307
                                this.DimensionStyleOverrides.TextBackgroundColor = value;
241✔
1308
                        }
241✔
1309
                }
1310

1311
                /// <summary>
1312
                /// Undocumented
1313
                /// </summary>
1314
                /// <remarks>
1315
                /// System variable DIMTFILL
1316
                /// </remarks>
1317
                [CadSystemVariable("$DIMTFILL", 70)]
1318
                public DimensionTextBackgroundFillMode DimensionTextBackgroundFillMode
1319
                {
1320
                        get { return this.DimensionStyleOverrides.TextBackgroundFillMode; }
48✔
1321
                        set
1322
                        {
241✔
1323
                                this.DimensionStyleOverrides.TextBackgroundFillMode = value;
241✔
1324
                        }
241✔
1325
                }
1326

1327
                /// <summary>
1328
                /// Dimension text color
1329
                /// </summary>
1330
                /// <remarks>
1331
                /// System variable DIMCLRT
1332
                /// </remarks>
1333
                [CadSystemVariable("$DIMCLRT", 70)]
1334
                public Color DimensionTextColor
1335
                {
1336
                        get { return this.DimensionStyleOverrides.TextColor; }
90✔
1337
                        set
1338
                        {
422✔
1339
                                this.DimensionStyleOverrides.TextColor = value;
422✔
1340
                        }
422✔
1341
                }
1342

1343
                /// <summary>
1344
                /// Undocumented
1345
                /// </summary>
1346
                /// <remarks>
1347
                /// System variable DIMTXTDIRECTION
1348
                /// </remarks>
1349
                [CadSystemVariable("$DIMTXTDIRECTION", 70)]
1350
                public TextDirection DimensionTextDirection
1351
                {
1352
                        get { return this.DimensionStyleOverrides.TextDirection; }
45✔
1353
                        set
1354
                        {
183✔
1355
                                this.DimensionStyleOverrides.TextDirection = value;
183✔
1356
                        }
183✔
1357
                }
1358

1359
                /// <summary>
1360
                /// Dimensioning text height
1361
                /// </summary>
1362
                /// <remarks>
1363
                /// System variable DIMTXT
1364
                /// </remarks>
1365
                [CadSystemVariable("$DIMTXT", 40)]
1366
                public double DimensionTextHeight
1367
                {
1368
                        get { return this.DimensionStyleOverrides.TextHeight; }
90✔
1369
                        set
1370
                        {
422✔
1371
                                this.DimensionStyleOverrides.TextHeight = value;
422✔
1372
                        }
422✔
1373
                }
1374

1375
                /// <summary>
1376
                /// Horizontal dimension text position
1377
                /// </summary>
1378
                /// <remarks>
1379
                /// System variable DIMJUST
1380
                /// </remarks>
1381
                [CadSystemVariable("$DIMJUST", 70)]
1382
                public DimensionTextHorizontalAlignment DimensionTextHorizontalAlignment
1383
                {
1384
                        get { return this.DimensionStyleOverrides.TextHorizontalAlignment; }
90✔
1385
                        set
1386
                        {
386✔
1387
                                this.DimensionStyleOverrides.TextHorizontalAlignment = value;
386✔
1388
                        }
386✔
1389
                }
1390

1391
                /// <summary>
1392
                /// Force text inside extensions if nonzero
1393
                /// </summary>
1394
                /// <remarks>
1395
                /// System variable DIMTIX
1396
                /// </remarks>
1397
                [CadSystemVariable("$DIMTIX", 70)]
1398
                public bool DimensionTextInsideExtensions
1399
                {
1400
                        get { return this.DimensionStyleOverrides.TextInsideExtensions; }
90✔
1401
                        set
1402
                        {
422✔
1403
                                this.DimensionStyleOverrides.TextInsideExtensions = value;
422✔
1404
                        }
422✔
1405
                }
1406

1407
                /// <summary>
1408
                /// Text inside horizontal if nonzero
1409
                /// </summary>
1410
                /// <remarks>
1411
                /// System variable DIMTIH
1412
                /// </remarks>
1413
                [CadSystemVariable("$DIMTIH", 70)]
1414
                public bool DimensionTextInsideHorizontal
1415
                {
1416
                        get { return this.DimensionStyleOverrides.TextInsideHorizontal; }
90✔
1417
                        set
1418
                        {
422✔
1419
                                this.DimensionStyleOverrides.TextInsideHorizontal = value;
422✔
1420
                        }
422✔
1421
                }
1422

1423
                /// <summary>
1424
                /// Dimension text movement rules decimal
1425
                /// </summary>
1426
                /// <remarks>
1427
                /// System variable DIMTMOVE
1428
                /// </remarks>
1429
                [CadSystemVariable("$DIMTMOVE", 70)]
1430
                public TextMovement DimensionTextMovement
1431
                {
1432
                        get { return this.DimensionStyleOverrides.TextMovement; }
75✔
1433
                        set
1434
                        {
361✔
1435
                                this.DimensionStyleOverrides.TextMovement = value;
361✔
1436
                        }
361✔
1437
                }
1438

1439
                /// <summary>
1440
                /// If text is outside the extension lines, dimension lines are forced between the extension lines if nonzero
1441
                /// </summary>
1442
                /// <remarks>
1443
                /// System variable DIMTOFL
1444
                /// </remarks>
1445
                [CadSystemVariable("$DIMTOFL", 70)]
1446
                public bool DimensionTextOutsideExtensions
1447
                {
1448
                        get { return this.DimensionStyleOverrides.TextOutsideExtensions; }
90✔
1449
                        set
1450
                        {
422✔
1451
                                this.DimensionStyleOverrides.TextOutsideExtensions = value;
422✔
1452
                        }
422✔
1453
                }
1454

1455
                /// <summary>
1456
                /// Text outside horizontal if nonzero
1457
                /// </summary>
1458
                /// <remarks>
1459
                /// System variable DIMTOH
1460
                /// </remarks>
1461
                [CadSystemVariable("$DIMTOH", 70)]
1462
                public bool DimensionTextOutsideHorizontal
1463
                {
1464
                        get { return this.DimensionStyleOverrides.TextOutsideHorizontal; }
90✔
1465
                        set
1466
                        {
422✔
1467
                                this.DimensionStyleOverrides.TextOutsideHorizontal = value;
422✔
1468
                        }
422✔
1469
                }
1470

1471
                public TextStyle DimensionTextStyle
1472
                {
1473
                        get
NEW
1474
                        {
×
NEW
1475
                                if (this.Document == null)
×
NEW
1476
                                {
×
NEW
1477
                                        return this._dimensionTextStyle;
×
1478
                                }
1479
                                else
NEW
1480
                                {
×
NEW
1481
                                        return this.Document.TextStyles[this.DimensionTextStyleName];
×
1482
                                }
NEW
1483
                        }
×
1484
                        private set
NEW
1485
                        {
×
NEW
1486
                                this._dimensionTextStyle = value;
×
UNCOV
1487
                        }
×
1488
                }
1489

1490
                /// <summary>
1491
                /// Dimension text style
1492
                /// </summary>
1493
                /// <remarks>
1494
                /// System variable DIMTXSTY
1495
                /// </remarks>
1496
                [CadSystemVariable("$DIMTXSTY", true, 7)]
1497
                public string DimensionTextStyleName
1498
                {
NEW
1499
                        get { return this._dimensionTextStyle.Name; }
×
1500
                        set
1501
                        {
355✔
1502
                                if (this.Document != null)
355✔
1503
                                {
137✔
1504
                                        this._dimensionTextStyle = this.Document.TextStyles[value];
137✔
1505
                                }
137✔
1506
                                else
1507
                                {
218✔
1508
                                        this._dimensionTextStyle = new TextStyle(value);
218✔
1509
                                }
218✔
1510
                        }
355✔
1511
                }
1512

1513
                /// <summary>
1514
                /// Text above dimension line if nonzero
1515
                /// </summary>
1516
                /// <remarks>
1517
                /// System variable DIMTAD
1518
                /// </remarks>
1519
                [CadSystemVariable("$DIMTAD", 70)]
1520
                public DimensionTextVerticalAlignment DimensionTextVerticalAlignment
1521
                {
1522
                        get { return this.DimensionStyleOverrides.TextVerticalAlignment; }
90✔
1523
                        set
1524
                        {
422✔
1525
                                this.DimensionStyleOverrides.TextVerticalAlignment = value;
422✔
1526
                        }
422✔
1527
                }
1528

1529
                /// <summary>
1530
                /// Text vertical position
1531
                /// </summary>
1532
                /// <remarks>
1533
                /// System variable DIMTVP
1534
                /// </remarks>
1535
                [CadSystemVariable("$DIMTVP", 40)]
1536
                public double DimensionTextVerticalPosition
1537
                {
1538
                        get { return this.DimensionStyleOverrides.TextVerticalPosition; }
90✔
1539
                        set
1540
                        {
422✔
1541
                                this.DimensionStyleOverrides.TextVerticalPosition = value;
422✔
1542
                        }
422✔
1543
                }
1544

1545
                /// <summary>
1546
                /// Dimensioning tick size
1547
                /// </summary>
1548
                /// <remarks>
1549
                /// System variable DIMTSZ
1550
                /// </remarks>
1551
                [CadSystemVariable("$DIMTSZ", 40)]
1552
                public double DimensionTickSize
1553
                {
1554
                        get { return this.DimensionStyleOverrides.TickSize; }
90✔
1555
                        set
1556
                        {
422✔
1557
                                this.DimensionStyleOverrides.TickSize = value;
422✔
1558
                        }
422✔
1559
                }
1560

1561
                /// <summary>
1562
                /// Vertical justification for tolerance values
1563
                /// </summary>
1564
                /// <remarks>
1565
                /// System variable DIMTOLJ
1566
                /// </remarks>
1567
                [CadSystemVariable("$DIMTOLJ", 70)]
1568
                public ToleranceAlignment DimensionToleranceAlignment
1569
                {
1570
                        get { return this.DimensionStyleOverrides.ToleranceAlignment; }
90✔
1571
                        set
1572
                        {
386✔
1573
                                this.DimensionStyleOverrides.ToleranceAlignment = value;
386✔
1574
                        }
386✔
1575
                }
1576

1577
                /// <summary>
1578
                /// Number of decimal places to display the tolerance values
1579
                /// </summary>
1580
                /// <remarks>
1581
                /// System variable DIMTDEC
1582
                /// </remarks>
1583
                [CadSystemVariable("$DIMTDEC", 70)]
1584
                public short DimensionToleranceDecimalPlaces
1585
                {
1586
                        get { return this.DimensionStyleOverrides.ToleranceDecimalPlaces; }
90✔
1587
                        set
1588
                        {
386✔
1589
                                this.DimensionStyleOverrides.ToleranceDecimalPlaces = value;
386✔
1590
                        }
386✔
1591
                }
1592

1593
                /// <summary>
1594
                /// Dimension tolerance display scale factor
1595
                /// </summary>
1596
                /// <remarks>
1597
                /// System variable DIMTFAC
1598
                /// </remarks>
1599
                [CadSystemVariable("$DIMTFAC", 40)]
1600
                public double DimensionToleranceScaleFactor
1601
                {
1602
                        get { return this.DimensionStyleOverrides.ToleranceScaleFactor; }
90✔
1603
                        set
1604
                        {
422✔
1605
                                this.DimensionStyleOverrides.ToleranceScaleFactor = value;
422✔
1606
                        }
422✔
1607
                }
1608

1609
                /// <summary>
1610
                /// Controls suppression of zeros for tolerance values
1611
                /// </summary>
1612
                /// <remarks>
1613
                /// System variable DIMTZIN
1614
                /// </remarks>
1615
                [CadSystemVariable("$DIMTZIN", 70)]
1616
                public ZeroHandling DimensionToleranceZeroHandling
1617
                {
1618
                        get { return this.DimensionStyleOverrides.ToleranceZeroHandling; }
90✔
1619
                        set
1620
                        {
386✔
1621
                                this.DimensionStyleOverrides.ToleranceZeroHandling = value;
386✔
1622
                        }
386✔
1623
                }
1624

1625
                /// <summary>
1626
                /// Controls suppression of zeros for alternate unit dimension values
1627
                /// </summary>
1628
                /// <remarks>
1629
                /// System variable DIMUNIT
1630
                /// </remarks>
1631
                [CadSystemVariable("$DIMUNIT", 70)]
1632
                public short DimensionUnit
1633
                {
1634
                        get { return this.DimensionStyleOverrides.DimensionUnit; }
15✔
1635
                        set
1636
                        {
25✔
1637
                                this.DimensionStyleOverrides.DimensionUnit = value;
25✔
1638
                        }
25✔
1639
                }
1640

1641
                /// <summary>
1642
                /// Controls suppression of zeros for primary unit values
1643
                /// </summary>
1644
                /// <remarks>
1645
                /// System variable DIMZIN
1646
                /// </remarks>
1647
                [CadSystemVariable("$DIMZIN", 70)]
1648
                public ZeroHandling DimensionZeroHandling
1649
                {
1650
                        get { return this.DimensionStyleOverrides.ZeroHandling; }
90✔
1651
                        set
1652
                        {
422✔
1653
                                this.DimensionStyleOverrides.ZeroHandling = value;
422✔
1654
                        }
422✔
1655
                }
1656

1657
                /// <remarks>
1658
                /// System variable LIGHTGLYPHDISPLAY
1659
                /// </remarks>
1660
                [CadSystemVariable("$LIGHTGLYPHDISPLAY", 280)]
1661
                public char DisplayLightGlyphs { get; set; }
257✔
1662

1663
                /// <summary>
1664
                /// Controls whether the lineweights of objects are displayed.<br/>
1665
                /// 0 = Lineweight is not displayed<br/>
1666
                /// 1 = Lineweight is displayed
1667
                /// </summary>
1668
                /// <remarks>
1669
                /// System variable LWDISPLAY
1670
                /// </remarks>
1671
                [CadSystemVariable("$LWDISPLAY", 290)]
1672
                public bool DisplayLineWeight { get; set; } = false;
1,129✔
1673

1674
                /// <summary>
1675
                /// Controls display of silhouette edges of 3D solid and surface objects in the Wireframe or 2D Wireframe visual styles.
1676
                /// </summary>
1677
                /// <remarks>
1678
                /// System variable DISPSILH.
1679
                /// </remarks>
1680
                [CadSystemVariable("$DISPSILH", 70)]
1681
                public bool DisplaySilhouetteCurves { get; set; } = false;
1,057✔
1682

1683
                /// <summary>
1684
                /// Document where this header resides
1685
                /// </summary>
1686
                public CadDocument Document { get; internal set; }
33,535✔
1687

1688
                /// <remarks>
1689
                /// System variable LOFTANG1
1690
                /// </remarks>
1691
                [CadSystemVariable("$LOFTANG1", 40)]
1692
                public double DraftAngleFirstCrossSection { get; set; }
257✔
1693

1694
                /// <remarks>
1695
                /// System variable LOFTANG2
1696
                /// </remarks>
1697
                [CadSystemVariable("$LOFTANG2", 40)]
1698
                public double DraftAngleSecondCrossSection { get; set; }
257✔
1699

1700
                /// <remarks>
1701
                /// System variable LOFTMAG1
1702
                /// </remarks>
1703
                [CadSystemVariable("$LOFTMAG1", 40)]
1704
                public double DraftMagnitudeFirstCrossSection { get; set; }
257✔
1705

1706
                /// <remarks>
1707
                /// System variable LOFTMAG2
1708
                /// </remarks>
1709
                [CadSystemVariable("$LOFTMAG2", 40)]
1710
                public double DraftMagnitudeSecondCrossSection { get; set; }
257✔
1711

1712
                /// <remarks>
1713
                /// System variable 3DDWFPREC
1714
                /// </remarks>
1715
                [CadSystemVariable("$3DDWFPREC", 40)]
1716
                public double Dw3DPrecision { get; set; }
257✔
1717

1718
                /// <remarks>
1719
                /// System variable DWFFRAME
1720
                /// </remarks>
1721
                [CadSystemVariable("$DWFFRAME", 280)]
1722
                public char DwgUnderlayFramesVisibility { get; set; }
257✔
1723

1724
                /// <summary>
1725
                /// Current elevation set by ELEV command
1726
                /// </summary>
1727
                /// <remarks>
1728
                /// System variable ELEVATION
1729
                /// </remarks>
1730
                [CadSystemVariable("$ELEVATION", 40)]
1731
                public double Elevation
1732
                {
1733
                        get { return this.ModelSpaceUcs.Elevation; }
90✔
1734
                        set
1735
                        {
422✔
1736
                                this.ModelSpaceUcs.Elevation = value;
422✔
1737
                        }
422✔
1738
                }
1739

1740
                /// <summary>
1741
                /// Line weight end-caps setting for new objects
1742
                /// </summary>
1743
                /// <remarks>
1744
                /// System variable ENDCAPS
1745
                /// </remarks>
1746
                [CadSystemVariable("$ENDCAPS", 280)]
1747
                public short EndCaps { get; set; }
386✔
1748

1749
                /// <summary>
1750
                /// Controls the object sorting methods
1751
                /// </summary>
1752
                /// <remarks>
1753
                /// System variable SORTENTS
1754
                /// </remarks>
1755
                [CadSystemVariable("$SORTENTS", 280)]
1756
                public ObjectSortingFlags EntitySortingFlags { get; set; }
322✔
1757

1758
                /// <summary>
1759
                /// Controls symbol table naming
1760
                /// </summary>
1761
                /// <remarks>
1762
                /// System variable EXTNAMES
1763
                /// </remarks>
1764
                [CadSystemVariable("$EXTNAMES", 290)]
1765
                public bool ExtendedNames { get; set; } = true;
1,129✔
1766

1767
                /// <summary>
1768
                /// Extension line lineweight
1769
                /// </summary>
1770
                /// <remarks>
1771
                /// System variable DIMLWE
1772
                /// </remarks>
1773
                [CadSystemVariable("$DIMLWE", 70)]
1774
                public LineweightType ExtensionLineWeight
1775
                {
1776
                        get { return this.DimensionStyleOverrides.ExtensionLineWeight; }
75✔
1777
                        set
1778
                        {
361✔
1779
                                this.DimensionStyleOverrides.ExtensionLineWeight = value;
361✔
1780
                        }
361✔
1781
                }
1782

1783
                /// <summary>
1784
                /// Controls the visibility of xref clipping boundaries
1785
                /// </summary>
1786
                /// <remarks>
1787
                /// System variable XCLIPFRAME
1788
                /// </remarks>
1789
                [CadSystemVariable("$XCLIPFRAME", 280)] //note: mismatch with docs, code 290
1790
                public byte ExternalReferenceClippingBoundaryType { get; set; }
322✔
1791

1792
                /// <summary>
1793
                /// Adjusts the smoothness of shaded and rendered objects, rendered shadows, and objects with hidden lines removed.
1794
                /// </summary>
1795
                /// <remarks>
1796
                /// System variable FACETRES.
1797
                /// </remarks>
1798
                /// <value>
1799
                /// Valid values are from 0.01 to 10.0.
1800
                /// </value>
1801
                [CadSystemVariable("$FACETRES", 40)]
1802
                public double FacetResolution
1803
                {
1804
                        get
1805
                        {
30✔
1806
                                return this._facetResolution;
30✔
1807
                        }
30✔
1808
                        set
1809
                        {
168✔
1810
                                ObjectExtensions.InRange(value, 0.01, 10, "FACETRES valid values are from 0.01 to 10.0");
168✔
1811
                                this._facetResolution = value;
168✔
1812
                        }
168✔
1813
                }
1814

1815
                /// <summary>
1816
                /// Stores the current fillet radius for 2D objects.
1817
                /// </summary>
1818
                /// <remarks>
1819
                /// System variable FILLETRAD.
1820
                /// </remarks>
1821
                [CadSystemVariable("$FILLETRAD", 40)]
1822
                public double FilletRadius { get; set; } = 0.0d;
1,093✔
1823

1824
                /// <summary>
1825
                /// Specifies whether hatches and fills, 2D solids, and wide polylines are filled in.
1826
                /// </summary>
1827
                /// <remarks>
1828
                /// System variable FILLMODE.
1829
                /// </remarks>
1830
                [CadSystemVariable("$FILLMODE", 70)]
1831
                public bool FillMode { get; set; } = true;
1,093✔
1832

1833
                /// <summary>
1834
                /// Set at creation time, uniquely identifies a particular drawing
1835
                /// </summary>
1836
                /// <remarks>
1837
                /// System variable FINGERPRINTGUID
1838
                /// </remarks>
1839
                [CadSystemVariable("$FINGERPRINTGUID", 2)]
1840
                public string FingerPrintGuid { get; internal set; } = Guid.NewGuid().ToString();
1,027✔
1841

1842
                /// <summary>
1843
                /// Specifies a gap to be displayed where an object is hidden by another object; the value is specified as a percent of one unit and is independent of the zoom level.A haloed line is shortened at the point where it is hidden when HIDE or the Hidden option of SHADEMODE is used
1844
                /// </summary>
1845
                /// <remarks>
1846
                /// System variable HALOGAP
1847
                /// </remarks>
1848
                [CadSystemVariable("$HALOGAP", 280)]
1849
                public byte HaloGapPercentage { get; set; } = 0;
963✔
1850

1851
                /// <summary>
1852
                /// Next available handle.
1853
                /// </summary>
1854
                /// <remarks>
1855
                /// System variable HANDSEED.
1856
                /// </remarks>
1857
                [CadSystemVariable("$HANDSEED", 5)]
1858
                public ulong HandleSeed { get; internal set; } = 0x0;
48,398✔
1859

1860
                /// <summary>
1861
                /// Specifies HIDETEXT system variable
1862
                /// </summary>
1863
                /// <remarks>
1864
                /// System variable HIDETEXT
1865
                /// </remarks>
1866
                [CadSystemVariable("$HIDETEXT", 280)]   //note: mismatch with docs, code 290
1867
                public byte HideText { get; set; }
322✔
1868

1869
                /// <summary>
1870
                /// Path for all relative hyperlinks in the drawing. If null, the drawing path is used
1871
                /// </summary>
1872
                /// <remarks>
1873
                /// System variable HYPERLINKBASE
1874
                /// </remarks>
1875
                [CadSystemVariable("$HYPERLINKBASE", 1)]
1876
                public string HyperLinkBase { get; set; }
386✔
1877

1878
                /// <summary>
1879
                /// Controls whether layer and spatial indexes are created and saved in drawing files
1880
                /// </summary>
1881
                /// <remarks>
1882
                /// System variable INDEXCTL
1883
                /// </remarks>
1884
                [CadSystemVariable("$INDEXCTL", 280)]
1885
                public IndexCreationFlags IndexCreationFlags { get; set; }
322✔
1886

1887
                /// <summary>
1888
                /// Default drawing units for blocks
1889
                /// </summary>
1890
                /// <remarks>
1891
                /// System variable INSUNITS
1892
                /// </remarks>
1893
                [CadSystemVariable("$INSUNITS", 70)]
1894
                public UnitsType InsUnits { get; set; } = UnitsType.Unitless;
1,129✔
1895

1896
                /// <summary>
1897
                /// Represents the ACI color index of the "interference objects" created during the INTERFERE command. Default value is 1
1898
                /// </summary>
1899
                /// <remarks>
1900
                /// System variable INTERFERECOLOR
1901
                /// </remarks>
1902
                [CadSystemVariable("$INTERFERECOLOR", 62)]
1903
                public Color InterfereColor { get; set; } = new Color(1);
1,038✔
1904

1905
                public byte IntersectionDisplay { get; set; }
140✔
1906

1907
                /// <summary>
1908
                /// Line weight joint setting for new objects
1909
                /// </summary>
1910
                /// <remarks>
1911
                /// System variable JOINSTYLE
1912
                /// </remarks>
1913
                [CadSystemVariable("$JOINSTYLE", 280)]
1914
                public short JoinStyle { get; set; }
386✔
1915

1916
                /// <summary>
1917
                /// Displays the name of the last person who modified the file
1918
                /// </summary>
1919
                /// <remarks>
1920
                /// System variable LASTSAVEDBY
1921
                /// </remarks>
1922
                [CadSystemVariable(DxfReferenceType.Ignored, "$LASTSAVEDBY", 3)]
1923
                public string LastSavedBy { get; set; } = "ACadSharp";
823✔
1924

1925
                /// <summary>
1926
                /// Specifies the latitude of the drawing model in decimal format.
1927
                /// </summary>
1928
                /// <remarks>
1929
                /// System variable LATITUDE
1930
                /// </remarks>
1931
                [CadSystemVariable("$LATITUDE", 40)]
1932
                public double Latitude { get; set; } = 37.7950d;
898✔
1933

1934
                /// <remarks>
1935
                /// System variable LENSLENGTH
1936
                /// </remarks>
1937
                [CadSystemVariable("$LENSLENGTH", 40)]
1938
                public double LensLength { get; set; }
257✔
1939

1940
                /// <summary>
1941
                /// Controls whether you can create objects outside the grid limits.
1942
                /// </summary>
1943
                /// <remarks>
1944
                /// System variable LIMCHECK.
1945
                /// </remarks>
1946
                [CadSystemVariable("$LIMCHECK", 70)]
1947
                public bool LimitCheckingOn { get; set; } = false;
1,093✔
1948

1949
                /// <summary>
1950
                /// Sets the linear units format for creating objects.
1951
                /// </summary>
1952
                /// <remarks>
1953
                /// System variable LUNITS.
1954
                /// </remarks>
1955
                [CadSystemVariable("$LUNITS", 70)]
1956
                public LinearUnitFormat LinearUnitFormat { get; set; } = LinearUnitFormat.Decimal;
1,195✔
1957

1958
                /// <summary>
1959
                /// Sets the display precision for linear units and coordinates.
1960
                /// </summary>
1961
                /// <remarks>
1962
                /// System variable LUPREC.
1963
                /// </remarks>
1964
                [CadSystemVariable("$LUPREC", 70)]
1965
                public short LinearUnitPrecision
1966
                {
1967
                        get
1968
                        {
120✔
1969
                                return this._linearUnitPrecision;
120✔
1970
                        }
120✔
1971
                        set
1972
                        {
434✔
1973
                                ObjectExtensions.InRange(value, 0, 8, "LUPREC valid values are from 0 to 8");
434✔
1974
                                this._linearUnitPrecision = value;
434✔
1975
                        }
434✔
1976
                }
1977

1978
                /// <summary>
1979
                /// Sets the global linetype scale factor.
1980
                /// </summary>
1981
                /// <remarks>
1982
                /// System variable LTSCALE.
1983
                /// </remarks>
1984
                [CadSystemVariable("$LTSCALE", 40)]
1985
                public double LineTypeScale { get; set; } = 1.0d;
1,195✔
1986

1987
                /// <remarks>
1988
                /// System variable OLESTARTUP
1989
                /// </remarks>
1990
                //[CadSystemVariable("$OLESTARTUP", 290)]
1991
                public bool LoadOLEObject { get; set; }
168✔
1992

1993
                /// <remarks>
1994
                /// System variable LOFTNORMALS
1995
                /// </remarks>
1996
                [CadSystemVariable("$LOFTNORMALS", 280)]
1997
                public char LoftedObjectNormals { get; set; }
257✔
1998

1999
                /// <summary>
2000
                /// Specifies the longitude of the drawing model in decimal format.
2001
                /// </summary>
2002
                /// <remarks>
2003
                /// System variable LONGITUDE
2004
                /// </remarks>
2005
                [CadSystemVariable("$LONGITUDE", 40)]
2006
                public double Longitude { get; set; } = -122.394d;
898✔
2007

2008
                /// <summary>
2009
                /// Maintenance version number(should be ignored)
2010
                /// </summary>
2011
                /// <remarks>
2012
                /// System variable ACADMAINTVER.
2013
                /// </remarks>
2014
                [CadSystemVariable(DxfReferenceType.Ignored, "$ACADMAINTVER", 70)]
2015
                public short MaintenanceVersion { get; internal set; }
2,180✔
2016

2017
                /// <summary>
2018
                /// Sets the maximum number of viewports that can be active at one time in a layout.
2019
                /// </summary>
2020
                /// <remarks>
2021
                /// System variable MAXACTVP.
2022
                /// </remarks>
2023
                [CadSystemVariable("$MAXACTVP", 70)]
2024
                public short MaxViewportCount { get; set; } = 64;
1,093✔
2025

2026
                /// <summary>
2027
                /// Controls whether the current drawing uses imperial or metric hatch pattern and linetype files.
2028
                /// </summary>
2029
                /// <remarks>
2030
                /// System variable MEASUREMENT
2031
                /// </remarks>
2032
                [CadSystemVariable("$MEASUREMENT", 70)]
2033
                public MeasurementUnits MeasurementUnits { get; set; } = MeasurementUnits.Metric;
859✔
2034

2035
                /// <summary>
2036
                /// Name of menu file.
2037
                /// </summary>
2038
                /// <remarks>
2039
                /// System variable MENU.
2040
                /// </remarks>
2041
                [CadSystemVariable("$MENU", 1)]
2042
                public string MenuFileName { get; set; } = ".";
1,093✔
2043

2044
                /// <summary>
2045
                /// Controls how MIRROR reflects text.
2046
                /// </summary>
2047
                /// <remarks>
2048
                /// System variable MIRRTEXT.
2049
                /// </remarks>
2050
                [CadSystemVariable("$MIRRTEXT", 70)]
2051
                public bool MirrorText { get; set; } = false;
1,195✔
2052

2053
                /// <summary>
2054
                /// X, Y, and Z drawing extents upper-right corner(in WCS)
2055
                /// </summary>
2056
                /// <remarks>
2057
                /// System variable EXTMAX
2058
                /// </remarks>
2059
                [CadSystemVariable("$EXTMAX", 10, 20, 30)]
2060
                public XYZ ModelSpaceExtMax { get; set; }
452✔
2061

2062
                /// <summary>
2063
                /// X, Y, and Z drawing extents lower-left corner (in WCS)
2064
                /// </summary>
2065
                /// <remarks>
2066
                /// System variable EXTMIN
2067
                /// </remarks>
2068
                [CadSystemVariable("$EXTMIN", 10, 20, 30)]
2069
                public XYZ ModelSpaceExtMin { get; set; }
452✔
2070

2071
                /// <summary>
2072
                /// Insertion base set by BASE command(in WCS)
2073
                /// </summary>
2074
                /// <remarks>
2075
                /// System variable INSBASE
2076
                /// </remarks>
2077
                [CadSystemVariable("$INSBASE", 10, 20, 30)]
2078
                public XYZ ModelSpaceInsertionBase { get; set; } = XYZ.Zero;
1,285✔
2079

2080
                /// <summary>
2081
                /// XY drawing limits upper-right corner (in WCS)
2082
                /// </summary>
2083
                /// <remarks>
2084
                /// System variable LIMMAX
2085
                /// </remarks>
2086
                [CadSystemVariable("$LIMMAX", 10, 20)]
2087
                public XY ModelSpaceLimitsMax { get; set; }
452✔
2088

2089
                /// <summary>
2090
                /// XY drawing limits lower-left corner (in WCS)
2091
                /// </summary>
2092
                /// <remarks>
2093
                /// System variable LIMMIN
2094
                /// </remarks>
2095
                [CadSystemVariable("$LIMMIN", 10, 20)]
2096
                public XY ModelSpaceLimitsMin { get; set; }
452✔
2097

2098
                /// <summary>
2099
                /// Origin of current UCS(in WCS)
2100
                /// </summary>
2101
                /// <remarks>
2102
                /// System variable UCSORG
2103
                /// </remarks>
2104
                [CadSystemVariable("$UCSORG", 10, 20, 30)]
2105
                public XYZ ModelSpaceOrigin
2106
                {
2107
                        get { return this.ModelSpaceUcs.Origin; }
90✔
2108
                        set
2109
                        {
422✔
2110
                                this.ModelSpaceUcs.Origin = value;
422✔
2111
                        }
422✔
2112
                }
2113

2114
                /// <summary>
2115
                /// Point which becomes the new UCS origin after changing model space UCS to BACK when PUCSBASE is set to WORLD
2116
                /// </summary>
2117
                /// <remarks>
2118
                /// System variable UCSORGBACK
2119
                /// </remarks>
2120
                [CadSystemVariable("$UCSORGBACK", 10, 20, 30)]
2121
                public XYZ ModelSpaceOrthographicBackDOrigin { get; set; }
386✔
2122

2123
                /// <summary>
2124
                /// Point which becomes the new UCS origin after changing model space UCS to BOTTOM when PUCSBASE is set to WORLD
2125
                /// </summary>
2126
                /// <remarks>
2127
                /// System variable UCSORGBOTTOM
2128
                /// </remarks>
2129
                [CadSystemVariable("$UCSORGBOTTOM", 10, 20, 30)]
2130
                public XYZ ModelSpaceOrthographicBottomDOrigin { get; set; }
386✔
2131

2132
                /// <summary>
2133
                /// Point which becomes the new UCS origin after changing model space UCS to FRONT when PUCSBASE is set to WORLD
2134
                /// </summary>
2135
                /// <remarks>
2136
                /// System variable UCSORGFRONT
2137
                /// </remarks>
2138
                [CadSystemVariable("$UCSORGFRONT", 10, 20, 30)]
2139
                public XYZ ModelSpaceOrthographicFrontDOrigin { get; set; }
386✔
2140

2141
                /// <summary>
2142
                /// Point which becomes the new UCS origin after changing model space UCS to LEFT when PUCSBASE is set to WORLD
2143
                /// </summary>
2144
                /// <remarks>
2145
                /// System variable UCSORGLEFT
2146
                /// </remarks>
2147
                [CadSystemVariable("$UCSORGLEFT", 10, 20, 30)]
2148
                public XYZ ModelSpaceOrthographicLeftDOrigin { get; set; }
386✔
2149

2150
                /// <summary>
2151
                /// Point which becomes the new UCS origin after changing model space UCS to RIGHT when PUCSBASE is set to WORLD
2152
                /// </summary>
2153
                /// <remarks>
2154
                /// System variable UCSORGRIGHT
2155
                /// </remarks>
2156
                [CadSystemVariable("$UCSORGRIGHT", 10, 20, 30)]
2157
                public XYZ ModelSpaceOrthographicRightDOrigin { get; set; }
386✔
2158

2159
                /// <summary>
2160
                /// Point which becomes the new UCS origin after changing model space UCS to TOP when PUCSBASE is set to WORLD
2161
                /// </summary>
2162
                /// <remarks>
2163
                /// System variable UCSORGTOP
2164
                /// </remarks>
2165
                [CadSystemVariable("$UCSORGTOP", 10, 20, 30)]
2166
                public XYZ ModelSpaceOrthographicTopDOrigin { get; set; }
386✔
2167

2168
                //TODO: How header UCS work??
2169
                public UCS ModelSpaceUcs { get; private set; } = new UCS();
2,479✔
2170

2171
                public UCS ModelSpaceUcsBase { get; private set; } = new UCS();
641✔
2172

2173
                /// <summary>
2174
                /// Direction of the current UCS X axis (in WCS)
2175
                /// </summary>
2176
                /// <remarks>
2177
                /// System variable UCSXDIR
2178
                /// </remarks>
2179
                [CadSystemVariable("$UCSXDIR", 10, 20, 30)]
2180
                public XYZ ModelSpaceXAxis
2181
                {
2182
                        get { return this.ModelSpaceUcs.XAxis; }
90✔
2183
                        set
2184
                        {
422✔
2185
                                this.ModelSpaceUcs.XAxis = value;
422✔
2186
                        }
422✔
2187
                }
2188

2189
                /// <summary>
2190
                /// Direction of the current UCS Y axis (in WCS)
2191
                /// </summary>
2192
                /// <remarks>
2193
                /// System variable UCSYDIR
2194
                /// </remarks>
2195
                [CadSystemVariable("$UCSYDIR", 10, 20, 30)]
2196
                public XYZ ModelSpaceYAxis
2197
                {
2198
                        get { return this.ModelSpaceUcs.YAxis; }
90✔
2199
                        set
2200
                        {
422✔
2201
                                this.ModelSpaceUcs.YAxis = value;
422✔
2202
                        }
422✔
2203
                }
2204

2205
                /// <remarks>
2206
                /// System variable NORTHDIRECTION
2207
                /// </remarks>
2208
                [CadSystemVariable("$NORTHDIRECTION", 40)]
2209
                public double NorthDirection { get; set; }
257✔
2210

2211
                /// <summary>
2212
                /// Sets the number of line segments to be generated for each spline-fit polyline generated by the Spline option of the PEDIT command.
2213
                /// </summary>
2214
                /// <remarks>
2215
                /// System variable SPLINESEGS.
2216
                /// </remarks>
2217
                [CadSystemVariable("$SPLINESEGS", 70)]
2218
                public short NumberOfSplineSegments { get; set; } = 8;
1,195✔
2219

2220
                /// <summary>
2221
                /// Sets running object snaps.
2222
                /// </summary>
2223
                /// <remarks>
2224
                /// System variable OSMODE.
2225
                /// </remarks>
2226
                [CadSystemVariable("$OSMODE", 70)]
2227
                public ObjectSnapMode ObjectSnapMode { get; set; } = (ObjectSnapMode)4133;
707✔
2228

2229
                public Color ObscuredColor { get; set; }
140✔
2230

2231
                /// <remarks>
2232
                /// System variable OBSCUREDLTYPE
2233
                /// </remarks>
2234
                public byte ObscuredType { get; set; }
140✔
2235

2236
                /// <summary>
2237
                /// Constrains cursor movement to the perpendicular.
2238
                /// </summary>
2239
                /// <remarks>
2240
                /// System variable ORTHOMODE.
2241
                /// </remarks>
2242
                [CadSystemVariable("$ORTHOMODE", 70)]
2243
                public bool OrthoMode { get; set; } = false;
1,093✔
2244

2245
                /// <summary>
2246
                /// Name of the UCS that defines the origin and orientation of orthographic UCS settings (paper space only)
2247
                /// </summary>
2248
                /// <remarks>
2249
                /// System variable PUCSBASE
2250
                /// </remarks>
2251
                [CadSystemVariable("$PUCSBASE", true, 2)]
2252
                public string PaperSpaceBaseName
2253
                {
NEW
2254
                        get { return this.PaperSpaceUcsBase.Name; }
×
2255
                        set
UNCOV
2256
                        {
×
NEW
2257
                                this.PaperSpaceUcsBase.Name = value;
×
UNCOV
2258
                        }
×
2259
                }
2260

2261
                /// <summary>
2262
                /// Current elevation set by ELEV command
2263
                /// </summary>
2264
                /// <remarks>
2265
                /// System variable PELEVATION
2266
                /// </remarks>
2267
                [CadSystemVariable("$PELEVATION", 40)]
2268
                public double PaperSpaceElevation
2269
                {
2270
                        get { return this.PaperSpaceUcs.Elevation; }
90✔
2271
                        set
2272
                        {
422✔
2273
                                this.PaperSpaceUcs.Elevation = value;
422✔
2274
                        }
422✔
2275
                }
2276

2277
                /// <summary>
2278
                /// X, Y, and Z drawing extents upper-right corner(in WCS).
2279
                /// </summary>
2280
                /// <remarks>
2281
                /// System variable PEXTMAX.
2282
                /// </remarks>
2283
                [CadSystemVariable("$PEXTMAX", 10, 20, 30)]
2284
                public XYZ PaperSpaceExtMax { get; set; } = XYZ.Zero;
1,093✔
2285

2286
                /// <summary>
2287
                /// X, Y, and Z drawing extents lower-left corner (in WCS).
2288
                /// </summary>
2289
                /// <remarks>
2290
                /// System variable PEXTMIN.
2291
                /// </remarks>
2292
                [CadSystemVariable("$PEXTMIN", 10, 20, 30)]
2293
                public XYZ PaperSpaceExtMin { get; set; } = XYZ.Zero;
1,093✔
2294

2295
                /// <summary>
2296
                /// Paper space insertion base point.
2297
                /// </summary>
2298
                /// <remarks>
2299
                /// System variable PINSBASE.
2300
                /// </remarks>
2301
                [CadSystemVariable("$PINSBASE", 10, 20, 30)]
2302
                public XYZ PaperSpaceInsertionBase { get; set; } = XYZ.Zero;
1,057✔
2303

2304
                /// <summary>
2305
                /// Limits checking in paper space when nonzero.
2306
                /// </summary>
2307
                /// <remarks>
2308
                /// System variable PLIMCHECK.
2309
                /// </remarks>
2310
                [CadSystemVariable("$PLIMCHECK", 70)]
2311
                public bool PaperSpaceLimitsChecking { get; set; } = false;
1,093✔
2312

2313
                /// <summary>
2314
                /// XY drawing limits upper-right corner (in WCS).
2315
                /// </summary>
2316
                /// <remarks>
2317
                /// System variable PLIMMAX.
2318
                /// </remarks>
2319
                [CadSystemVariable("$PLIMMAX", 10, 20)]
2320
                public XY PaperSpaceLimitsMax { get; set; } = XY.Zero;
1,093✔
2321

2322
                /// <summary>
2323
                /// XY drawing limits lower-left corner(in WCS).
2324
                /// </summary>
2325
                /// <remarks>
2326
                /// System variable PLIMMIN.
2327
                /// </remarks>
2328
                [CadSystemVariable("$PLIMMIN", 10, 20)]
2329
                public XY PaperSpaceLimitsMin { get; set; } = XY.Zero;
1,093✔
2330

2331
                /// <summary>
2332
                /// Controls paper space linetype scaling.
2333
                /// </summary>
2334
                /// <remarks>
2335
                /// System variable PSLTSCALE.
2336
                /// </remarks>
2337
                [CadSystemVariable("$PSLTSCALE", 70)]
2338
                public SpaceLineTypeScaling PaperSpaceLineTypeScaling { get; set; } = SpaceLineTypeScaling.Normal;
1,195✔
2339

2340
                /// <summary>
2341
                /// Current paper space UCS name
2342
                /// </summary>
2343
                /// <remarks>
2344
                /// System variable PUCSNAME
2345
                /// </remarks>
2346
                [CadSystemVariable("$PUCSNAME", true, 2)]
2347
                public string PaperSpaceName
2348
                {
NEW
2349
                        get { return this.PaperSpaceUcs.Name; }
×
2350
                        set
UNCOV
2351
                        {
×
NEW
2352
                                this.PaperSpaceUcs.Name = value;
×
UNCOV
2353
                        }
×
2354
                }
2355

2356
                /// <summary>
2357
                /// Point which becomes the new UCS origin after changing paper space UCS to BACK when PUCSBASE is set to WORLD
2358
                /// </summary>
2359
                /// <remarks>
2360
                /// System variable PUCSORGBACK
2361
                /// </remarks>
2362
                [CadSystemVariable("$PUCSORGBACK", 10, 20, 30)]
2363
                public XYZ PaperSpaceOrthographicBackDOrigin { get; set; }
386✔
2364

2365
                /// <summary>
2366
                /// Point which becomes the new UCS origin after changing paper space UCS to BOTTOM when PUCSBASE is set to WORLD
2367
                /// </summary>
2368
                /// <remarks>
2369
                /// System variable PUCSORGBOTTOM
2370
                /// </remarks>
2371
                [CadSystemVariable("$PUCSORGBOTTOM", 10, 20, 30)]
2372
                public XYZ PaperSpaceOrthographicBottomDOrigin { get; set; }
386✔
2373

2374
                /// <summary>
2375
                /// Point which becomes the new UCS origin after changing paper space UCS to FRONT when PUCSBASE is set to WORLD
2376
                /// </summary>
2377
                /// <remarks>
2378
                /// System variable PUCSORGFRONT
2379
                /// </remarks>
2380
                [CadSystemVariable("$PUCSORGFRONT", 10, 20, 30)]
2381
                public XYZ PaperSpaceOrthographicFrontDOrigin { get; set; }
386✔
2382

2383
                /// <summary>
2384
                /// Point which becomes the new UCS origin after changing paper space UCS to LEFT when PUCSBASE is set to WORLD
2385
                /// </summary>
2386
                /// <remarks>
2387
                /// System variable PUCSORGLEFT
2388
                /// </remarks>
2389
                [CadSystemVariable("$PUCSORGLEFT", 10, 20, 30)]
2390
                public XYZ PaperSpaceOrthographicLeftDOrigin { get; set; }
386✔
2391

2392
                /// <summary>
2393
                /// Point which becomes the new UCS origin after changing paper space UCS to RIGHT when PUCSBASE is set to WORLD
2394
                /// </summary>
2395
                /// <remarks>
2396
                /// System variable PUCSORGRIGHT
2397
                /// </remarks>
2398
                [CadSystemVariable("$PUCSORGRIGHT", 10, 20, 30)]
2399
                public XYZ PaperSpaceOrthographicRightDOrigin { get; set; }
386✔
2400

2401
                /// <summary>
2402
                /// Point which becomes the new UCS origin after changing paper space UCS to TOP when PUCSBASE is set to WORLD
2403
                /// </summary>
2404
                /// <remarks>
2405
                /// System variable PUCSORGTOP
2406
                /// </remarks>
2407
                [CadSystemVariable("$PUCSORGTOP", 10, 20, 30)]
2408
                public XYZ PaperSpaceOrthographicTopDOrigin { get; set; }
386✔
2409

2410
                public UCS PaperSpaceUcs { get; private set; } = new UCS();
2,479✔
2411

2412
                public UCS PaperSpaceUcsBase { get; private set; } = new UCS();
641✔
2413

2414
                /// <summary>
2415
                /// Origin of current UCS (in WCS)
2416
                /// </summary>
2417
                /// <remarks>
2418
                /// System variable PUCSORG
2419
                /// </remarks>
2420
                [CadSystemVariable("$PUCSORG", 10, 20, 30)]
2421
                public XYZ PaperSpaceUcsOrigin
2422
                {
2423
                        get { return this.PaperSpaceUcs.Origin; }
90✔
2424
                        set
2425
                        {
422✔
2426
                                this.PaperSpaceUcs.Origin = value;
422✔
2427
                        }
422✔
2428
                }
2429

2430
                /// <summary>
2431
                /// Direction of the current UCS X axis (in WCS)
2432
                /// </summary>
2433
                /// <remarks>
2434
                /// System variable PUCSXDIR
2435
                /// </remarks>
2436
                [CadSystemVariable("$PUCSXDIR", 10, 20, 30)]
2437
                public XYZ PaperSpaceUcsXAxis
2438
                {
2439
                        get { return this.PaperSpaceUcs.XAxis; }
90✔
2440
                        set
2441
                        {
422✔
2442
                                this.PaperSpaceUcs.XAxis = value;
422✔
2443
                        }
422✔
2444
                }
2445

2446
                /// <summary>
2447
                /// Direction of the current UCS Y aYis (in WCS)
2448
                /// </summary>
2449
                /// <remarks>
2450
                /// System variable PUCSYDIR
2451
                /// </remarks>
2452
                [CadSystemVariable("$PUCSYDIR", 10, 20, 30)]
2453
                public XYZ PaperSpaceUcsYAxis
2454
                {
2455
                        get { return this.PaperSpaceUcs.YAxis; }
90✔
2456
                        set
2457
                        {
422✔
2458
                                this.PaperSpaceUcs.YAxis = value;
422✔
2459
                        }
422✔
2460
                }
2461

2462
                /// <summary>
2463
                /// Indicates whether the current drawing is in a Color-Dependent or Named Plot Style mode
2464
                /// </summary>
2465
                /// <remarks>
2466
                /// System variable PSTYLEMODE
2467
                /// </remarks>
2468
                [CadSystemVariable("$PSTYLEMODE", 290)]
2469
                public short PlotStyleMode { get; set; }
386✔
2470

2471
                /// <summary>
2472
                /// Controls how point objects are displayed.
2473
                /// </summary>
2474
                /// <remarks>
2475
                /// System variable PDMODE.
2476
                /// </remarks>
2477
                [CadSystemVariable("$PDMODE", 70)]
2478
                public short PointDisplayMode { get; set; } = 0;
1,195✔
2479

2480
                /// <summary>
2481
                /// Sets the display size for point objects.
2482
                /// </summary>
2483
                /// <remarks>
2484
                /// System variable PDSIZE.
2485
                /// </remarks>
2486
                [CadSystemVariable("$PDSIZE", 40)]
2487
                public double PointDisplaySize { get; set; } = 0.0d;
1,195✔
2488

2489
                /// <summary>
2490
                /// Governs the generation of linetype patterns around the vertices of a 2D polyline:<br/>
2491
                /// 1 = Linetype is generated in a continuous pattern around vertices of the polyline<br/>
2492
                /// 0 = Each segment of the polyline starts and ends with a dash
2493
                /// </summary>
2494
                /// <remarks>
2495
                /// System variable PLINEGEN
2496
                /// </remarks>
2497
                [CadSystemVariable("$PLINEGEN", 70)]
2498
                public bool PolylineLineTypeGeneration { get; set; } = false;
1,195✔
2499

2500
                /// <summary>
2501
                /// Stores the default polyline width.
2502
                /// </summary>
2503
                /// <remarks>
2504
                /// System variable PLINEWID.
2505
                /// </remarks>
2506
                [CadSystemVariable("$PLINEWID", 40)]
2507
                public double PolylineWidthDefault { get; set; } = 0.0d;
1,093✔
2508

2509
                /// <summary>
2510
                /// Assigns a project name to the current drawing. Used when an external reference or image is not found on its original path. The project name points to a section in the registry that can contain one or more search paths for each project name defined. Project names and their search directories are created from the Files tab of the Options dialog box
2511
                /// </summary>
2512
                /// <remarks>
2513
                /// System variable PROJECTNAME
2514
                /// </remarks>
2515
                [CadSystemVariable("$PROJECTNAME", 1)]
2516
                public string ProjectName { get; set; }
322✔
2517

2518
                /// <summary>
2519
                /// Specifies whether images of proxy objects are saved in the drawing.
2520
                /// </summary>
2521
                /// <remarks>
2522
                /// System variable PROXYGRAPHICS.
2523
                /// </remarks>
2524
                [CadSystemVariable("$PROXYGRAPHICS", 70)]
2525
                public bool ProxyGraphics { get; set; } = true;
1,057✔
2526

2527
                /// <summary>
2528
                /// Quick Text mode on if nonzero
2529
                /// </summary>
2530
                /// <remarks>
2531
                /// System variable QTEXTMODE.
2532
                /// </remarks>
2533
                [CadSystemVariable("$QTEXTMODE", 70)]
2534
                public bool QuickTextMode { get; set; } = false;
1,093✔
2535

2536
                /// <summary>
2537
                /// Obsolete. Controls automatic regeneration of the drawing.
2538
                /// </summary>
2539
                /// <remarks>
2540
                /// System variable REGENMODE.
2541
                /// </remarks>
2542
                [CadSystemVariable("$REGENMODE", 70)]
2543
                public bool RegenerationMode { get; set; } = false;
1,093✔
2544

2545
                /// <summary>
2546
                /// The default value is 0.
2547
                /// Read only.
2548
                /// </summary>
2549
                /// <remarks>
2550
                /// System variable REQUIREDVERSIONS <br/>
2551
                /// Only in <see cref="ACadVersion.AC1024"/> or above
2552
                /// </remarks>
2553
                [CadSystemVariable(DxfReferenceType.Ignored, "$REQUIREDVERSIONS", 70)]
2554
                public long RequiredVersions { get; set; }
123✔
2555

2556
                /// <summary>
2557
                /// Controls the properties of xref-dependent layers: <br/>
2558
                /// 0 = Don't retain xref-dependent visibility settings <br/>
2559
                /// 1 = Retain xref-dependent visibility settings <br/>
2560
                /// </summary>
2561
                /// <remarks>
2562
                /// System variable VISRETAIN.
2563
                /// </remarks>
2564
                [CadSystemVariable("$VISRETAIN", 70)]
2565
                public bool RetainXRefDependentVisibilitySettings { get; set; } = true;
1,093✔
2566

2567
                /// <summary>
2568
                /// Sets the ratio of diffuse reflective light to ambient light.
2569
                /// </summary>
2570
                /// <remarks>
2571
                /// System variable SHADEDIF.
2572
                /// </remarks>
2573
                /// <value>
2574
                /// range 1-100
2575
                /// </value>
2576
                [CadSystemVariable("$SHADEDIF", 70)]
2577
                public short ShadeDiffuseToAmbientPercentage { get; set; } = 70;
1,093✔
2578

2579
                /// <summary>
2580
                /// Controls the shading of edges.
2581
                /// </summary>
2582
                /// <remarks>
2583
                /// System variable SHADEDGE.
2584
                /// </remarks>
2585
                [CadSystemVariable("$SHADEDGE", 70)]
2586
                public ShadeEdgeType ShadeEdge { get; set; } = ShadeEdgeType.FacesInEntityColorEdgesInBlack;
1,093✔
2587

2588
                /// <summary>
2589
                /// Shadow mode for a 3D object
2590
                /// </summary>
2591
                /// <remarks>
2592
                /// System variable CSHADOW
2593
                /// </remarks>
2594
                [CadSystemVariable("$CSHADOW", 280)]
2595
                public ShadowMode ShadowMode { get; set; }
257✔
2596

2597
                /// <summary>
2598
                /// Location of the ground shadow plane. This is a Z axis ordinate
2599
                /// </summary>
2600
                /// <remarks>
2601
                /// System variable SHADOWPLANELOCATION
2602
                /// </remarks>
2603
                [CadSystemVariable("$SHADOWPLANELOCATION", 40)]
2604
                public double ShadowPlaneLocation { get; set; }
257✔
2605

2606
                /// <summary>
2607
                /// Determines whether the Model tab or the most-recently accessed named layout tab is active.
2608
                /// </summary>
2609
                /// <remarks>
2610
                /// System variable TILEMODE.
2611
                /// </remarks>
2612
                [CadSystemVariable("$TILEMODE", 70)]
2613
                public bool ShowModelSpace { get; set; }
462✔
2614

2615
                /// <remarks>
2616
                /// System variable SHOWHIST
2617
                /// </remarks>
2618
                [CadSystemVariable("$SHOWHIST", 280)]
2619
                public char ShowSolidsHistory { get; set; }
257✔
2620

2621
                /// <summary>
2622
                /// Controls the display of helixes and smoothed mesh objects.
2623
                /// </summary>
2624
                /// <remarks>
2625
                /// System variable SPLFRAME.
2626
                /// </remarks>
2627
                [CadSystemVariable("$SPLFRAME", 70)]
2628
                public bool ShowSplineControlPoints { get; set; } = false;
1,093✔
2629

2630
                /// <summary>
2631
                /// Sketch record increment.
2632
                /// </summary>
2633
                /// <remarks>
2634
                /// System variable SKETCHINC.
2635
                /// </remarks>
2636
                [CadSystemVariable("$SKETCHINC", 40)]
2637
                public double SketchIncrement { get; set; } = 1.0d;
1,093✔
2638

2639
                /// <summary>
2640
                /// Determines the object type created by the SKETCH command.
2641
                /// </summary>
2642
                /// <remarks>
2643
                /// System variable SKPOLY.
2644
                /// </remarks>
2645
                [CadSystemVariable("$SKPOLY", 70)]
2646
                public bool SketchPolylines { get; set; } = false;
1,093✔
2647

2648
                /// <remarks>
2649
                /// System variable LOFTPARAM
2650
                /// </remarks>
2651
                [CadSystemVariable("$LOFTPARAM", 70)]
2652
                public short SolidLoftedShape { get; set; }
257✔
2653

2654
                /// <remarks>
2655
                /// System variable SOLIDHIST
2656
                /// </remarks>
2657
                [CadSystemVariable("$SOLIDHIST", 280)]
2658
                public char SolidsRetainHistory { get; set; }
257✔
2659

2660
                /// <summary>
2661
                /// Specifies the maximum depth, that is, the number of times the tree-structured spatial index can divide into branches.
2662
                /// </summary>
2663
                /// <remarks>
2664
                /// System variable TREEDEPTH.
2665
                /// </remarks>
2666
                [CadSystemVariable("$TREEDEPTH", 70)]
2667
                public short SpatialIndexMaxTreeDepth { get; set; } = 3020;
1,057✔
2668

2669
                /// <summary>
2670
                /// Sets the type of curve generated by the Spline option of the PEDIT command.
2671
                /// </summary>
2672
                /// <remarks>
2673
                /// System variable SPLINETYPE.
2674
                /// </remarks>
2675
                [CadSystemVariable("$SPLINETYPE", 70)]
2676
                public SplineType SplineType { get; set; } = SplineType.CubicBSpline;
1,093✔
2677

2678
                /// <remarks>
2679
                /// System variable TSTACKALIGN, default = 1(not present in DXF)
2680
                /// </remarks>
2681
                public short StackedTextAlignment { get; internal set; } = 1;
809✔
2682

2683
                /// <remarks>
2684
                /// TSTACKSIZE, default = 70(not present in DXF)
2685
                /// </remarks>
2686
                public short StackedTextSizePercentage { get; internal set; } = 70;
809✔
2687

2688
                /// <summary>
2689
                /// Specifies the size of each step when in walk or fly mode, in drawing units.
2690
                /// </summary>
2691
                /// <remarks>
2692
                /// System variable STEPSIZE
2693
                /// </remarks>
2694
                [CadSystemVariable("$STEPSIZE", 40)]
2695
                public double StepSize { get; set; } = 6.0d;
898✔
2696

2697
                /// <summary>
2698
                /// Specifies the number of steps taken per second when you are in walk or fly mode.
2699
                /// </summary>
2700
                /// <remarks>
2701
                /// System variable STEPSPERSEC
2702
                /// </remarks>
2703
                /// <value>
2704
                /// Valid values are from 1 to 30
2705
                /// </value>
2706
                [CadSystemVariable("$STEPSPERSEC", 40)]
2707
                public double StepsPerSecond
2708
                {
2709
                        get
2710
                        {
16✔
2711
                                return this._stepsPerSecond;
16✔
2712
                        }
16✔
2713
                        set
2714
                        {
241✔
2715
                                ObjectExtensions.InRange(value, 1, 30, "STEPSPERSEC valid values are from 1 to 30");
241✔
2716
                                this._stepsPerSecond = value;
241✔
2717
                        }
241✔
2718
                }
2719

2720
                /// <remarks>
2721
                /// System variable STYLESHEET
2722
                /// </remarks>
2723
                [CadSystemVariable("$STYLESHEET", 1)]
2724
                public string StyleSheetName { get; set; }
386✔
2725

2726
                /// <summary>
2727
                /// Surface density (for PEDIT Smooth) in M direction.
2728
                /// </summary>
2729
                /// <remarks>
2730
                /// System variable SURFU.
2731
                /// </remarks>
2732
                [CadSystemVariable("$SURFU", 70)]
2733
                public short SurfaceDensityU { get; set; } = 6;
1,195✔
2734

2735
                /// <summary>
2736
                /// Surface density(for PEDIT Smooth) in N direction.
2737
                /// </summary>
2738
                /// <remarks>
2739
                /// System variable SURFV.
2740
                /// </remarks>
2741
                [CadSystemVariable("$SURFV", 70)]
2742
                public short SurfaceDensityV { get; set; } = 6;
1,195✔
2743

2744
                /// <summary>
2745
                /// Specifies the number of contour lines displayed on the curved surfaces of 3D solids.
2746
                /// </summary>
2747
                /// <remarks>
2748
                /// System variable ISOLINES.
2749
                /// </remarks>
2750
                public short SurfaceIsolineCount
2751
                {
2752
                        get
2753
                        {
30✔
2754
                                return this._surfaceIsolineCount;
30✔
2755
                        }
30✔
2756
                        set
2757
                        {
168✔
2758
                                ObjectExtensions.InRange(value, 0, 2047, "ISOLINES valid values are from 0 to 2047");
168✔
2759
                                this._surfaceIsolineCount = value;
168✔
2760
                        }
168✔
2761
                }
2762

2763
                /// <summary>
2764
                /// Number of mesh tabulations in first direction.
2765
                /// </summary>
2766
                /// <remarks>
2767
                /// System variable SURFTAB1.
2768
                /// </remarks>
2769
                [CadSystemVariable("$SURFTAB1", 70)]
2770
                public short SurfaceMeshTabulationCount1 { get; set; } = 6;
1,093✔
2771

2772
                /// <summary>
2773
                /// Number of mesh tabulations in second direction.
2774
                /// </summary>
2775
                /// <remarks>
2776
                /// System variable SURFTAB2.
2777
                /// </remarks>
2778
                [CadSystemVariable("$SURFTAB2", 70)]
2779
                public short SurfaceMeshTabulationCount2 { get; set; } = 6;
1,093✔
2780

2781
                /// <summary>
2782
                /// Surface type for PEDIT Smooth.
2783
                /// </summary>
2784
                /// <remarks>
2785
                /// System variable SURFTYPE.
2786
                /// </remarks>
2787
                [CadSystemVariable("$SURFTYPE", 70)]
2788
                public short SurfaceType { get; set; } = 6;
1,093✔
2789

2790
                /// <remarks>
2791
                /// System variable PSOLHEIGHT
2792
                /// </remarks>
2793
                [CadSystemVariable("$PSOLHEIGHT", 40)]
2794
                public double SweptSolidHeight { get; set; }
257✔
2795

2796
                /// <remarks>
2797
                /// System variable PSOLWIDTH
2798
                /// </remarks>
2799
                [CadSystemVariable("$PSOLWIDTH", 40)]
2800
                public double SweptSolidWidth { get; set; }
257✔
2801

2802
                /// <summary>
2803
                /// Sets the default text height when creating new text objects.
2804
                /// </summary>
2805
                /// <remarks>
2806
                /// System variable TEXTSIZE.
2807
                /// </remarks>
2808
                [CadSystemVariable("$TEXTSIZE", 40)]
2809
                public double TextHeightDefault { get; set; } = 2.5d;
1,195✔
2810

2811
                /// <summary>
2812
                /// Sets the resolution of TrueType text for plotting and rendering.
2813
                /// </summary>
2814
                /// <remarks>
2815
                /// System variable TEXTQLTY.
2816
                /// </remarks>
2817
                public short TextQuality
2818
                {
2819
                        get
2820
                        {
30✔
2821
                                return this._textQuality;
30✔
2822
                        }
30✔
2823
                        set
2824
                        {
168✔
2825
                                ObjectExtensions.InRange(value, 0, 100, "TEXTQLTY valid values are from 0 to 100");
168✔
2826
                                this._textQuality = value;
168✔
2827
                        }
168✔
2828
                }
2829

2830
                /// <summary>
2831
                /// Sets the name of the current text style.
2832
                /// </summary>
2833
                /// <remarks>
2834
                /// System variable TEXTSTYLE.
2835
                /// </remarks>
2836
                [CadSystemVariable("$TEXTSTYLE", true, 7)]
2837
                public string TextStyleName
2838
                {
2839
                        get { return this._currentTextStyle.Name; }
507✔
2840
                        set
2841
                        {
413✔
2842
                                if (this.Document != null)
413✔
2843
                                {
147✔
2844
                                        this._currentTextStyle = this.Document.TextStyles[value];
147✔
2845
                                }
147✔
2846
                                else
2847
                                {
266✔
2848
                                        this._currentTextStyle = new TextStyle(value);
266✔
2849
                                }
266✔
2850
                        }
413✔
2851
                }
2852

2853
                /// <summary>
2854
                /// Sets the default 3D thickness property when creating 2D geometric objects.
2855
                /// </summary>
2856
                /// <remarks>
2857
                /// System variable THICKNESS.
2858
                /// </remarks>
2859
                [CadSystemVariable("$THICKNESS", 40)]
2860
                public double ThicknessDefault { get; set; } = 0.0d;
1,093✔
2861

2862
                /// <summary>
2863
                /// Sets the time zone for the sun in the drawing.
2864
                /// </summary>
2865
                /// <remarks>
2866
                /// The values in the table are expressed as hours and minutes away from Greenwich Mean Time. You can also change this value in the Geographic Location dialog box when you set or edit geographic location information for the drawing file.
2867
                /// <br/>
2868
                /// System variable TIMEZONE
2869
                /// </remarks>
2870
                [CadSystemVariable("$TIMEZONE", 70)]
2871
                public int TimeZone { get; set; } = 0;
898✔
2872

2873
                /// <summary>
2874
                /// Cumulative editing time for this drawing(see Special Handling of Date/Time Variables)
2875
                /// </summary>
2876
                /// <remarks>
2877
                /// System variable TDINDWG
2878
                /// </remarks>
2879
                [CadSystemVariable("$TDINDWG", 40)]
2880
                public TimeSpan TotalEditingTime { get; set; } = new TimeSpan();
1,195✔
2881

2882
                /// <summary>
2883
                /// Default trace width.
2884
                /// </summary>
2885
                /// <remarks>
2886
                /// System variable TRACEWID.
2887
                /// </remarks>
2888
                [CadSystemVariable("$TRACEWID", 40)]
2889
                public double TraceWidthDefault { get; set; }
452✔
2890

2891
                /// <summary>
2892
                /// Name of the UCS that defines the origin and orientation of orthographic UCS settings
2893
                /// </summary>
2894
                /// <remarks>
2895
                /// System variable UCSBASE
2896
                /// </remarks>
2897
                [CadSystemVariable("$UCSBASE", true, 2)]
2898
                public string UcsBaseName
2899
                {
NEW
2900
                        get { return this.ModelSpaceUcsBase.Name; }
×
2901
                        set
UNCOV
2902
                        {
×
NEW
2903
                                this.ModelSpaceUcsBase.Name = value;
×
UNCOV
2904
                        }
×
2905
                }
2906

2907
                /// <summary>
2908
                /// Name of current UCS
2909
                /// </summary>
2910
                /// <remarks>
2911
                /// System variable UCSNAME
2912
                /// </remarks>
2913
                [CadSystemVariable("$UCSNAME", true, 2)]
2914
                public string UcsName
2915
                {
NEW
2916
                        get { return this.ModelSpaceUcs.Name; }
×
2917
                        set
UNCOV
2918
                        {
×
NEW
2919
                                this.ModelSpaceUcs.Name = value;
×
UNCOV
2920
                        }
×
2921
                }
2922

2923
                /// <summary>
2924
                /// Controls the display format for units.
2925
                /// </summary>
2926
                /// <remarks>
2927
                /// System variable UNITMODE.
2928
                /// </remarks>
2929
                [CadSystemVariable("$UNITMODE", 70)]
2930
                public short UnitMode { get; set; } = 0;
1,093✔
2931

2932
                /// <summary>
2933
                /// Universal date/time the drawing was created(see Special Handling of Date/Time Variables).
2934
                /// </summary>
2935
                /// <remarks>
2936
                /// System variable TDUCREATE.
2937
                /// </remarks>
2938
                [CadSystemVariable("$TDUCREATE", 40)]
2939
                public DateTime UniversalCreateDateTime { get; set; } = DateTime.UtcNow;
961✔
2940

2941
                /// <summary>
2942
                /// Universal date/time of the last update/save(see Special Handling of Date/Time Variables).
2943
                /// </summary>
2944
                /// <remarks>
2945
                /// System variable TDUUPDATE.
2946
                /// </remarks>
2947
                [CadSystemVariable("$TDUUPDATE", 40)]
2948
                public DateTime UniversalUpdateDateTime { get; set; } = DateTime.UtcNow;
980✔
2949

2950
                /// <summary>
2951
                /// Local date/time of last drawing update(see Special Handling of Date/Time Variables).
2952
                /// </summary>
2953
                /// <remarks>
2954
                /// System variable TDUPDATE.
2955
                /// </remarks>
2956
                [CadSystemVariable("$TDUPDATE", 40)]
2957
                public DateTime UpdateDateTime { get; set; } = DateTime.Now;
1,220✔
2958

2959
                /// <summary>
2960
                /// System variable DIMSHO
2961
                /// </summary>
2962
                [CadSystemVariable("$DIMSHO", 70)]
2963
                public bool UpdateDimensionsWhileDragging { get; set; } = true;
1,093✔
2964

2965
                /// <summary>
2966
                /// Real variable intended for use by third-party developers.
2967
                /// </summary>
2968
                /// <remarks>
2969
                /// System variable USERR1.
2970
                /// </remarks>
2971
                [CadSystemVariable("$USERR1", 40)]
2972
                public double UserDouble1 { get; set; }
452✔
2973

2974
                /// <summary>
2975
                /// Real variable intended for use by third-party developers.
2976
                /// </summary>
2977
                /// <remarks>
2978
                /// System variable USERR2.
2979
                /// </remarks>
2980
                [CadSystemVariable("$USERR2", 40)]
2981
                public double UserDouble2 { get; set; }
452✔
2982

2983
                /// <summary>
2984
                /// Real variable intended for use by third-party developers.
2985
                /// </summary>
2986
                /// <remarks>
2987
                /// System variable USERR3.
2988
                /// </remarks>
2989
                [CadSystemVariable("$USERR3", 40)]
2990
                public double UserDouble3 { get; set; }
452✔
2991

2992
                /// <summary>
2993
                /// Real variable intended for use by third-party developers.
2994
                /// </summary>
2995
                /// <remarks>
2996
                /// System variable USERR4.
2997
                /// </remarks>
2998
                [CadSystemVariable("$USERR4", 40)]
2999
                public double UserDouble4 { get; set; }
452✔
3000

3001
                /// <summary>
3002
                /// Real variable intended for use by third-party developers.
3003
                /// </summary>
3004
                /// <remarks>
3005
                /// System variable USERR5.
3006
                /// </remarks>
3007
                [CadSystemVariable("$USERR5", 40)]
3008
                public double UserDouble5 { get; set; }
452✔
3009

3010
                /// <summary>
3011
                /// User-elapsed timer
3012
                /// </summary>
3013
                /// <remarks>
3014
                /// System variable TDUSRTIMER
3015
                /// </remarks>
3016
                [CadSystemVariable("$TDUSRTIMER", 40)]
3017
                public TimeSpan UserElapsedTimeSpan { get; set; }
452✔
3018

3019
                /// <summary>
3020
                /// Integer variable intended for use by third-party developers.
3021
                /// </summary>
3022
                /// <remarks>
3023
                /// System variable USERI1.
3024
                /// </remarks>
3025
                [CadSystemVariable("$USERI1", 70)]
3026
                public short UserShort1 { get; set; } = 0;
1,093✔
3027

3028
                /// <summary>
3029
                /// Integer variable intended for use by third-party developers.
3030
                /// </summary>
3031
                /// <remarks>
3032
                /// System variable USERI2.
3033
                /// </remarks>
3034
                [CadSystemVariable("$USERI2", 70)]
3035
                public short UserShort2 { get; set; } = 0;
1,093✔
3036

3037
                /// <summary>
3038
                /// Integer variable intended for use by third-party developers.
3039
                /// </summary>
3040
                /// <remarks>
3041
                /// System variable USERI3.
3042
                /// </remarks>
3043
                [CadSystemVariable("$USERI3", 70)]
3044
                public short UserShort3 { get; set; } = 0;
1,093✔
3045

3046
                /// <summary>
3047
                /// Integer variable intended for use by third-party developers.
3048
                /// </summary>
3049
                /// <remarks>
3050
                /// System variable USERI4.
3051
                /// </remarks>
3052
                [CadSystemVariable("$USERI4", 70)]
3053
                public short UserShort4 { get; set; } = 0;
1,093✔
3054

3055
                /// <summary>
3056
                /// Integer variable intended for use by third-party developers.
3057
                /// </summary>
3058
                /// <remarks>
3059
                /// System variable USERI5.
3060
                /// </remarks>
3061
                [CadSystemVariable("$USERI5", 70)]
3062
                public short UserShort5 { get; set; } = 0;
1,093✔
3063

3064
                /// <summary>
3065
                /// Controls the user timer for the drawing.
3066
                /// </summary>
3067
                /// <remarks>
3068
                /// System variable USRTIMER.
3069
                /// </remarks>
3070
                [CadSystemVariable("$USRTIMER", 70)]
3071
                public bool UserTimer { get; set; } = false;
1,093✔
3072

3073
                public ACadVersion Version
3074
                {
3075
                        get { return this._version; }
68,040✔
3076
                        set
3077
                        {
1,349✔
3078
                                this._version = value;
1,349✔
3079

3080
                                //Values are relevant for the dwgWriter, manually checked form dxf
3081
                                switch (value)
1,349✔
3082
                                {
3083
                                        case ACadVersion.AC1015:
3084
                                                this.MaintenanceVersion = 20;
75✔
3085
                                                break;
75✔
3086
                                        case ACadVersion.AC1018:
3087
                                                this.MaintenanceVersion = 104;
249✔
3088
                                                break;
249✔
3089
                                        case ACadVersion.AC1021:
3090
                                                this.MaintenanceVersion = 50;
74✔
3091
                                                break;
74✔
3092
                                        case ACadVersion.AC1024:
3093
                                                this.MaintenanceVersion = 226;
76✔
3094
                                                break;
76✔
3095
                                        case ACadVersion.AC1027:
3096
                                                this.MaintenanceVersion = 125;
76✔
3097
                                                break;
76✔
3098
                                        case ACadVersion.AC1032:
3099
                                                this.MaintenanceVersion = 228;
720✔
3100
                                                break;
720✔
3101
                                        default:
3102
                                                this.MaintenanceVersion = 0;
79✔
3103
                                                break;
79✔
3104
                                }
3105
                        }
1,349✔
3106
                }
3107

3108
                /// <summary>
3109
                /// Uniquely identifies a particular version of a drawing. Updated when the drawing is modified
3110
                /// </summary>
3111
                /// <remarks>
3112
                /// System variable VERSIONGUID
3113
                /// </remarks>
3114
                [CadSystemVariable("$VERSIONGUID", 2)]
3115
                public string VersionGuid { get; internal set; } = Guid.NewGuid().ToString();
1,027✔
3116

3117
                /// <summary>
3118
                /// The Drawing database version number.
3119
                /// </summary>
3120
                /// <remarks>
3121
                /// System variable ACADVER.
3122
                /// </remarks>
3123
                [CadSystemVariable("$ACADVER", DxfCode.Text)]
3124
                public string VersionString
3125
                {
3126
                        get { return this.Version.ToString(); }
336✔
3127
                        set
3128
                        {
266✔
3129
                                this.Version = CadUtils.GetVersionFromName(value);
266✔
3130
                        }
266✔
3131
                }
3132

3133
                /// <summary>
3134
                /// View scale factor for new viewports.
3135
                /// </summary>
3136
                /// <remarks>
3137
                /// System variable PSVPSCALE.
3138
                /// </remarks>
3139
                [CadSystemVariable("$PSVPSCALE", 40)]
3140
                public double ViewportDefaultViewScaleFactor { get; set; }
386✔
3141

3142
                /// <summary>
3143
                /// Determines whether input to the DVIEW and VPOINT commands is relative to the WCS (default) or the current UCS.
3144
                /// </summary>
3145
                /// <remarks>
3146
                /// System variable WORLDVIEW.
3147
                /// </remarks>
3148
                [CadSystemVariable("$WORLDVIEW", 70)]
3149
                public bool WorldView { get; set; } = true;
1,093✔
3150

3151
                /// <summary>
3152
                /// Controls whether the current drawing can be edited in-place when being referenced by another drawing
3153
                /// </summary>
3154
                /// <remarks>
3155
                /// System variable XEDIT
3156
                /// </remarks>
3157
                [CadSystemVariable("$XEDIT", 290)]
3158
                public bool XEdit { get; set; }
386✔
3159

3160
                /// <summary>
3161
                /// Undocumented
3162
                /// </summary>
3163
                /// <remarks>
3164
                /// System variable DIMSAV
3165
                /// </remarks>
3166
                internal bool DIMSAV { get; set; }
30✔
3167

3168
                //Create enum for variable
3169
                private static readonly PropertyExpression<CadHeader, CadSystemVariableAttribute> _propertyCache;
3170

3171
                private short _angularUnitPrecision = 0;
641✔
3172
                private Layer _currentLayer = Layer.Default;
641✔
3173
                private LineType _currentLineType = LineType.ByLayer;
641✔
3174
                private MLineStyle _currentMLineStyle = MLineStyle.Default;
641✔
3175
                private TextStyle _currentTextStyle = TextStyle.Default;
641✔
3176
                private DimensionStyle _dimensionStyleOverrides = DimensionStyle.Default;
641✔
3177
                private TextStyle _dimensionTextStyle = TextStyle.Default;
641✔
3178
                private double _facetResolution = 0.5;
641✔
3179
                private short _linearUnitPrecision = 4;
641✔
3180
                private double _stepsPerSecond = 2.0d;
641✔
3181
                private short _surfaceIsolineCount = 4;
641✔
3182
                private short _textQuality = 50;
641✔
3183
                private ACadVersion _version = ACadVersion.AC1032;
641✔
3184

3185
                static CadHeader()
3186
                {
1✔
3187
                        _propertyCache = new PropertyExpression<CadHeader, CadSystemVariableAttribute>(
1✔
3188
                                (info, attribute) => attribute.Name);
250✔
3189
                }
1✔
3190

3191
                public CadHeader() : this(ACadVersion.AC1032)
451✔
3192
                {
451✔
3193
                }
451✔
3194

3195
                public CadHeader(CadDocument document) : this(ACadVersion.AC1032)
190✔
3196
                {
190✔
3197
                        this.Document = document;
190✔
3198
                }
190✔
3199

3200
                public CadHeader(ACadVersion version)
641✔
3201
                {
641✔
3202
                        this.Version = version;
641✔
3203
                }
641✔
3204

3205
                /// <summary>
3206
                /// Gets a map of all the system variables and it's codes
3207
                /// </summary>
3208
                /// <returns></returns>
3209
                public static Dictionary<string, CadSystemVariable> GetHeaderMap()
3210
                {
311✔
3211
                        Dictionary<string, CadSystemVariable> map = new Dictionary<string, CadSystemVariable>();
311✔
3212
                        foreach (PropertyInfo p in typeof(CadHeader).GetProperties())
168,251✔
3213
                        {
83,659✔
3214
                                CadSystemVariableAttribute att = p.GetCustomAttribute<CadSystemVariableAttribute>();
83,659✔
3215
                                if (att == null)
83,659✔
3216
                                        continue;
6,220✔
3217

3218
                                map.Add(att.Name, new CadSystemVariable(p));
77,439✔
3219
                        }
77,439✔
3220

3221
                        return map;
311✔
3222
                }
311✔
3223

3224
                public object GetValue(string systemvar)
NEW
3225
                {
×
NEW
3226
                        var prop = _propertyCache.GetProperty(systemvar);
×
NEW
3227
                        return prop.Getter(this);
×
NEW
3228
                }
×
3229

3230
                /// <summary>
3231
                /// Get the primitive values in each dxf code
3232
                /// </summary>
3233
                /// <param name="systemvar"></param>
3234
                /// <returns>dictionary with the codes and values</returns>
3235
                public Dictionary<DxfCode, object> GetValues(string systemvar)
NEW
3236
                {
×
NEW
3237
                        Dictionary<DxfCode, object> value = null;
×
3238

NEW
3239
                        foreach (PropertyInfo p in this.GetType().GetProperties())
×
NEW
3240
                        {
×
NEW
3241
                                CadSystemVariableAttribute att = p.GetCustomAttribute<CadSystemVariableAttribute>();
×
NEW
3242
                                if (att == null)
×
NEW
3243
                                        continue;
×
3244

NEW
3245
                                if (att.Name == systemvar)
×
NEW
3246
                                {
×
NEW
3247
                                        value = new Dictionary<DxfCode, object>();
×
3248

NEW
3249
                                        if (att.ValueCodes.Length == 1)
×
NEW
3250
                                        {
×
NEW
3251
                                                value.Add(att.ValueCodes[0], p.GetValue(this));
×
NEW
3252
                                        }
×
3253
                                        else
NEW
3254
                                        {
×
NEW
3255
                                                IVector vector = (IVector)p.GetValue(this);
×
NEW
3256
                                                for (int i = 0; i < vector.Dimension; i++)
×
NEW
3257
                                                {
×
NEW
3258
                                                        value.Add(att.ValueCodes[i], vector[i]);
×
NEW
3259
                                                }
×
NEW
3260
                                        }
×
3261

NEW
3262
                                        break;
×
3263
                                }
NEW
3264
                        }
×
3265

NEW
3266
                        return value;
×
NEW
3267
                }
×
3268

3269
                /// <summary>
3270
                /// Set a value of a system variable by name
3271
                /// </summary>
3272
                /// <param name="systemvar">name of the system var</param>
3273
                /// <param name="values">parameters for the constructor of the value</param>
3274
                public void SetValue(string systemvar, params object[] values)
3275
                {
54,116✔
3276
                        PropertyExpression<CadHeader, CadSystemVariableAttribute>.Prop prop = _propertyCache.GetProperty(systemvar);
54,116✔
3277

3278
                        ConstructorInfo constr = prop.Property.PropertyType.GetConstructor(values.Select(o => o.GetType()).ToArray());
120,528✔
3279

3280
                        if (prop.Property.PropertyType.IsEnum)
54,116✔
3281
                        {
7,653✔
3282
                                int v = Convert.ToInt32(values.First());
7,653✔
3283
                                prop.Setter(this, Enum.ToObject(prop.Property.PropertyType, v));
7,653✔
3284
                        }
7,653✔
3285
                        else if (prop.Property.PropertyType.IsEquivalentTo(typeof(DateTime)))
46,463✔
3286
                        {
992✔
3287
                                double jvalue = (double)values.First();
992✔
3288

3289
                                prop.Setter(this, CadUtils.FromJulianCalendar((double)values.First()));
992✔
3290
                        }
992✔
3291
                        else if (prop.Property.PropertyType.IsEquivalentTo(typeof(TimeSpan)))
45,471✔
3292
                        {
520✔
3293
                                double jvalue = (double)values.First();
520✔
3294

3295
                                prop.Setter(this, CadUtils.EditingTime((double)values.First()));
520✔
3296
                        }
520✔
3297
                        else if (constr == null)
44,951✔
3298
                        {
36,975✔
3299
                                if (prop.Attribute.IsName && values.First() is string name)
36,975✔
3300
                                {
2,456✔
3301
                                        if (!name.IsNullOrEmpty())
2,456✔
3302
                                        {
1,512✔
3303
                                                prop.Setter(this, Convert.ChangeType(values.First(), prop.Property.PropertyType));
1,512✔
3304
                                        }
1,512✔
3305
                                }
2,456✔
3306
                                else
3307
                                {
34,519✔
3308
                                        prop.Setter(this, Convert.ChangeType(values.First(), prop.Property.PropertyType));
34,519✔
3309
                                }
34,519✔
3310
                        }
36,975✔
3311
                        else
3312
                        {
7,976✔
3313
                                prop.Setter(this, Activator.CreateInstance(prop.Property.PropertyType, values));
7,976✔
3314
                        }
7,976✔
3315
                }
54,116✔
3316

3317
                /// <inheritdoc/>
3318
                public override string ToString()
3319
                {
×
3320
                        return $"{this.Version}";
×
3321
                }
×
3322
        }
3323
}
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