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

DomCR / ACadSharp / 14127425081

28 Mar 2025 10:56AM UTC coverage: 76.393% (+0.02%) from 76.378%
14127425081

push

github

web-flow
Merge pull request #594 from DomCR/issue-592_style-override

Issue 592 style override

5567 of 7998 branches covered (69.6%)

Branch coverage included in aggregate %.

154 of 157 new or added lines in 3 files covered. (98.09%)

3 existing lines in 2 files now uncovered.

22014 of 28106 relevant lines covered (78.32%)

74692.84 hits per line

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

88.13
/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,199✔
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,199✔
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,199✔
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
                        {
435✔
59
                                ObjectExtensions.InRange(value, 0, 8, "AUPREC valid values are from 0 to 8");
435✔
60
                                this._angularUnitPrecision = value;
435✔
61
                        }
435✔
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;
862✔
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,097✔
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,199✔
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; }
258✔
102

103
                /// <remarks>
104
                /// System variable CAMERAHEIGHT
105
                /// </remarks>
106
                [CadSystemVariable("$CAMERAHEIGHT", 40)]
107
                public double CameraHeight { get; set; }
258✔
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,061✔
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,097✔
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,097✔
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,061✔
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,221✔
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,221✔
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;
843✔
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,204✔
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,163✔
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,133✔
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; }
556✔
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
222
                        {
×
223
                                this._currentLayer = value;
×
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
                        {
414✔
239
                                if (this.Document != null)
414✔
240
                                {
148✔
241
                                        this._currentLayer = this.Document.Layers[value];
148✔
242
                                }
148✔
243
                                else
244
                                {
266✔
245
                                        this._currentLayer = new Layer(value);
266✔
246
                                }
266✔
247
                        }
414✔
248
                }
249

250
                public LineType CurrentLineType
251
                {
252
                        get
253
                        {
51✔
254
                                if (this.Document == null)
51!
255
                                {
×
256
                                        return this._currentLineType;
×
257
                                }
258
                                else
259
                                {
51✔
260
                                        return this.Document.LineTypes[this.CurrentLineTypeName];
51✔
261
                                }
262
                        }
51✔
263
                        private set
264
                        {
×
265
                                _currentLineType = value;
×
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
                        {
414✔
281
                                if (this.Document != null)
414✔
282
                                {
148✔
283
                                        this._currentLineType = this.Document.LineTypes[value];
148✔
284
                                }
148✔
285
                                else
286
                                {
266✔
287
                                        this._currentLineType = new LineType(value);
266✔
288
                                }
266✔
289
                        }
414✔
290
                }
291

292
                public MLineStyle CurrentMLineStyle
293
                {
294
                        get
295
                        {
×
296
                                if (this.Document == null)
×
297
                                {
×
298
                                        return this._currentMLineStyle;
×
299
                                }
300
                                else
301
                                {
×
302
                                        return this.Document.MLineStyles[this.CurrentMultiLineStyleName];
×
303
                                }
304
                        }
×
305
                        private set
306
                        {
×
307
                                this._currentMLineStyle = value;
×
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,163✔
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,163✔
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!
342
                                {
×
343
                                        this._currentMLineStyle = this.Document.MLineStyles[value];
×
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!
357
                                {
×
358
                                        return this._currentTextStyle;
×
359
                                }
360
                                else
361
                                {
56✔
362
                                        return this.Document.TextStyles[this.TextStyleName];
56✔
363
                                }
364
                        }
56✔
365
                        private set
366
                        {
×
367
                                this._currentTextStyle = value;
×
368
                        }
×
369
                }
370

371
                /// <remarks>
372
                /// System variable DGNFRAME
373
                /// </remarks>
374
                [CadSystemVariable("$DGNFRAME", 280)]
375
                public char DgnUnderlayFramesVisibility { get; set; }
258✔
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
                        {
423✔
389
                                this._dimensionStyleOverrides.AlternateDimensioningSuffix = value;
423✔
390
                        }
423✔
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
                        {
423✔
405
                                this._dimensionStyleOverrides.AlternateUnitDecimalPlaces = value;
423✔
406
                        }
423✔
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
                        {
423✔
421
                                this._dimensionStyleOverrides.AlternateUnitDimensioning = value;
423✔
422
                        }
423✔
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
                        {
387✔
437
                                this._dimensionStyleOverrides.AlternateUnitFormat = value;
387✔
438
                        }
387✔
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
                        {
362✔
453
                                this._dimensionStyleOverrides.AlternateUnitRounding = value;
362✔
454
                        }
362✔
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
                        {
423✔
469
                                this._dimensionStyleOverrides.AlternateUnitScaleFactor = value;
423✔
470
                        }
423✔
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
                        {
387✔
485
                                this._dimensionStyleOverrides.AlternateUnitToleranceDecimalPlaces = value;
387✔
486
                        }
387✔
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
                        {
387✔
501
                                this._dimensionStyleOverrides.AlternateUnitToleranceZeroHandling = value;
387✔
502
                        }
387✔
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
                        {
387✔
517
                                this._dimensionStyleOverrides.AlternateUnitZeroHandling = value;
387✔
518
                        }
387✔
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
                        {
75✔
533
                                this._dimensionStyleOverrides.AltMzf = value;
75✔
534
                        }
75✔
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
                        {
75✔
549
                                this._dimensionStyleOverrides.AltMzs = value;
75✔
550
                        }
75✔
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
                        {
387✔
565
                                this._dimensionStyleOverrides.AngularDimensionDecimalPlaces = value;
387✔
566
                        }
387✔
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
                        {
362✔
581
                                this._dimensionStyleOverrides.AngularUnit = value;
362✔
582
                        }
362✔
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
                        {
362✔
597
                                this._dimensionStyleOverrides.AngularZeroHandling = value;
362✔
598
                        }
362✔
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
                        {
242✔
613
                                this._dimensionStyleOverrides.ArcLengthSymbolPosition = value;
242✔
614
                        }
242✔
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
                        {
423✔
629
                                this._dimensionStyleOverrides.ArrowSize = value;
423✔
630
                        }
423✔
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;
967✔
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;
928✔
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
                        {
423✔
681
                                this._dimensionStyleOverrides.CenterMarkSize = value;
423✔
682
                        }
423✔
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
                        {
387✔
697
                                this._dimensionStyleOverrides.CursorUpdate = value;
387✔
698
                        }
387✔
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
                        {
387✔
713
                                this._dimensionStyleOverrides.DecimalPlaces = value;
387✔
714
                        }
387✔
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
                        {
362✔
729
                                this._dimensionStyleOverrides.DecimalSeparator = value;
362✔
730
                        }
362✔
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
                        {
362✔
745
                                this._dimensionStyleOverrides.DimensionTextArrowFit = value;
362✔
746
                        }
362✔
747
                }
748

749
                /// <summary>
750
                /// Dimension extension line color override.
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
                        {
423✔
761
                                this._dimensionStyleOverrides.ExtensionLineColor = value;
423✔
762
                        }
423✔
763
                }
764

765
                /// <summary>
766
                /// Extension line extension override.
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
                        {
423✔
777
                                this._dimensionStyleOverrides.ExtensionLineExtension = value;
423✔
778
                        }
423✔
779
                }
780

781
                /// <summary>
782
                /// Extension line offset override.
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
                        {
423✔
793
                                this._dimensionStyleOverrides.ExtensionLineOffset = value;
423✔
794
                        }
423✔
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
                        {
242✔
822
                                this._dimensionStyleOverrides.FixedExtensionLineLength = value;
242✔
823
                        }
242✔
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
                        {
362✔
838
                                this._dimensionStyleOverrides.FractionFormat = value;
362✔
839
                        }
362✔
840
                }
841

842
                /// <summary>
843
                /// Vertical justification for tolerance values override.
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
                        {
423✔
854
                                this._dimensionStyleOverrides.GenerateTolerances = value;
423✔
855
                        }
423✔
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
                        {
242✔
870
                                this._dimensionStyleOverrides.IsExtensionLineLengthFixed = value;
242✔
871
                        }
242✔
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
                        {
242✔
886
                                this._dimensionStyleOverrides.JoggedRadiusDimensionTransverseSegmentAngle = value;
242✔
887
                        }
242✔
888
                }
889

890
                /// <summary>
891
                /// Dimension limits generated if nonzero override.
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
                        {
423✔
902
                                this._dimensionStyleOverrides.LimitsGeneration = value;
423✔
903
                        }
423✔
904
                }
905

906
                /// <summary>
907
                /// Linear measurements scale factor override.
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
                        {
423✔
918
                                this._dimensionStyleOverrides.LinearScaleFactor = value;
423✔
919
                        }
423✔
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
                        {
362✔
934
                                this._dimensionStyleOverrides.LinearUnitFormat = value;
362✔
935
                        }
362✔
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
                        {
423✔
950
                                this._dimensionStyleOverrides.DimensionLineColor = value;
423✔
951
                        }
423✔
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
                        {
423✔
966
                                this._dimensionStyleOverrides.DimensionLineExtension = value;
423✔
967
                        }
423✔
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
                        {
423✔
982
                                this._dimensionStyleOverrides.DimensionLineGap = value;
423✔
983
                        }
423✔
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
                        {
423✔
998
                                this._dimensionStyleOverrides.DimensionLineIncrement = value;
423✔
999
                        }
423✔
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";
790✔
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
                        {
362✔
1023
                                this._dimensionStyleOverrides.DimensionLineWeight = value;
362✔
1024
                        }
362✔
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
                        {
423✔
1039
                                this._dimensionStyleOverrides.MinusTolerance = value;
423✔
1040
                        }
423✔
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
                        {
75✔
1055
                                this._dimensionStyleOverrides.Mzf = value;
75✔
1056
                        }
75✔
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
                        {
75✔
1071
                                this._dimensionStyleOverrides.Mzs = value;
75✔
1072
                        }
75✔
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
                        {
423✔
1087
                                this._dimensionStyleOverrides.PlusTolerance = value;
423✔
1088
                        }
423✔
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
                        {
423✔
1103
                                this._dimensionStyleOverrides.PostFix = value;
423✔
1104
                        }
423✔
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
                        {
423✔
1119
                                this._dimensionStyleOverrides.Rounding = value;
423✔
1120
                        }
423✔
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
                        {
423✔
1135
                                this._dimensionStyleOverrides.ScaleFactor = value;
423✔
1136
                        }
423✔
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
                        {
423✔
1151
                                this._dimensionStyleOverrides.SeparateArrowBlocks = value;
423✔
1152
                        }
423✔
1153
                }
1154

1155
                public DimensionStyle CurrentDimensionStyle
1156
                {
1157
                        get
1158
                        {
30✔
1159
                                if (this.Document == null)
30!
UNCOV
1160
                                {
×
NEW
1161
                                        return this._currentDimensionStyle;
×
1162
                                }
1163
                                else
1164
                                {
30✔
1165
                                        return this.Document.DimensionStyles[this.CurrentDimensionStyleName];
30✔
1166
                                }
1167
                        }
30✔
1168
                        private set
1169
                        {
×
NEW
1170
                                _currentDimensionStyle = value;
×
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 CurrentDimensionStyleName
1182
                {
1183
                        get { return this._currentDimensionStyle.Name; }
360✔
1184
                        set
1185
                        {
414✔
1186
                                if (this.Document != null)
414✔
1187
                                {
148✔
1188
                                        this._currentDimensionStyle = this.Document.DimensionStyles[value];
148✔
1189
                                }
148✔
1190
                                else
1191
                                {
266✔
1192
                                        this._currentDimensionStyle = new DimensionStyle(value);
266✔
1193
                                }
266✔
1194
                        }
414✔
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
                        {
567✔
1225
                                this._dimensionStyleOverrides.SuppressFirstExtensionLine = value;
567✔
1226
                        }
567✔
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
                        {
423✔
1241
                                this._dimensionStyleOverrides.SuppressOutsideExtensions = value;
423✔
1242
                        }
423✔
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
                        {
567✔
1273
                                this._dimensionStyleOverrides.SuppressSecondExtensionLine = value;
567✔
1274
                        }
567✔
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";
790✔
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";
790✔
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
                        {
242✔
1307
                                this._dimensionStyleOverrides.TextBackgroundColor = value;
242✔
1308
                        }
242✔
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
                        {
242✔
1323
                                this._dimensionStyleOverrides.TextBackgroundFillMode = value;
242✔
1324
                        }
242✔
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
                        {
423✔
1339
                                this._dimensionStyleOverrides.TextColor = value;
423✔
1340
                        }
423✔
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
                        {
184✔
1355
                                this._dimensionStyleOverrides.TextDirection = value;
184✔
1356
                        }
184✔
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
                        {
423✔
1371
                                this._dimensionStyleOverrides.TextHeight = value;
423✔
1372
                        }
423✔
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
                        {
387✔
1387
                                this._dimensionStyleOverrides.TextHorizontalAlignment = value;
387✔
1388
                        }
387✔
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
                        {
423✔
1403
                                this._dimensionStyleOverrides.TextInsideExtensions = value;
423✔
1404
                        }
423✔
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
                        {
423✔
1419
                                this._dimensionStyleOverrides.TextInsideHorizontal = value;
423✔
1420
                        }
423✔
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
                        {
362✔
1435
                                this._dimensionStyleOverrides.TextMovement = value;
362✔
1436
                        }
362✔
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
                        {
423✔
1451
                                this._dimensionStyleOverrides.TextOutsideExtensions = value;
423✔
1452
                        }
423✔
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
                        {
423✔
1467
                                this._dimensionStyleOverrides.TextOutsideHorizontal = value;
423✔
1468
                        }
423✔
1469
                }
1470

1471
                public TextStyle DimensionTextStyle
1472
                {
1473
                        get
1474
                        {
30✔
1475
                                if (this.Document == null)
30!
1476
                                {
×
1477
                                        return this._dimensionTextStyle;
×
1478
                                }
1479
                                else
1480
                                {
30✔
1481
                                        return this.Document.TextStyles[this.DimensionTextStyleName];
30✔
1482
                                }
1483
                        }
30✔
1484
                        private set
1485
                        {
×
1486
                                this._dimensionTextStyle = value;
×
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
                {
1499
                        get { return this._dimensionTextStyle.Name; }
90✔
1500
                        set
1501
                        {
366✔
1502
                                if (this.Document != null)
366✔
1503
                                {
148✔
1504
                                        this._dimensionTextStyle = this.Document.TextStyles[value];
148✔
1505
                                }
148✔
1506
                                else
1507
                                {
218✔
1508
                                        this._dimensionTextStyle = new TextStyle(value);
218✔
1509
                                }
218✔
1510
                        }
366✔
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
                        {
423✔
1525
                                this._dimensionStyleOverrides.TextVerticalAlignment = value;
423✔
1526
                        }
423✔
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
                        {
423✔
1541
                                this._dimensionStyleOverrides.TextVerticalPosition = value;
423✔
1542
                        }
423✔
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
                        {
423✔
1557
                                this._dimensionStyleOverrides.TickSize = value;
423✔
1558
                        }
423✔
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
                        {
387✔
1573
                                this._dimensionStyleOverrides.ToleranceAlignment = value;
387✔
1574
                        }
387✔
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
                        {
387✔
1589
                                this._dimensionStyleOverrides.ToleranceDecimalPlaces = value;
387✔
1590
                        }
387✔
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
                        {
423✔
1605
                                this._dimensionStyleOverrides.ToleranceScaleFactor = value;
423✔
1606
                        }
423✔
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
                        {
387✔
1621
                                this._dimensionStyleOverrides.ToleranceZeroHandling = value;
387✔
1622
                        }
387✔
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
                        {
423✔
1653
                                this._dimensionStyleOverrides.ZeroHandling = value;
423✔
1654
                        }
423✔
1655
                }
1656

1657
                /// <summary>
1658
                /// Get the <see cref="DimensionStyle"/> override for this document.
1659
                /// </summary>
NEW
1660
                public DimensionStyle DimensionstyleOverrides { get { return this._dimensionStyleOverrides; } }
×
1661

1662
                /// <remarks>
1663
                /// System variable LIGHTGLYPHDISPLAY
1664
                /// </remarks>
1665
                [CadSystemVariable("$LIGHTGLYPHDISPLAY", 280)]
1666
                public char DisplayLightGlyphs { get; set; }
258✔
1667

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

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

1688
                /// <summary>
1689
                /// Document where this header resides
1690
                /// </summary>
1691
                public CadDocument Document { get; internal set; }
4,021✔
1692

1693
                /// <remarks>
1694
                /// System variable LOFTANG1
1695
                /// </remarks>
1696
                [CadSystemVariable("$LOFTANG1", 40)]
1697
                public double DraftAngleFirstCrossSection { get; set; }
258✔
1698

1699
                /// <remarks>
1700
                /// System variable LOFTANG2
1701
                /// </remarks>
1702
                [CadSystemVariable("$LOFTANG2", 40)]
1703
                public double DraftAngleSecondCrossSection { get; set; }
258✔
1704

1705
                /// <remarks>
1706
                /// System variable LOFTMAG1
1707
                /// </remarks>
1708
                [CadSystemVariable("$LOFTMAG1", 40)]
1709
                public double DraftMagnitudeFirstCrossSection { get; set; }
258✔
1710

1711
                /// <remarks>
1712
                /// System variable LOFTMAG2
1713
                /// </remarks>
1714
                [CadSystemVariable("$LOFTMAG2", 40)]
1715
                public double DraftMagnitudeSecondCrossSection { get; set; }
258✔
1716

1717
                /// <remarks>
1718
                /// System variable 3DDWFPREC
1719
                /// </remarks>
1720
                [CadSystemVariable("$3DDWFPREC", 40)]
1721
                public double Dw3DPrecision { get; set; }
258✔
1722

1723
                /// <remarks>
1724
                /// System variable DWFFRAME
1725
                /// </remarks>
1726
                [CadSystemVariable("$DWFFRAME", 280)]
1727
                public char DwgUnderlayFramesVisibility { get; set; }
258✔
1728

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

1745
                /// <summary>
1746
                /// Line weight end-caps setting for new objects
1747
                /// </summary>
1748
                /// <remarks>
1749
                /// System variable ENDCAPS
1750
                /// </remarks>
1751
                [CadSystemVariable("$ENDCAPS", 280)]
1752
                public short EndCaps { get; set; }
387✔
1753

1754
                /// <summary>
1755
                /// Controls the object sorting methods
1756
                /// </summary>
1757
                /// <remarks>
1758
                /// System variable SORTENTS
1759
                /// </remarks>
1760
                [CadSystemVariable("$SORTENTS", 280)]
1761
                public ObjectSortingFlags EntitySortingFlags { get; set; }
323✔
1762

1763
                /// <summary>
1764
                /// Controls symbol table naming
1765
                /// </summary>
1766
                /// <remarks>
1767
                /// System variable EXTNAMES
1768
                /// </remarks>
1769
                [CadSystemVariable("$EXTNAMES", 290)]
1770
                public bool ExtendedNames { get; set; } = true;
1,133✔
1771

1772
                /// <summary>
1773
                /// Extension line lineweight
1774
                /// </summary>
1775
                /// <remarks>
1776
                /// System variable DIMLWE
1777
                /// </remarks>
1778
                [CadSystemVariable("$DIMLWE", 70)]
1779
                public LineweightType ExtensionLineWeight
1780
                {
1781
                        get { return this._dimensionStyleOverrides.ExtensionLineWeight; }
75✔
1782
                        set
1783
                        {
362✔
1784
                                this._dimensionStyleOverrides.ExtensionLineWeight = value;
362✔
1785
                        }
362✔
1786
                }
1787

1788
                /// <summary>
1789
                /// Controls the visibility of xref clipping boundaries
1790
                /// </summary>
1791
                /// <remarks>
1792
                /// System variable XCLIPFRAME
1793
                /// </remarks>
1794
                [CadSystemVariable("$XCLIPFRAME", 280)] //note: mismatch with docs, code 290
1795
                public byte ExternalReferenceClippingBoundaryType { get; set; }
323✔
1796

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

1820
                /// <summary>
1821
                /// Stores the current fillet radius for 2D objects.
1822
                /// </summary>
1823
                /// <remarks>
1824
                /// System variable FILLETRAD.
1825
                /// </remarks>
1826
                [CadSystemVariable("$FILLETRAD", 40)]
1827
                public double FilletRadius { get; set; } = 0.0d;
1,097✔
1828

1829
                /// <summary>
1830
                /// Specifies whether hatches and fills, 2D solids, and wide polylines are filled in.
1831
                /// </summary>
1832
                /// <remarks>
1833
                /// System variable FILLMODE.
1834
                /// </remarks>
1835
                [CadSystemVariable("$FILLMODE", 70)]
1836
                public bool FillMode { get; set; } = true;
1,097✔
1837

1838
                /// <summary>
1839
                /// Set at creation time, uniquely identifies a particular drawing
1840
                /// </summary>
1841
                /// <remarks>
1842
                /// System variable FINGERPRINTGUID
1843
                /// </remarks>
1844
                [CadSystemVariable("$FINGERPRINTGUID", 2)]
1845
                public string FingerPrintGuid { get; internal set; } = Guid.NewGuid().ToString();
1,031✔
1846

1847
                /// <summary>
1848
                /// 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
1849
                /// </summary>
1850
                /// <remarks>
1851
                /// System variable HALOGAP
1852
                /// </remarks>
1853
                [CadSystemVariable("$HALOGAP", 280)]
1854
                public byte HaloGapPercentage { get; set; } = 0;
967✔
1855

1856
                /// <summary>
1857
                /// Next available handle.
1858
                /// </summary>
1859
                /// <remarks>
1860
                /// System variable HANDSEED.
1861
                /// </remarks>
1862
                [CadSystemVariable("$HANDSEED", 5)]
1863
                public ulong HandleSeed { get; internal set; } = 0x0;
46,161✔
1864

1865
                /// <summary>
1866
                /// Specifies HIDETEXT system variable
1867
                /// </summary>
1868
                /// <remarks>
1869
                /// System variable HIDETEXT
1870
                /// </remarks>
1871
                [CadSystemVariable("$HIDETEXT", 280)]   //note: mismatch with docs, code 290
1872
                public byte HideText { get; set; }
323✔
1873

1874
                /// <summary>
1875
                /// Path for all relative hyperlinks in the drawing. If null, the drawing path is used
1876
                /// </summary>
1877
                /// <remarks>
1878
                /// System variable HYPERLINKBASE
1879
                /// </remarks>
1880
                [CadSystemVariable("$HYPERLINKBASE", 1)]
1881
                public string HyperLinkBase { get; set; }
387✔
1882

1883
                /// <summary>
1884
                /// Controls whether layer and spatial indexes are created and saved in drawing files
1885
                /// </summary>
1886
                /// <remarks>
1887
                /// System variable INDEXCTL
1888
                /// </remarks>
1889
                [CadSystemVariable("$INDEXCTL", 280)]
1890
                public IndexCreationFlags IndexCreationFlags { get; set; }
323✔
1891

1892
                /// <summary>
1893
                /// Default drawing units for blocks
1894
                /// </summary>
1895
                /// <remarks>
1896
                /// System variable INSUNITS
1897
                /// </remarks>
1898
                [CadSystemVariable("$INSUNITS", 70)]
1899
                public UnitsType InsUnits { get; set; } = UnitsType.Unitless;
1,133✔
1900

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

1910
                public byte IntersectionDisplay { get; set; }
141✔
1911

1912
                /// <summary>
1913
                /// Line weight joint setting for new objects
1914
                /// </summary>
1915
                /// <remarks>
1916
                /// System variable JOINSTYLE
1917
                /// </remarks>
1918
                [CadSystemVariable("$JOINSTYLE", 280)]
1919
                public short JoinStyle { get; set; }
387✔
1920

1921
                /// <summary>
1922
                /// Displays the name of the last person who modified the file
1923
                /// </summary>
1924
                /// <remarks>
1925
                /// System variable LASTSAVEDBY
1926
                /// </remarks>
1927
                [CadSystemVariable(DxfReferenceType.Ignored, "$LASTSAVEDBY", 3)]
1928
                public string LastSavedBy { get; set; } = "ACadSharp";
826✔
1929

1930
                /// <summary>
1931
                /// Specifies the latitude of the drawing model in decimal format.
1932
                /// </summary>
1933
                /// <remarks>
1934
                /// System variable LATITUDE
1935
                /// </remarks>
1936
                [CadSystemVariable("$LATITUDE", 40)]
1937
                public double Latitude { get; set; } = 37.7950d;
902✔
1938

1939
                /// <remarks>
1940
                /// System variable LENSLENGTH
1941
                /// </remarks>
1942
                [CadSystemVariable("$LENSLENGTH", 40)]
1943
                public double LensLength { get; set; }
258✔
1944

1945
                /// <summary>
1946
                /// Controls whether you can create objects outside the grid limits.
1947
                /// </summary>
1948
                /// <remarks>
1949
                /// System variable LIMCHECK.
1950
                /// </remarks>
1951
                [CadSystemVariable("$LIMCHECK", 70)]
1952
                public bool LimitCheckingOn { get; set; } = false;
1,097✔
1953

1954
                /// <summary>
1955
                /// Sets the linear units format for creating objects.
1956
                /// </summary>
1957
                /// <remarks>
1958
                /// System variable LUNITS.
1959
                /// </remarks>
1960
                [CadSystemVariable("$LUNITS", 70)]
1961
                public LinearUnitFormat LinearUnitFormat { get; set; } = LinearUnitFormat.Decimal;
1,199✔
1962

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

1983
                /// <summary>
1984
                /// Sets the global linetype scale factor.
1985
                /// </summary>
1986
                /// <remarks>
1987
                /// System variable LTSCALE.
1988
                /// </remarks>
1989
                [CadSystemVariable("$LTSCALE", 40)]
1990
                public double LineTypeScale { get; set; } = 1.0d;
1,199✔
1991

1992
                /// <remarks>
1993
                /// System variable OLESTARTUP
1994
                /// </remarks>
1995
                //[CadSystemVariable("$OLESTARTUP", 290)]
1996
                public bool LoadOLEObject { get; set; }
169✔
1997

1998
                /// <remarks>
1999
                /// System variable LOFTNORMALS
2000
                /// </remarks>
2001
                [CadSystemVariable("$LOFTNORMALS", 280)]
2002
                public char LoftedObjectNormals { get; set; }
258✔
2003

2004
                /// <summary>
2005
                /// Specifies the longitude of the drawing model in decimal format.
2006
                /// </summary>
2007
                /// <remarks>
2008
                /// System variable LONGITUDE
2009
                /// </remarks>
2010
                [CadSystemVariable("$LONGITUDE", 40)]
2011
                public double Longitude { get; set; } = -122.394d;
902✔
2012

2013
                /// <summary>
2014
                /// Maintenance version number(should be ignored)
2015
                /// </summary>
2016
                /// <remarks>
2017
                /// System variable ACADMAINTVER.
2018
                /// </remarks>
2019
                [CadSystemVariable(DxfReferenceType.Ignored, "$ACADMAINTVER", 70)]
2020
                public short MaintenanceVersion { get; internal set; }
2,186✔
2021

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

2031
                /// <summary>
2032
                /// Controls whether the current drawing uses imperial or metric hatch pattern and linetype files.
2033
                /// </summary>
2034
                /// <remarks>
2035
                /// System variable MEASUREMENT
2036
                /// </remarks>
2037
                [CadSystemVariable("$MEASUREMENT", 70)]
2038
                public MeasurementUnits MeasurementUnits { get; set; } = MeasurementUnits.Metric;
862✔
2039

2040
                /// <summary>
2041
                /// Name of menu file.
2042
                /// </summary>
2043
                /// <remarks>
2044
                /// System variable MENU.
2045
                /// </remarks>
2046
                [CadSystemVariable("$MENU", 1)]
2047
                public string MenuFileName { get; set; } = ".";
1,097✔
2048

2049
                /// <summary>
2050
                /// Controls how MIRROR reflects text.
2051
                /// </summary>
2052
                /// <remarks>
2053
                /// System variable MIRRTEXT.
2054
                /// </remarks>
2055
                [CadSystemVariable("$MIRRTEXT", 70)]
2056
                public bool MirrorText { get; set; } = false;
1,199✔
2057

2058
                /// <summary>
2059
                /// X, Y, and Z drawing extents upper-right corner(in WCS)
2060
                /// </summary>
2061
                /// <remarks>
2062
                /// System variable EXTMAX
2063
                /// </remarks>
2064
                [CadSystemVariable("$EXTMAX", 10, 20, 30)]
2065
                public XYZ ModelSpaceExtMax { get; set; }
453✔
2066

2067
                /// <summary>
2068
                /// X, Y, and Z drawing extents lower-left corner (in WCS)
2069
                /// </summary>
2070
                /// <remarks>
2071
                /// System variable EXTMIN
2072
                /// </remarks>
2073
                [CadSystemVariable("$EXTMIN", 10, 20, 30)]
2074
                public XYZ ModelSpaceExtMin { get; set; }
453✔
2075

2076
                /// <summary>
2077
                /// Insertion base set by BASE command(in WCS)
2078
                /// </summary>
2079
                /// <remarks>
2080
                /// System variable INSBASE
2081
                /// </remarks>
2082
                [CadSystemVariable("$INSBASE", 10, 20, 30)]
2083
                public XYZ ModelSpaceInsertionBase { get; set; } = XYZ.Zero;
1,289✔
2084

2085
                /// <summary>
2086
                /// XY drawing limits upper-right corner (in WCS)
2087
                /// </summary>
2088
                /// <remarks>
2089
                /// System variable LIMMAX
2090
                /// </remarks>
2091
                [CadSystemVariable("$LIMMAX", 10, 20)]
2092
                public XY ModelSpaceLimitsMax { get; set; }
453✔
2093

2094
                /// <summary>
2095
                /// XY drawing limits lower-left corner (in WCS)
2096
                /// </summary>
2097
                /// <remarks>
2098
                /// System variable LIMMIN
2099
                /// </remarks>
2100
                [CadSystemVariable("$LIMMIN", 10, 20)]
2101
                public XY ModelSpaceLimitsMin { get; set; }
453✔
2102

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

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

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

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

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

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

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

2173
                //TODO: How header UCS work??
2174
                public UCS ModelSpaceUcs { get; private set; } = new UCS();
2,486✔
2175

2176
                public UCS ModelSpaceUcsBase { get; private set; } = new UCS();
644✔
2177

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

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

2210
                /// <remarks>
2211
                /// System variable NORTHDIRECTION
2212
                /// </remarks>
2213
                [CadSystemVariable("$NORTHDIRECTION", 40)]
2214
                public double NorthDirection { get; set; }
258✔
2215

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

2225
                /// <summary>
2226
                /// Sets running object snaps.
2227
                /// </summary>
2228
                /// <remarks>
2229
                /// System variable OSMODE.
2230
                /// </remarks>
2231
                [CadSystemVariable("$OSMODE", 70)]
2232
                public ObjectSnapMode ObjectSnapMode { get; set; } = (ObjectSnapMode)4133;
710✔
2233

2234
                public Color ObscuredColor { get; set; }
141✔
2235

2236
                /// <remarks>
2237
                /// System variable OBSCUREDLTYPE
2238
                /// </remarks>
2239
                public byte ObscuredType { get; set; }
141✔
2240

2241
                /// <summary>
2242
                /// Constrains cursor movement to the perpendicular.
2243
                /// </summary>
2244
                /// <remarks>
2245
                /// System variable ORTHOMODE.
2246
                /// </remarks>
2247
                [CadSystemVariable("$ORTHOMODE", 70)]
2248
                public bool OrthoMode { get; set; } = false;
1,097✔
2249

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

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

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

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

2300
                /// <summary>
2301
                /// Paper space insertion base point.
2302
                /// </summary>
2303
                /// <remarks>
2304
                /// System variable PINSBASE.
2305
                /// </remarks>
2306
                [CadSystemVariable("$PINSBASE", 10, 20, 30)]
2307
                public XYZ PaperSpaceInsertionBase { get; set; } = XYZ.Zero;
1,061✔
2308

2309
                /// <summary>
2310
                /// Limits checking in paper space when nonzero.
2311
                /// </summary>
2312
                /// <remarks>
2313
                /// System variable PLIMCHECK.
2314
                /// </remarks>
2315
                [CadSystemVariable("$PLIMCHECK", 70)]
2316
                public bool PaperSpaceLimitsChecking { get; set; } = false;
1,097✔
2317

2318
                /// <summary>
2319
                /// XY drawing limits upper-right corner (in WCS).
2320
                /// </summary>
2321
                /// <remarks>
2322
                /// System variable PLIMMAX.
2323
                /// </remarks>
2324
                [CadSystemVariable("$PLIMMAX", 10, 20)]
2325
                public XY PaperSpaceLimitsMax { get; set; } = XY.Zero;
1,097✔
2326

2327
                /// <summary>
2328
                /// XY drawing limits lower-left corner(in WCS).
2329
                /// </summary>
2330
                /// <remarks>
2331
                /// System variable PLIMMIN.
2332
                /// </remarks>
2333
                [CadSystemVariable("$PLIMMIN", 10, 20)]
2334
                public XY PaperSpaceLimitsMin { get; set; } = XY.Zero;
1,097✔
2335

2336
                /// <summary>
2337
                /// Controls paper space linetype scaling.
2338
                /// </summary>
2339
                /// <remarks>
2340
                /// System variable PSLTSCALE.
2341
                /// </remarks>
2342
                [CadSystemVariable("$PSLTSCALE", 70)]
2343
                public SpaceLineTypeScaling PaperSpaceLineTypeScaling { get; set; } = SpaceLineTypeScaling.Normal;
1,199✔
2344

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

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

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

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

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

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

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

2415
                public UCS PaperSpaceUcs { get; private set; } = new UCS();
2,486✔
2416

2417
                public UCS PaperSpaceUcsBase { get; private set; } = new UCS();
644✔
2418

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

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

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

2467
                /// <summary>
2468
                /// Indicates whether the current drawing is in a Color-Dependent or Named Plot Style mode
2469
                /// </summary>
2470
                /// <remarks>
2471
                /// System variable PSTYLEMODE
2472
                /// </remarks>
2473
                [CadSystemVariable("$PSTYLEMODE", 290)]
2474
                public short PlotStyleMode { get; set; }
387✔
2475

2476
                /// <summary>
2477
                /// Controls how point objects are displayed.
2478
                /// </summary>
2479
                /// <remarks>
2480
                /// System variable PDMODE.
2481
                /// </remarks>
2482
                [CadSystemVariable("$PDMODE", 70)]
2483
                public short PointDisplayMode { get; set; } = 0;
1,199✔
2484

2485
                /// <summary>
2486
                /// Sets the display size for point objects.
2487
                /// </summary>
2488
                /// <remarks>
2489
                /// System variable PDSIZE.
2490
                /// </remarks>
2491
                [CadSystemVariable("$PDSIZE", 40)]
2492
                public double PointDisplaySize { get; set; } = 0.0d;
1,199✔
2493

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

2505
                /// <summary>
2506
                /// Stores the default polyline width.
2507
                /// </summary>
2508
                /// <remarks>
2509
                /// System variable PLINEWID.
2510
                /// </remarks>
2511
                [CadSystemVariable("$PLINEWID", 40)]
2512
                public double PolylineWidthDefault { get; set; } = 0.0d;
1,097✔
2513

2514
                /// <summary>
2515
                /// 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
2516
                /// </summary>
2517
                /// <remarks>
2518
                /// System variable PROJECTNAME
2519
                /// </remarks>
2520
                [CadSystemVariable("$PROJECTNAME", 1)]
2521
                public string ProjectName { get; set; }
323✔
2522

2523
                /// <summary>
2524
                /// Specifies whether images of proxy objects are saved in the drawing.
2525
                /// </summary>
2526
                /// <remarks>
2527
                /// System variable PROXYGRAPHICS.
2528
                /// </remarks>
2529
                [CadSystemVariable("$PROXYGRAPHICS", 70)]
2530
                public bool ProxyGraphics { get; set; } = true;
1,061✔
2531

2532
                /// <summary>
2533
                /// Quick Text mode on if nonzero
2534
                /// </summary>
2535
                /// <remarks>
2536
                /// System variable QTEXTMODE.
2537
                /// </remarks>
2538
                [CadSystemVariable("$QTEXTMODE", 70)]
2539
                public bool QuickTextMode { get; set; } = false;
1,097✔
2540

2541
                /// <summary>
2542
                /// Obsolete. Controls automatic regeneration of the drawing.
2543
                /// </summary>
2544
                /// <remarks>
2545
                /// System variable REGENMODE.
2546
                /// </remarks>
2547
                [CadSystemVariable("$REGENMODE", 70)]
2548
                public bool RegenerationMode { get; set; } = false;
1,097✔
2549

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

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

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

2584
                /// <summary>
2585
                /// Controls the shading of edges.
2586
                /// </summary>
2587
                /// <remarks>
2588
                /// System variable SHADEDGE.
2589
                /// </remarks>
2590
                [CadSystemVariable("$SHADEDGE", 70)]
2591
                public ShadeEdgeType ShadeEdge { get; set; } = ShadeEdgeType.FacesInEntityColorEdgesInBlack;
1,097✔
2592

2593
                /// <summary>
2594
                /// Shadow mode for a 3D object
2595
                /// </summary>
2596
                /// <remarks>
2597
                /// System variable CSHADOW
2598
                /// </remarks>
2599
                [CadSystemVariable("$CSHADOW", 280)]
2600
                public ShadowMode ShadowMode { get; set; }
258✔
2601

2602
                /// <summary>
2603
                /// Location of the ground shadow plane. This is a Z axis ordinate
2604
                /// </summary>
2605
                /// <remarks>
2606
                /// System variable SHADOWPLANELOCATION
2607
                /// </remarks>
2608
                [CadSystemVariable("$SHADOWPLANELOCATION", 40)]
2609
                public double ShadowPlaneLocation { get; set; }
258✔
2610

2611
                /// <summary>
2612
                /// Determines whether the Model tab or the most-recently accessed named layout tab is active.
2613
                /// </summary>
2614
                /// <remarks>
2615
                /// System variable TILEMODE.
2616
                /// </remarks>
2617
                [CadSystemVariable("$TILEMODE", 70)]
2618
                public bool ShowModelSpace { get; set; }
463✔
2619

2620
                /// <remarks>
2621
                /// System variable SHOWHIST
2622
                /// </remarks>
2623
                [CadSystemVariable("$SHOWHIST", 280)]
2624
                public char ShowSolidsHistory { get; set; }
258✔
2625

2626
                /// <summary>
2627
                /// Controls the display of helixes and smoothed mesh objects.
2628
                /// </summary>
2629
                /// <remarks>
2630
                /// System variable SPLFRAME.
2631
                /// </remarks>
2632
                [CadSystemVariable("$SPLFRAME", 70)]
2633
                public bool ShowSplineControlPoints { get; set; } = false;
1,097✔
2634

2635
                /// <summary>
2636
                /// Sketch record increment.
2637
                /// </summary>
2638
                /// <remarks>
2639
                /// System variable SKETCHINC.
2640
                /// </remarks>
2641
                [CadSystemVariable("$SKETCHINC", 40)]
2642
                public double SketchIncrement { get; set; } = 1.0d;
1,097✔
2643

2644
                /// <summary>
2645
                /// Determines the object type created by the SKETCH command.
2646
                /// </summary>
2647
                /// <remarks>
2648
                /// System variable SKPOLY.
2649
                /// </remarks>
2650
                [CadSystemVariable("$SKPOLY", 70)]
2651
                public bool SketchPolylines { get; set; } = false;
1,097✔
2652

2653
                /// <remarks>
2654
                /// System variable LOFTPARAM
2655
                /// </remarks>
2656
                [CadSystemVariable("$LOFTPARAM", 70)]
2657
                public short SolidLoftedShape { get; set; }
258✔
2658

2659
                /// <remarks>
2660
                /// System variable SOLIDHIST
2661
                /// </remarks>
2662
                [CadSystemVariable("$SOLIDHIST", 280)]
2663
                public char SolidsRetainHistory { get; set; }
258✔
2664

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

2674
                /// <summary>
2675
                /// Sets the type of curve generated by the Spline option of the PEDIT command.
2676
                /// </summary>
2677
                /// <remarks>
2678
                /// System variable SPLINETYPE.
2679
                /// </remarks>
2680
                [CadSystemVariable("$SPLINETYPE", 70)]
2681
                public SplineType SplineType { get; set; } = SplineType.CubicBSpline;
1,097✔
2682

2683
                /// <remarks>
2684
                /// System variable TSTACKALIGN, default = 1(not present in DXF)
2685
                /// </remarks>
2686
                public short StackedTextAlignment { get; internal set; } = 1;
813✔
2687

2688
                /// <remarks>
2689
                /// TSTACKSIZE, default = 70(not present in DXF)
2690
                /// </remarks>
2691
                public short StackedTextSizePercentage { get; internal set; } = 70;
813✔
2692

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

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

2725
                /// <remarks>
2726
                /// System variable STYLESHEET
2727
                /// </remarks>
2728
                [CadSystemVariable("$STYLESHEET", 1)]
2729
                public string StyleSheetName { get; set; }
387✔
2730

2731
                /// <summary>
2732
                /// Surface density (for PEDIT Smooth) in M direction.
2733
                /// </summary>
2734
                /// <remarks>
2735
                /// System variable SURFU.
2736
                /// </remarks>
2737
                [CadSystemVariable("$SURFU", 70)]
2738
                public short SurfaceDensityU { get; set; } = 6;
1,199✔
2739

2740
                /// <summary>
2741
                /// Surface density(for PEDIT Smooth) in N direction.
2742
                /// </summary>
2743
                /// <remarks>
2744
                /// System variable SURFV.
2745
                /// </remarks>
2746
                [CadSystemVariable("$SURFV", 70)]
2747
                public short SurfaceDensityV { get; set; } = 6;
1,199✔
2748

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

2768
                /// <summary>
2769
                /// Number of mesh tabulations in first direction.
2770
                /// </summary>
2771
                /// <remarks>
2772
                /// System variable SURFTAB1.
2773
                /// </remarks>
2774
                [CadSystemVariable("$SURFTAB1", 70)]
2775
                public short SurfaceMeshTabulationCount1 { get; set; } = 6;
1,097✔
2776

2777
                /// <summary>
2778
                /// Number of mesh tabulations in second direction.
2779
                /// </summary>
2780
                /// <remarks>
2781
                /// System variable SURFTAB2.
2782
                /// </remarks>
2783
                [CadSystemVariable("$SURFTAB2", 70)]
2784
                public short SurfaceMeshTabulationCount2 { get; set; } = 6;
1,097✔
2785

2786
                /// <summary>
2787
                /// Surface type for PEDIT Smooth.
2788
                /// </summary>
2789
                /// <remarks>
2790
                /// System variable SURFTYPE.
2791
                /// </remarks>
2792
                [CadSystemVariable("$SURFTYPE", 70)]
2793
                public short SurfaceType { get; set; } = 6;
1,097✔
2794

2795
                /// <remarks>
2796
                /// System variable PSOLHEIGHT
2797
                /// </remarks>
2798
                [CadSystemVariable("$PSOLHEIGHT", 40)]
2799
                public double SweptSolidHeight { get; set; }
258✔
2800

2801
                /// <remarks>
2802
                /// System variable PSOLWIDTH
2803
                /// </remarks>
2804
                [CadSystemVariable("$PSOLWIDTH", 40)]
2805
                public double SweptSolidWidth { get; set; }
258✔
2806

2807
                /// <summary>
2808
                /// Sets the default text height when creating new text objects.
2809
                /// </summary>
2810
                /// <remarks>
2811
                /// System variable TEXTSIZE.
2812
                /// </remarks>
2813
                [CadSystemVariable("$TEXTSIZE", 40)]
2814
                public double TextHeightDefault { get; set; } = 2.5d;
1,199✔
2815

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

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

2858
                /// <summary>
2859
                /// Sets the default 3D thickness property when creating 2D geometric objects.
2860
                /// </summary>
2861
                /// <remarks>
2862
                /// System variable THICKNESS.
2863
                /// </remarks>
2864
                [CadSystemVariable("$THICKNESS", 40)]
2865
                public double ThicknessDefault { get; set; } = 0.0d;
1,097✔
2866

2867
                /// <summary>
2868
                /// Sets the time zone for the sun in the drawing.
2869
                /// </summary>
2870
                /// <remarks>
2871
                /// 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.
2872
                /// <br/>
2873
                /// System variable TIMEZONE
2874
                /// </remarks>
2875
                [CadSystemVariable("$TIMEZONE", 70)]
2876
                public int TimeZone { get; set; } = 0;
902✔
2877

2878
                /// <summary>
2879
                /// Cumulative editing time for this drawing(see Special Handling of Date/Time Variables)
2880
                /// </summary>
2881
                /// <remarks>
2882
                /// System variable TDINDWG
2883
                /// </remarks>
2884
                [CadSystemVariable("$TDINDWG", 40)]
2885
                public TimeSpan TotalEditingTime { get; set; } = new TimeSpan();
1,199✔
2886

2887
                /// <summary>
2888
                /// Default trace width.
2889
                /// </summary>
2890
                /// <remarks>
2891
                /// System variable TRACEWID.
2892
                /// </remarks>
2893
                [CadSystemVariable("$TRACEWID", 40)]
2894
                public double TraceWidthDefault { get; set; }
453✔
2895

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

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

2928
                /// <summary>
2929
                /// Controls the display format for units.
2930
                /// </summary>
2931
                /// <remarks>
2932
                /// System variable UNITMODE.
2933
                /// </remarks>
2934
                [CadSystemVariable("$UNITMODE", 70)]
2935
                public short UnitMode { get; set; } = 0;
1,097✔
2936

2937
                /// <summary>
2938
                /// Universal date/time the drawing was created(see Special Handling of Date/Time Variables).
2939
                /// </summary>
2940
                /// <remarks>
2941
                /// System variable TDUCREATE.
2942
                /// </remarks>
2943
                [CadSystemVariable("$TDUCREATE", 40)]
2944
                public DateTime UniversalCreateDateTime { get; set; } = DateTime.UtcNow;
964✔
2945

2946
                /// <summary>
2947
                /// Universal date/time of the last update/save(see Special Handling of Date/Time Variables).
2948
                /// </summary>
2949
                /// <remarks>
2950
                /// System variable TDUUPDATE.
2951
                /// </remarks>
2952
                [CadSystemVariable("$TDUUPDATE", 40)]
2953
                public DateTime UniversalUpdateDateTime { get; set; } = DateTime.UtcNow;
983✔
2954

2955
                /// <summary>
2956
                /// Local date/time of last drawing update(see Special Handling of Date/Time Variables).
2957
                /// </summary>
2958
                /// <remarks>
2959
                /// System variable TDUPDATE.
2960
                /// </remarks>
2961
                [CadSystemVariable("$TDUPDATE", 40)]
2962
                public DateTime UpdateDateTime { get; set; } = DateTime.Now;
1,224✔
2963

2964
                /// <summary>
2965
                /// System variable DIMSHO
2966
                /// </summary>
2967
                [CadSystemVariable("$DIMSHO", 70)]
2968
                public bool UpdateDimensionsWhileDragging { get; set; } = true;
1,097✔
2969

2970
                /// <summary>
2971
                /// Real variable intended for use by third-party developers.
2972
                /// </summary>
2973
                /// <remarks>
2974
                /// System variable USERR1.
2975
                /// </remarks>
2976
                [CadSystemVariable("$USERR1", 40)]
2977
                public double UserDouble1 { get; set; }
453✔
2978

2979
                /// <summary>
2980
                /// Real variable intended for use by third-party developers.
2981
                /// </summary>
2982
                /// <remarks>
2983
                /// System variable USERR2.
2984
                /// </remarks>
2985
                [CadSystemVariable("$USERR2", 40)]
2986
                public double UserDouble2 { get; set; }
453✔
2987

2988
                /// <summary>
2989
                /// Real variable intended for use by third-party developers.
2990
                /// </summary>
2991
                /// <remarks>
2992
                /// System variable USERR3.
2993
                /// </remarks>
2994
                [CadSystemVariable("$USERR3", 40)]
2995
                public double UserDouble3 { get; set; }
453✔
2996

2997
                /// <summary>
2998
                /// Real variable intended for use by third-party developers.
2999
                /// </summary>
3000
                /// <remarks>
3001
                /// System variable USERR4.
3002
                /// </remarks>
3003
                [CadSystemVariable("$USERR4", 40)]
3004
                public double UserDouble4 { get; set; }
453✔
3005

3006
                /// <summary>
3007
                /// Real variable intended for use by third-party developers.
3008
                /// </summary>
3009
                /// <remarks>
3010
                /// System variable USERR5.
3011
                /// </remarks>
3012
                [CadSystemVariable("$USERR5", 40)]
3013
                public double UserDouble5 { get; set; }
453✔
3014

3015
                /// <summary>
3016
                /// User-elapsed timer
3017
                /// </summary>
3018
                /// <remarks>
3019
                /// System variable TDUSRTIMER
3020
                /// </remarks>
3021
                [CadSystemVariable("$TDUSRTIMER", 40)]
3022
                public TimeSpan UserElapsedTimeSpan { get; set; }
453✔
3023

3024
                /// <summary>
3025
                /// Integer variable intended for use by third-party developers.
3026
                /// </summary>
3027
                /// <remarks>
3028
                /// System variable USERI1.
3029
                /// </remarks>
3030
                [CadSystemVariable("$USERI1", 70)]
3031
                public short UserShort1 { get; set; } = 0;
1,097✔
3032

3033
                /// <summary>
3034
                /// Integer variable intended for use by third-party developers.
3035
                /// </summary>
3036
                /// <remarks>
3037
                /// System variable USERI2.
3038
                /// </remarks>
3039
                [CadSystemVariable("$USERI2", 70)]
3040
                public short UserShort2 { get; set; } = 0;
1,097✔
3041

3042
                /// <summary>
3043
                /// Integer variable intended for use by third-party developers.
3044
                /// </summary>
3045
                /// <remarks>
3046
                /// System variable USERI3.
3047
                /// </remarks>
3048
                [CadSystemVariable("$USERI3", 70)]
3049
                public short UserShort3 { get; set; } = 0;
1,097✔
3050

3051
                /// <summary>
3052
                /// Integer variable intended for use by third-party developers.
3053
                /// </summary>
3054
                /// <remarks>
3055
                /// System variable USERI4.
3056
                /// </remarks>
3057
                [CadSystemVariable("$USERI4", 70)]
3058
                public short UserShort4 { get; set; } = 0;
1,097✔
3059

3060
                /// <summary>
3061
                /// Integer variable intended for use by third-party developers.
3062
                /// </summary>
3063
                /// <remarks>
3064
                /// System variable USERI5.
3065
                /// </remarks>
3066
                [CadSystemVariable("$USERI5", 70)]
3067
                public short UserShort5 { get; set; } = 0;
1,097✔
3068

3069
                /// <summary>
3070
                /// Controls the user timer for the drawing.
3071
                /// </summary>
3072
                /// <remarks>
3073
                /// System variable USRTIMER.
3074
                /// </remarks>
3075
                [CadSystemVariable("$USRTIMER", 70)]
3076
                public bool UserTimer { get; set; } = false;
1,097✔
3077

3078
                public ACadVersion Version
3079
                {
3080
                        get { return this._version; }
68,040✔
3081
                        set
3082
                        {
1,355✔
3083
                                this._version = value;
1,355✔
3084

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

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

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

3138
                /// <summary>
3139
                /// View scale factor for new viewports.
3140
                /// </summary>
3141
                /// <remarks>
3142
                /// System variable PSVPSCALE.
3143
                /// </remarks>
3144
                [CadSystemVariable("$PSVPSCALE", 40)]
3145
                public double ViewportDefaultViewScaleFactor { get; set; }
387✔
3146

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

3156
                /// <summary>
3157
                /// Controls whether the current drawing can be edited in-place when being referenced by another drawing
3158
                /// </summary>
3159
                /// <remarks>
3160
                /// System variable XEDIT
3161
                /// </remarks>
3162
                [CadSystemVariable("$XEDIT", 290)]
3163
                public bool XEdit { get; set; }
387✔
3164

3165
                /// <summary>
3166
                /// Undocumented
3167
                /// </summary>
3168
                /// <remarks>
3169
                /// System variable DIMSAV
3170
                /// </remarks>
3171
                internal bool DIMSAV { get; set; }
30✔
3172

3173
                //Create enum for variable
3174
                private static readonly PropertyExpression<CadHeader, CadSystemVariableAttribute> _propertyCache;
3175

3176
                private short _angularUnitPrecision = 0;
644✔
3177
                private Layer _currentLayer = Layer.Default;
644✔
3178
                private LineType _currentLineType = LineType.ByLayer;
644✔
3179
                private MLineStyle _currentMLineStyle = MLineStyle.Default;
644✔
3180
                private TextStyle _currentTextStyle = TextStyle.Default;
644✔
3181
                private DimensionStyle _dimensionStyleOverrides = new DimensionStyle("override");
644✔
3182
                private DimensionStyle _currentDimensionStyle = DimensionStyle.Default;
644✔
3183
                private TextStyle _dimensionTextStyle = TextStyle.Default;
644✔
3184
                private double _facetResolution = 0.5;
644✔
3185
                private short _linearUnitPrecision = 4;
644✔
3186
                private double _stepsPerSecond = 2.0d;
644✔
3187
                private short _surfaceIsolineCount = 4;
644✔
3188
                private short _textQuality = 50;
644✔
3189
                private ACadVersion _version = ACadVersion.AC1032;
644✔
3190

3191
                static CadHeader()
3192
                {
1✔
3193
                        _propertyCache = new PropertyExpression<CadHeader, CadSystemVariableAttribute>(
1✔
3194
                                (info, attribute) => attribute.Name);
250✔
3195
                }
1✔
3196

3197
                public CadHeader() : this(ACadVersion.AC1032)
452✔
3198
                {
452✔
3199
                }
452✔
3200

3201
                public CadHeader(CadDocument document) : this(ACadVersion.AC1032)
192✔
3202
                {
192✔
3203
                        this.Document = document;
192✔
3204
                }
192✔
3205

3206
                public CadHeader(ACadVersion version)
644✔
3207
                {
644✔
3208
                        this.Version = version;
644✔
3209
                }
644✔
3210

3211
                /// <summary>
3212
                /// Gets a map of all the system variables and it's codes
3213
                /// </summary>
3214
                /// <returns></returns>
3215
                public static Dictionary<string, CadSystemVariable> GetHeaderMap()
3216
                {
311✔
3217
                        Dictionary<string, CadSystemVariable> map = new Dictionary<string, CadSystemVariable>();
311✔
3218
                        foreach (PropertyInfo p in typeof(CadHeader).GetProperties())
168,873✔
3219
                        {
83,970✔
3220
                                CadSystemVariableAttribute att = p.GetCustomAttribute<CadSystemVariableAttribute>();
83,970✔
3221
                                if (att == null)
83,970✔
3222
                                        continue;
6,531✔
3223

3224
                                map.Add(att.Name, new CadSystemVariable(p));
77,439✔
3225
                        }
77,439✔
3226

3227
                        return map;
311✔
3228
                }
311✔
3229

3230
                public object GetValue(string systemvar)
3231
                {
×
3232
                        var prop = _propertyCache.GetProperty(systemvar);
×
3233
                        return prop.Getter(this);
×
3234
                }
×
3235

3236
                /// <summary>
3237
                /// Get the primitive values in each dxf code
3238
                /// </summary>
3239
                /// <param name="systemvar"></param>
3240
                /// <returns>dictionary with the codes and values</returns>
3241
                public Dictionary<DxfCode, object> GetValues(string systemvar)
3242
                {
×
3243
                        Dictionary<DxfCode, object> value = null;
×
3244

3245
                        foreach (PropertyInfo p in this.GetType().GetProperties())
×
3246
                        {
×
3247
                                CadSystemVariableAttribute att = p.GetCustomAttribute<CadSystemVariableAttribute>();
×
3248
                                if (att == null)
×
3249
                                        continue;
×
3250

3251
                                if (att.Name == systemvar)
×
3252
                                {
×
3253
                                        value = new Dictionary<DxfCode, object>();
×
3254

3255
                                        if (att.ValueCodes.Length == 1)
×
3256
                                        {
×
3257
                                                value.Add(att.ValueCodes[0], p.GetValue(this));
×
3258
                                        }
×
3259
                                        else
3260
                                        {
×
3261
                                                IVector vector = (IVector)p.GetValue(this);
×
3262
                                                for (int i = 0; i < vector.Dimension; i++)
×
3263
                                                {
×
3264
                                                        value.Add(att.ValueCodes[i], vector[i]);
×
3265
                                                }
×
3266
                                        }
×
3267

3268
                                        break;
×
3269
                                }
3270
                        }
×
3271

3272
                        return value;
×
3273
                }
×
3274

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

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

3286
                        if (prop.Property.PropertyType.IsEnum)
54,116✔
3287
                        {
7,653✔
3288
                                int v = Convert.ToInt32(values.First());
7,653✔
3289
                                prop.Setter(this, Enum.ToObject(prop.Property.PropertyType, v));
7,653✔
3290
                        }
7,653✔
3291
                        else if (prop.Property.PropertyType.IsEquivalentTo(typeof(DateTime)))
46,463✔
3292
                        {
992✔
3293
                                double jvalue = (double)values.First();
992✔
3294

3295
                                prop.Setter(this, CadUtils.FromJulianCalendar((double)values.First()));
992✔
3296
                        }
992✔
3297
                        else if (prop.Property.PropertyType.IsEquivalentTo(typeof(TimeSpan)))
45,471✔
3298
                        {
520✔
3299
                                double jvalue = (double)values.First();
520✔
3300

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

3323
                /// <inheritdoc/>
3324
                public override string ToString()
3325
                {
×
3326
                        return $"{this.Version}";
×
3327
                }
×
3328
        }
3329
}
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