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

DomCR / ACadSharp / 17232220851

26 Aug 2025 08:16AM UTC coverage: 78.118% (+0.001%) from 78.117%
17232220851

push

github

web-flow
Merge pull request #736 from nanoLogika/20250815_mme_731/15-add-a-header-property-for-system-variable-cmleaderstyle

Header property for system variable CMLEADERSTYLE

6527 of 9083 branches covered (71.86%)

Branch coverage included in aggregate %.

35 of 57 new or added lines in 2 files covered. (61.4%)

3 existing lines in 1 file now uncovered.

25343 of 31714 relevant lines covered (79.91%)

104838.14 hits per line

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

85.96
/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.Data;
11
using System.Linq;
12
using System.Reflection;
13

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

1156
                public DimensionStyle CurrentDimensionStyle
1157
                {
1158
                        get
1159
                        {
250✔
1160
                                if (this.Document == null)
250!
1161
                                {
×
1162
                                        return this._currentDimensionStyle;
×
1163
                                }
1164
                                else
1165
                                {
250✔
1166
                                        return this.Document.DimensionStyles[this.CurrentDimensionStyleName];
250✔
1167
                                }
1168
                        }
250✔
1169
                        private set
1170
                        {
×
NEW
1171
                                this._currentDimensionStyle = value;
×
1172
                        }
×
1173
                }
1174

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

1198
                public MultiLeaderStyle CurrentMultiLeaderStyle
1199
                {
1200
                        get
1201
                        {
7✔
1202
                                if (this.Document == null) {
7!
NEW
1203
                                        return this._currentMultiLeaderStyle;
×
1204
                                }
1205
                                else {
7✔
1206
                                        return this.Document.MLeaderStyles[this.CurrentMultiLeaderStyleName];
7✔
1207
                                }
1208
                        }
7✔
NEW
1209
                        private set {
×
NEW
1210
                                this._currentMultiLeaderStyle = value;
×
NEW
1211
                        }
×
1212
                }
1213

1214
                public string CurrentMultiLeaderStyleName
1215
                {
1216
                        get
1217
                        {
10✔
1218
                                if (this.Document == null)
10!
NEW
1219
                                {
×
NEW
1220
                                        return this._currentMultiLeaderStyle.Name;
×
1221
                                }
1222
                                else
1223
                                {
10✔
1224
                                        DictionaryVariable variableDictionaryEntry = ensureVariableDictionaryEntryExists(this.Document, CadDictionary.CurrentMultiLeaderStyle, MultiLeaderStyle.DefaultName);
10✔
1225
                                        return variableDictionaryEntry.Value;
10✔
1226
                                }
1227
                        }
10✔
1228
                        set
1229
                        {
1✔
1230
                                if (string.IsNullOrEmpty(value))
1!
NEW
1231
                                {
×
NEW
1232
                                        throw new ArgumentNullException("value");
×
1233
                                }
1234
                                if (this.Document != null)
1!
1235
                                {
1✔
1236
                                        this._currentMultiLeaderStyle = this.Document.MLeaderStyles[value];
1✔
1237

1238
                                        //  There is no accessible system variable $CMLEADERSTYLE
1239
                                        //  The current MultiLeaderStyle name is held in the Variable Dictionary
1240
                                        //        create or update this entry
1241
                                        DictionaryVariable variableDictionaryEntry = ensureVariableDictionaryEntryExists(this.Document, CadDictionary.CurrentMultiLeaderStyle, MultiLeaderStyle.DefaultName);
1✔
1242
                                        variableDictionaryEntry.Value = value;
1✔
1243
                                }
1✔
1244
                                else
NEW
1245
                                {
×
NEW
1246
                                        this._currentMultiLeaderStyle = new MultiLeaderStyle(value);
×
NEW
1247
                                }
×
1248
                        }
1✔
1249
                }
1250

1251
                private static DictionaryVariable ensureVariableDictionaryEntryExists(CadDocument doc, string entryName, string value) {
11✔
1252
                        //        Ensure a Variable Dictionary exits
1253
                        var rootDictionary = doc.RootDictionary;
11✔
1254
                        if (!rootDictionary.TryGetEntry(CadDictionary.VariableDictionary, out CadDictionary variableDictionary))
11!
NEW
1255
                        {
×
NEW
1256
                                variableDictionary = new CadDictionary(CadDictionary.VariableDictionary);
×
NEW
1257
                                rootDictionary.Add(variableDictionary);
×
NEW
1258
                        }
×
1259

1260
                        if (!variableDictionary.TryGetEntry(entryName, out DictionaryVariable currentMultiLeaderStyleEntry))
11!
NEW
1261
                        {
×
NEW
1262
                                currentMultiLeaderStyleEntry = new DictionaryVariable();
×
NEW
1263
                                currentMultiLeaderStyleEntry.Name = entryName;
×
NEW
1264
                                currentMultiLeaderStyleEntry.Value = value;
×
NEW
1265
                                variableDictionary.Add(currentMultiLeaderStyleEntry);
×
NEW
1266
                        }
×
1267

1268
                        return currentMultiLeaderStyleEntry;
11✔
1269
                }
11✔
1270

1271
                /// <summary>
1272
                /// Suppression of first extension line.
1273
                /// </summary>
1274
                /// <remarks>
1275
                /// System variable DIMSD1
1276
                /// </remarks>
1277
                [CadSystemVariable("$DIMSD1", 70)]
1278
                public bool DimensionSuppressFirstDimensionLine
1279
                {
1280
                        get { return this._dimensionStyleOverrides.SuppressFirstDimensionLine; }
15✔
1281
                        set
1282
                        {
267✔
1283
                                this._dimensionStyleOverrides.SuppressFirstDimensionLine = value;
267✔
1284
                        }
267✔
1285
                }
1286

1287
                /// <summary>
1288
                /// First extension line suppressed if nonzero
1289
                /// </summary>
1290
                /// <remarks>
1291
                /// System variable DIMSE1
1292
                /// </remarks>
1293
                [CadSystemVariable("$DIMSE1", 70)]
1294
                public bool DimensionSuppressFirstExtensionLine
1295
                {
1296
                        get { return this._dimensionStyleOverrides.SuppressFirstExtensionLine; }
1,485✔
1297
                        set
1298
                        {
595✔
1299
                                this._dimensionStyleOverrides.SuppressFirstExtensionLine = value;
595✔
1300
                        }
595✔
1301
                }
1302

1303
                /// <summary>
1304
                /// Suppress outside-extensions dimension lines if nonzero
1305
                /// </summary>
1306
                /// <remarks>
1307
                /// System variable DIMSOXD
1308
                /// </remarks>
1309
                [CadSystemVariable("$DIMSOXD", 70)]
1310
                public bool DimensionSuppressOutsideExtensions
1311
                {
1312
                        get { return this._dimensionStyleOverrides.SuppressOutsideExtensions; }
750✔
1313
                        set
1314
                        {
451✔
1315
                                this._dimensionStyleOverrides.SuppressOutsideExtensions = value;
451✔
1316
                        }
451✔
1317
                }
1318

1319
                /// <summary>
1320
                /// Suppression of second extension line
1321
                /// </summary>
1322
                /// <remarks>
1323
                /// System variable DIMSD2
1324
                /// </remarks>
1325
                [CadSystemVariable("$DIMSD2", 70)]
1326
                public bool DimensionSuppressSecondDimensionLine
1327
                {
1328
                        get { return this._dimensionStyleOverrides.SuppressSecondDimensionLine; }
15✔
1329
                        set
1330
                        {
267✔
1331
                                this._dimensionStyleOverrides.SuppressSecondDimensionLine = value;
267✔
1332
                        }
267✔
1333
                }
1334

1335
                /// <summary>
1336
                /// Second extension line suppressed if nonzero
1337
                /// </summary>
1338
                /// <remarks>
1339
                /// System variable DIMSE2
1340
                /// </remarks>
1341
                [CadSystemVariable("$DIMSE2", 70)]
1342
                public bool DimensionSuppressSecondExtensionLine
1343
                {
1344
                        get { return this._dimensionStyleOverrides.SuppressSecondExtensionLine; }
1,485✔
1345
                        set
1346
                        {
595✔
1347
                                this._dimensionStyleOverrides.SuppressSecondExtensionLine = value;
595✔
1348
                        }
595✔
1349
                }
1350

1351
                /// <summary>
1352
                /// Undocumented
1353
                /// </summary>
1354
                /// <remarks>
1355
                /// System variable DIMLTEX1
1356
                /// </remarks>
1357
                [CadSystemVariable("$DIMLTEX1", 6)]
1358
                public string DimensionTex1 { get; set; } = "ByBlock";
1,399✔
1359

1360
                /// <summary>
1361
                /// Undocumented
1362
                /// </summary>
1363
                /// <remarks>
1364
                /// System variable DIMLTEX2
1365
                /// </remarks>
1366
                [CadSystemVariable("$DIMLTEX2", 6)]
1367
                public string DimensionTex2 { get; set; } = "ByBlock";
1,399✔
1368

1369
                /// <summary>
1370
                /// Undocumented
1371
                /// </summary>
1372
                /// <remarks>
1373
                /// System variable DIMTFILLCLR
1374
                /// </remarks>
1375
                [CadSystemVariable(DxfReferenceType.Ignored, "$DIMTFILLCLR", 62)]
1376
                public Color DimensionTextBackgroundColor
1377
                {
1378
                        get { return this._dimensionStyleOverrides.TextBackgroundColor; }
543✔
1379
                        set
1380
                        {
258✔
1381
                                this._dimensionStyleOverrides.TextBackgroundColor = value;
258✔
1382
                        }
258✔
1383
                }
1384

1385
                /// <summary>
1386
                /// Undocumented
1387
                /// </summary>
1388
                /// <remarks>
1389
                /// System variable DIMTFILL
1390
                /// </remarks>
1391
                [CadSystemVariable("$DIMTFILL", 70)]
1392
                public DimensionTextBackgroundFillMode DimensionTextBackgroundFillMode
1393
                {
1394
                        get { return this._dimensionStyleOverrides.TextBackgroundFillMode; }
543✔
1395
                        set
1396
                        {
258✔
1397
                                this._dimensionStyleOverrides.TextBackgroundFillMode = value;
258✔
1398
                        }
258✔
1399
                }
1400

1401
                /// <summary>
1402
                /// Dimension text color
1403
                /// </summary>
1404
                /// <remarks>
1405
                /// System variable DIMCLRT
1406
                /// </remarks>
1407
                [CadSystemVariable("$DIMCLRT", 70)]
1408
                public Color DimensionTextColor
1409
                {
1410
                        get { return this._dimensionStyleOverrides.TextColor; }
750✔
1411
                        set
1412
                        {
451✔
1413
                                this._dimensionStyleOverrides.TextColor = value;
451✔
1414
                        }
451✔
1415
                }
1416

1417
                /// <summary>
1418
                /// Undocumented
1419
                /// </summary>
1420
                /// <remarks>
1421
                /// System variable DIMTXTDIRECTION
1422
                /// </remarks>
1423
                [CadSystemVariable("$DIMTXTDIRECTION", 70)]
1424
                public TextDirection DimensionTextDirection
1425
                {
1426
                        get { return this._dimensionStyleOverrides.TextDirection; }
540✔
1427
                        set
1428
                        {
196✔
1429
                                this._dimensionStyleOverrides.TextDirection = value;
196✔
1430
                        }
196✔
1431
                }
1432

1433
                /// <summary>
1434
                /// Dimensioning text height
1435
                /// </summary>
1436
                /// <remarks>
1437
                /// System variable DIMTXT
1438
                /// </remarks>
1439
                [CadSystemVariable("$DIMTXT", 40)]
1440
                public double DimensionTextHeight
1441
                {
1442
                        get { return this._dimensionStyleOverrides.TextHeight; }
750✔
1443
                        set
1444
                        {
451✔
1445
                                this._dimensionStyleOverrides.TextHeight = value;
451✔
1446
                        }
451✔
1447
                }
1448

1449
                /// <summary>
1450
                /// Horizontal dimension text position
1451
                /// </summary>
1452
                /// <remarks>
1453
                /// System variable DIMJUST
1454
                /// </remarks>
1455
                [CadSystemVariable("$DIMJUST", 70)]
1456
                public DimensionTextHorizontalAlignment DimensionTextHorizontalAlignment
1457
                {
1458
                        get { return this._dimensionStyleOverrides.TextHorizontalAlignment; }
750✔
1459
                        set
1460
                        {
411✔
1461
                                this._dimensionStyleOverrides.TextHorizontalAlignment = value;
411✔
1462
                        }
411✔
1463
                }
1464

1465
                /// <summary>
1466
                /// Force text inside extensions if nonzero
1467
                /// </summary>
1468
                /// <remarks>
1469
                /// System variable DIMTIX
1470
                /// </remarks>
1471
                [CadSystemVariable("$DIMTIX", 70)]
1472
                public bool DimensionTextInsideExtensions
1473
                {
1474
                        get { return this._dimensionStyleOverrides.TextInsideExtensions; }
750✔
1475
                        set
1476
                        {
451✔
1477
                                this._dimensionStyleOverrides.TextInsideExtensions = value;
451✔
1478
                        }
451✔
1479
                }
1480

1481
                /// <summary>
1482
                /// Text inside horizontal if nonzero
1483
                /// </summary>
1484
                /// <remarks>
1485
                /// System variable DIMTIH
1486
                /// </remarks>
1487
                [CadSystemVariable("$DIMTIH", 70)]
1488
                public bool DimensionTextInsideHorizontal
1489
                {
1490
                        get { return this._dimensionStyleOverrides.TextInsideHorizontal; }
750✔
1491
                        set
1492
                        {
451✔
1493
                                this._dimensionStyleOverrides.TextInsideHorizontal = value;
451✔
1494
                        }
451✔
1495
                }
1496

1497
                /// <summary>
1498
                /// Dimension text movement rules decimal
1499
                /// </summary>
1500
                /// <remarks>
1501
                /// System variable DIMTMOVE
1502
                /// </remarks>
1503
                [CadSystemVariable("$DIMTMOVE", 70)]
1504
                public TextMovement DimensionTextMovement
1505
                {
1506
                        get { return this._dimensionStyleOverrides.TextMovement; }
735✔
1507
                        set
1508
                        {
386✔
1509
                                this._dimensionStyleOverrides.TextMovement = value;
386✔
1510
                        }
386✔
1511
                }
1512

1513
                /// <summary>
1514
                /// If text is outside the extension lines, dimension lines are forced between the extension lines if nonzero
1515
                /// </summary>
1516
                /// <remarks>
1517
                /// System variable DIMTOFL
1518
                /// </remarks>
1519
                [CadSystemVariable("$DIMTOFL", 70)]
1520
                public bool DimensionTextOutsideExtensions
1521
                {
1522
                        get { return this._dimensionStyleOverrides.TextOutsideExtensions; }
750✔
1523
                        set
1524
                        {
451✔
1525
                                this._dimensionStyleOverrides.TextOutsideExtensions = value;
451✔
1526
                        }
451✔
1527
                }
1528

1529
                /// <summary>
1530
                /// Text outside horizontal if nonzero
1531
                /// </summary>
1532
                /// <remarks>
1533
                /// System variable DIMTOH
1534
                /// </remarks>
1535
                [CadSystemVariable("$DIMTOH", 70)]
1536
                public bool DimensionTextOutsideHorizontal
1537
                {
1538
                        get { return this._dimensionStyleOverrides.TextOutsideHorizontal; }
750✔
1539
                        set
1540
                        {
451✔
1541
                                this._dimensionStyleOverrides.TextOutsideHorizontal = value;
451✔
1542
                        }
451✔
1543
                }
1544

1545
                public TextStyle DimensionTextStyle
1546
                {
1547
                        get
1548
                        {
250✔
1549
                                if (this.Document == null)
250!
1550
                                {
×
1551
                                        return this._dimensionTextStyle;
×
1552
                                }
1553
                                else
1554
                                {
250✔
1555
                                        return this.Document.TextStyles[this.DimensionTextStyleName];
250✔
1556
                                }
1557
                        }
250✔
1558
                        private set
1559
                        {
×
1560
                                this._dimensionTextStyle = value;
×
1561
                        }
×
1562
                }
1563

1564
                /// <summary>
1565
                /// Dimension text style
1566
                /// </summary>
1567
                /// <remarks>
1568
                /// System variable DIMTXSTY
1569
                /// </remarks>
1570
                [CadSystemVariable("$DIMTXSTY", true, 7)]
1571
                public string DimensionTextStyleName
1572
                {
1573
                        get { return this._dimensionTextStyle.Name; }
750✔
1574
                        set
1575
                        {
390✔
1576
                                if (this.Document != null)
390✔
1577
                                {
148✔
1578
                                        this._dimensionTextStyle = this.Document.TextStyles[value];
148✔
1579
                                }
148✔
1580
                                else
1581
                                {
242✔
1582
                                        this._dimensionTextStyle = new TextStyle(value);
242✔
1583
                                }
242✔
1584
                        }
390✔
1585
                }
1586

1587
                /// <summary>
1588
                /// Text above dimension line if nonzero
1589
                /// </summary>
1590
                /// <remarks>
1591
                /// System variable DIMTAD
1592
                /// </remarks>
1593
                [CadSystemVariable("$DIMTAD", 70)]
1594
                public DimensionTextVerticalAlignment DimensionTextVerticalAlignment
1595
                {
1596
                        get { return this._dimensionStyleOverrides.TextVerticalAlignment; }
750✔
1597
                        set
1598
                        {
451✔
1599
                                this._dimensionStyleOverrides.TextVerticalAlignment = value;
451✔
1600
                        }
451✔
1601
                }
1602

1603
                /// <summary>
1604
                /// Text vertical position
1605
                /// </summary>
1606
                /// <remarks>
1607
                /// System variable DIMTVP
1608
                /// </remarks>
1609
                [CadSystemVariable("$DIMTVP", 40)]
1610
                public double DimensionTextVerticalPosition
1611
                {
1612
                        get { return this._dimensionStyleOverrides.TextVerticalPosition; }
750✔
1613
                        set
1614
                        {
451✔
1615
                                this._dimensionStyleOverrides.TextVerticalPosition = value;
451✔
1616
                        }
451✔
1617
                }
1618

1619
                /// <summary>
1620
                /// Dimensioning tick size
1621
                /// </summary>
1622
                /// <remarks>
1623
                /// System variable DIMTSZ
1624
                /// </remarks>
1625
                [CadSystemVariable("$DIMTSZ", 40)]
1626
                public double DimensionTickSize
1627
                {
1628
                        get { return this._dimensionStyleOverrides.TickSize; }
750✔
1629
                        set
1630
                        {
451✔
1631
                                this._dimensionStyleOverrides.TickSize = value;
451✔
1632
                        }
451✔
1633
                }
1634

1635
                /// <summary>
1636
                /// Vertical justification for tolerance values
1637
                /// </summary>
1638
                /// <remarks>
1639
                /// System variable DIMTOLJ
1640
                /// </remarks>
1641
                [CadSystemVariable("$DIMTOLJ", 70)]
1642
                public ToleranceAlignment DimensionToleranceAlignment
1643
                {
1644
                        get { return this._dimensionStyleOverrides.ToleranceAlignment; }
750✔
1645
                        set
1646
                        {
411✔
1647
                                this._dimensionStyleOverrides.ToleranceAlignment = value;
411✔
1648
                        }
411✔
1649
                }
1650

1651
                /// <summary>
1652
                /// Number of decimal places to display the tolerance values
1653
                /// </summary>
1654
                /// <remarks>
1655
                /// System variable DIMTDEC
1656
                /// </remarks>
1657
                [CadSystemVariable("$DIMTDEC", 70)]
1658
                public short DimensionToleranceDecimalPlaces
1659
                {
1660
                        get { return this._dimensionStyleOverrides.ToleranceDecimalPlaces; }
750✔
1661
                        set
1662
                        {
411✔
1663
                                this._dimensionStyleOverrides.ToleranceDecimalPlaces = value;
411✔
1664
                        }
411✔
1665
                }
1666

1667
                /// <summary>
1668
                /// Dimension tolerance display scale factor
1669
                /// </summary>
1670
                /// <remarks>
1671
                /// System variable DIMTFAC
1672
                /// </remarks>
1673
                [CadSystemVariable("$DIMTFAC", 40)]
1674
                public double DimensionToleranceScaleFactor
1675
                {
1676
                        get { return this._dimensionStyleOverrides.ToleranceScaleFactor; }
750✔
1677
                        set
1678
                        {
451✔
1679
                                this._dimensionStyleOverrides.ToleranceScaleFactor = value;
451✔
1680
                        }
451✔
1681
                }
1682

1683
                /// <summary>
1684
                /// Controls suppression of zeros for tolerance values
1685
                /// </summary>
1686
                /// <remarks>
1687
                /// System variable DIMTZIN
1688
                /// </remarks>
1689
                [CadSystemVariable("$DIMTZIN", 70)]
1690
                public ZeroHandling DimensionToleranceZeroHandling
1691
                {
1692
                        get { return this._dimensionStyleOverrides.ToleranceZeroHandling; }
750✔
1693
                        set
1694
                        {
411✔
1695
                                this._dimensionStyleOverrides.ToleranceZeroHandling = value;
411✔
1696
                        }
411✔
1697
                }
1698

1699
                /// <summary>
1700
                /// Controls suppression of zeros for alternate unit dimension values
1701
                /// </summary>
1702
                /// <remarks>
1703
                /// System variable DIMUNIT
1704
                /// </remarks>
1705
                [CadSystemVariable("$DIMUNIT", 70)]
1706
                public short DimensionUnit
1707
                {
1708
                        get { return this._dimensionStyleOverrides.DimensionUnit; }
15✔
1709
                        set
1710
                        {
25✔
1711
                                this._dimensionStyleOverrides.DimensionUnit = value;
25✔
1712
                        }
25✔
1713
                }
1714

1715
                /// <summary>
1716
                /// Controls suppression of zeros for primary unit values
1717
                /// </summary>
1718
                /// <remarks>
1719
                /// System variable DIMZIN
1720
                /// </remarks>
1721
                [CadSystemVariable("$DIMZIN", 70)]
1722
                public ZeroHandling DimensionZeroHandling
1723
                {
1724
                        get { return this._dimensionStyleOverrides.ZeroHandling; }
750✔
1725
                        set
1726
                        {
451✔
1727
                                this._dimensionStyleOverrides.ZeroHandling = value;
451✔
1728
                        }
451✔
1729
                }
1730

1731
                /// <summary>
1732
                /// Get the <see cref="DimensionStyle"/> override for this document.
1733
                /// </summary>
1734
                public DimensionStyle DimensionstyleOverrides { get { return this._dimensionStyleOverrides; } }
×
1735

1736
                /// <remarks>
1737
                /// System variable LIGHTGLYPHDISPLAY
1738
                /// </remarks>
1739
                [CadSystemVariable("$LIGHTGLYPHDISPLAY", 280)]
1740
                public char DisplayLightGlyphs { get; set; }
439✔
1741

1742
                /// <summary>
1743
                /// Controls whether the lineweights of objects are displayed.<br/>
1744
                /// 0 = Lineweight is not displayed<br/>
1745
                /// 1 = Lineweight is displayed
1746
                /// </summary>
1747
                /// <remarks>
1748
                /// System variable LWDISPLAY
1749
                /// </remarks>
1750
                [CadSystemVariable("$LWDISPLAY", 290)]
1751
                public bool DisplayLineWeight { get; set; } = false;
2,520✔
1752

1753
                /// <summary>
1754
                /// Controls display of silhouette edges of 3D solid and surface objects in the Wireframe or 2D Wireframe visual styles.
1755
                /// </summary>
1756
                /// <remarks>
1757
                /// System variable DISPSILH.
1758
                /// </remarks>
1759
                [CadSystemVariable("$DISPSILH", 70)]
1760
                public bool DisplaySilhouetteCurves { get; set; } = false;
1,898✔
1761

1762
                /// <summary>
1763
                /// Document where this header resides
1764
                /// </summary>
1765
                public CadDocument Document { get; internal set; }
7,011✔
1766

1767
                /// <remarks>
1768
                /// System variable LOFTANG1
1769
                /// </remarks>
1770
                [CadSystemVariable("$LOFTANG1", 40)]
1771
                public double DraftAngleFirstCrossSection { get; set; }
439✔
1772

1773
                /// <remarks>
1774
                /// System variable LOFTANG2
1775
                /// </remarks>
1776
                [CadSystemVariable("$LOFTANG2", 40)]
1777
                public double DraftAngleSecondCrossSection { get; set; }
439✔
1778

1779
                /// <remarks>
1780
                /// System variable LOFTMAG1
1781
                /// </remarks>
1782
                [CadSystemVariable("$LOFTMAG1", 40)]
1783
                public double DraftMagnitudeFirstCrossSection { get; set; }
439✔
1784

1785
                /// <remarks>
1786
                /// System variable LOFTMAG2
1787
                /// </remarks>
1788
                [CadSystemVariable("$LOFTMAG2", 40)]
1789
                public double DraftMagnitudeSecondCrossSection { get; set; }
439✔
1790

1791
                /// <remarks>
1792
                /// System variable 3DDWFPREC
1793
                /// </remarks>
1794
                [CadSystemVariable("$3DDWFPREC", 40)]
1795
                public double Dw3DPrecision { get; set; }
439✔
1796

1797
                /// <remarks>
1798
                /// System variable DWFFRAME
1799
                /// </remarks>
1800
                [CadSystemVariable("$DWFFRAME", 280)]
1801
                public char DwgUnderlayFramesVisibility { get; set; }
439✔
1802

1803
                /// <summary>
1804
                /// Current elevation set by ELEV command
1805
                /// </summary>
1806
                /// <remarks>
1807
                /// System variable ELEVATION
1808
                /// </remarks>
1809
                [CadSystemVariable("$ELEVATION", 40)]
1810
                public double Elevation
1811
                {
1812
                        get { return this.ModelSpaceUcs.Elevation; }
750✔
1813
                        set
1814
                        {
451✔
1815
                                this.ModelSpaceUcs.Elevation = value;
451✔
1816
                        }
451✔
1817
                }
1818

1819
                /// <summary>
1820
                /// Line weight end-caps setting for new objects
1821
                /// </summary>
1822
                /// <remarks>
1823
                /// System variable ENDCAPS
1824
                /// </remarks>
1825
                [CadSystemVariable("$ENDCAPS", 280)]
1826
                public short EndCaps { get; set; }
631✔
1827

1828
                /// <summary>
1829
                /// Controls the object sorting methods
1830
                /// </summary>
1831
                /// <remarks>
1832
                /// System variable SORTENTS
1833
                /// </remarks>
1834
                [CadSystemVariable("$SORTENTS", 280)]
1835
                public ObjectSortingFlags EntitySortingFlags { get; set; }
563✔
1836

1837
                /// <summary>
1838
                /// Controls symbol table naming
1839
                /// </summary>
1840
                /// <remarks>
1841
                /// System variable EXTNAMES
1842
                /// </remarks>
1843
                [CadSystemVariable("$EXTNAMES", 290)]
1844
                public bool ExtendedNames { get; set; } = true;
2,520✔
1845

1846
                /// <summary>
1847
                /// Extension line lineweight
1848
                /// </summary>
1849
                /// <remarks>
1850
                /// System variable DIMLWE
1851
                /// </remarks>
1852
                [CadSystemVariable("$DIMLWE", 70)]
1853
                public LineweightType ExtensionLineWeight
1854
                {
1855
                        get { return this._dimensionStyleOverrides.ExtensionLineWeight; }
735✔
1856
                        set
1857
                        {
386✔
1858
                                this._dimensionStyleOverrides.ExtensionLineWeight = value;
386✔
1859
                        }
386✔
1860
                }
1861

1862
                /// <summary>
1863
                /// Controls the visibility of xref clipping boundaries
1864
                /// </summary>
1865
                /// <remarks>
1866
                /// System variable XCLIPFRAME
1867
                /// </remarks>
1868
                [CadSystemVariable("$XCLIPFRAME", 280)] //note: mismatch with docs, code 290
1869
                public byte ExternalReferenceClippingBoundaryType { get; set; }
563✔
1870

1871
                /// <summary>
1872
                /// Adjusts the smoothness of shaded and rendered objects, rendered shadows, and objects with hidden lines removed.
1873
                /// </summary>
1874
                /// <remarks>
1875
                /// System variable FACETRES.
1876
                /// </remarks>
1877
                /// <value>
1878
                /// Valid values are from 0.01 to 10.0.
1879
                /// </value>
1880
                [CadSystemVariable("$FACETRES", 40)]
1881
                public double FacetResolution
1882
                {
1883
                        get
1884
                        {
250✔
1885
                                return this._facetResolution;
250✔
1886
                        }
250✔
1887
                        set
1888
                        {
169✔
1889
                                ObjectExtensions.InRange(value, 0.01, 10, "FACETRES valid values are from 0.01 to 10.0");
169✔
1890
                                this._facetResolution = value;
169✔
1891
                        }
169✔
1892
                }
1893

1894
                /// <summary>
1895
                /// Stores the current fillet radius for 2D objects.
1896
                /// </summary>
1897
                /// <remarks>
1898
                /// System variable FILLETRAD.
1899
                /// </remarks>
1900
                [CadSystemVariable("$FILLETRAD", 40)]
1901
                public double FilletRadius { get; set; } = 0.0d;
1,938✔
1902

1903
                /// <summary>
1904
                /// Specifies whether hatches and fills, 2D solids, and wide polylines are filled in.
1905
                /// </summary>
1906
                /// <remarks>
1907
                /// System variable FILLMODE.
1908
                /// </remarks>
1909
                [CadSystemVariable("$FILLMODE", 70)]
1910
                public bool FillMode { get; set; } = true;
1,938✔
1911

1912
                /// <summary>
1913
                /// Set at creation time, uniquely identifies a particular drawing
1914
                /// </summary>
1915
                /// <remarks>
1916
                /// System variable FINGERPRINTGUID
1917
                /// </remarks>
1918
                [CadSystemVariable("$FINGERPRINTGUID", 2)]
1919
                public string FingerPrintGuid { get; internal set; } = Guid.NewGuid().ToString();
1,868✔
1920

1921
                /// <summary>
1922
                /// 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
1923
                /// </summary>
1924
                /// <remarks>
1925
                /// System variable HALOGAP
1926
                /// </remarks>
1927
                [CadSystemVariable("$HALOGAP", 280)]
1928
                public byte HaloGapPercentage { get; set; } = 0;
1,800✔
1929

1930
                /// <summary>
1931
                /// Next available handle.
1932
                /// </summary>
1933
                /// <remarks>
1934
                /// System variable HANDSEED.
1935
                /// </remarks>
1936
                [CadSystemVariable("$HANDSEED", 5)]
1937
                public ulong HandleSeed { get; internal set; } = 0x01;
1,585,526✔
1938

1939
                /// <summary>
1940
                /// Specifies HIDETEXT system variable
1941
                /// </summary>
1942
                /// <remarks>
1943
                /// System variable HIDETEXT
1944
                /// </remarks>
1945
                [CadSystemVariable("$HIDETEXT", 280)]   //note: mismatch with docs, code 290
1946
                public byte HideText { get; set; }
563✔
1947

1948
                /// <summary>
1949
                /// Path for all relative hyperlinks in the drawing. If null, the drawing path is used
1950
                /// </summary>
1951
                /// <remarks>
1952
                /// System variable HYPERLINKBASE
1953
                /// </remarks>
1954
                [CadSystemVariable("$HYPERLINKBASE", 1)]
1955
                public string HyperLinkBase { get; set; }
631✔
1956

1957
                /// <summary>
1958
                /// Controls whether layer and spatial indexes are created and saved in drawing files
1959
                /// </summary>
1960
                /// <remarks>
1961
                /// System variable INDEXCTL
1962
                /// </remarks>
1963
                [CadSystemVariable("$INDEXCTL", 280)]
1964
                public IndexCreationFlags IndexCreationFlags { get; set; }
563✔
1965

1966
                /// <summary>
1967
                /// Default drawing units for blocks
1968
                /// </summary>
1969
                /// <remarks>
1970
                /// System variable INSUNITS
1971
                /// </remarks>
1972
                [CadSystemVariable("$INSUNITS", 70)]
1973
                public UnitsType InsUnits { get; set; } = UnitsType.Unitless;
2,520✔
1974

1975
                /// <summary>
1976
                /// Represents the ACI color index of the "interference objects" created during the INTERFERE command. Default value is 1
1977
                /// </summary>
1978
                /// <remarks>
1979
                /// System variable INTERFERECOLOR
1980
                /// </remarks>
1981
                [CadSystemVariable("$INTERFERECOLOR", 62)]
1982
                public Color InterfereColor { get; set; } = new Color(1);
2,037✔
1983

1984
                public byte IntersectionDisplay { get; set; }
361✔
1985

1986
                /// <summary>
1987
                /// Line weight joint setting for new objects
1988
                /// </summary>
1989
                /// <remarks>
1990
                /// System variable JOINSTYLE
1991
                /// </remarks>
1992
                [CadSystemVariable("$JOINSTYLE", 280)]
1993
                public short JoinStyle { get; set; }
631✔
1994

1995
                /// <summary>
1996
                /// Displays the name of the last person who modified the file
1997
                /// </summary>
1998
                /// <remarks>
1999
                /// System variable LASTSAVEDBY
2000
                /// </remarks>
2001
                [CadSystemVariable(DxfReferenceType.Ignored, "$LASTSAVEDBY", 3)]
2002
                public string LastSavedBy { get; set; } = "ACadSharp";
1,439✔
2003

2004
                /// <summary>
2005
                /// Specifies the latitude of the drawing model in decimal format.
2006
                /// </summary>
2007
                /// <remarks>
2008
                /// System variable LATITUDE
2009
                /// </remarks>
2010
                [CadSystemVariable("$LATITUDE", 40)]
2011
                public double Latitude { get; set; } = 37.7950d;
1,676✔
2012

2013
                /// <remarks>
2014
                /// System variable LENSLENGTH
2015
                /// </remarks>
2016
                [CadSystemVariable("$LENSLENGTH", 40)]
2017
                public double LensLength { get; set; }
439✔
2018

2019
                /// <summary>
2020
                /// Controls whether you can create objects outside the grid limits.
2021
                /// </summary>
2022
                /// <remarks>
2023
                /// System variable LIMCHECK.
2024
                /// </remarks>
2025
                [CadSystemVariable("$LIMCHECK", 70)]
2026
                public bool LimitCheckingOn { get; set; } = false;
1,938✔
2027

2028
                /// <summary>
2029
                /// Sets the linear units format for creating objects.
2030
                /// </summary>
2031
                /// <remarks>
2032
                /// System variable LUNITS.
2033
                /// </remarks>
2034
                [CadSystemVariable("$LUNITS", 70)]
2035
                public LinearUnitFormat LinearUnitFormat { get; set; } = LinearUnitFormat.Decimal;
2,590✔
2036

2037
                /// <summary>
2038
                /// Sets the display precision for linear units and coordinates.
2039
                /// </summary>
2040
                /// <remarks>
2041
                /// System variable LUPREC.
2042
                /// </remarks>
2043
                [CadSystemVariable("$LUPREC", 70)]
2044
                public short LinearUnitPrecision
2045
                {
2046
                        get
2047
                        {
890✔
2048
                                return this._linearUnitPrecision;
890✔
2049
                        }
890✔
2050
                        set
2051
                        {
463✔
2052
                                ObjectExtensions.InRange(value, 0, 8, "LUPREC valid values are from 0 to 8");
463✔
2053
                                this._linearUnitPrecision = value;
463✔
2054
                        }
463✔
2055
                }
2056

2057
                /// <summary>
2058
                /// Sets the global linetype scale factor.
2059
                /// </summary>
2060
                /// <remarks>
2061
                /// System variable LTSCALE.
2062
                /// </remarks>
2063
                [CadSystemVariable("$LTSCALE", 40)]
2064
                public double LineTypeScale { get; set; } = 1.0d;
2,590✔
2065

2066
                /// <remarks>
2067
                /// System variable OLESTARTUP
2068
                /// </remarks>
2069
                //[CadSystemVariable("$OLESTARTUP", 290)]
2070
                public bool LoadOLEObject { get; set; }
389✔
2071

2072
                /// <remarks>
2073
                /// System variable LOFTNORMALS
2074
                /// </remarks>
2075
                [CadSystemVariable("$LOFTNORMALS", 280)]
2076
                public char LoftedObjectNormals { get; set; }
439✔
2077

2078
                /// <summary>
2079
                /// Specifies the longitude of the drawing model in decimal format.
2080
                /// </summary>
2081
                /// <remarks>
2082
                /// System variable LONGITUDE
2083
                /// </remarks>
2084
                [CadSystemVariable("$LONGITUDE", 40)]
2085
                public double Longitude { get; set; } = -122.394d;
1,676✔
2086

2087
                /// <summary>
2088
                /// Maintenance version number(should be ignored)
2089
                /// </summary>
2090
                /// <remarks>
2091
                /// System variable ACADMAINTVER.
2092
                /// </remarks>
2093
                [CadSystemVariable(DxfReferenceType.Ignored, "$ACADMAINTVER", 70)]
2094
                public short MaintenanceVersion { get; internal set; }
4,855✔
2095

2096
                /// <summary>
2097
                /// Sets the maximum number of viewports that can be active at one time in a layout.
2098
                /// </summary>
2099
                /// <remarks>
2100
                /// System variable MAXACTVP.
2101
                /// </remarks>
2102
                [CadSystemVariable("$MAXACTVP", 70)]
2103
                public short MaxViewportCount { get; set; } = 64;
1,938✔
2104

2105
                /// <summary>
2106
                /// Controls whether the current drawing uses imperial or metric hatch pattern and linetype files.
2107
                /// </summary>
2108
                /// <remarks>
2109
                /// System variable MEASUREMENT
2110
                /// </remarks>
2111
                [CadSystemVariable("$MEASUREMENT", 70)]
2112
                public MeasurementUnits MeasurementUnits { get; set; } = MeasurementUnits.Metric;
1,479✔
2113

2114
                /// <summary>
2115
                /// Name of menu file.
2116
                /// </summary>
2117
                /// <remarks>
2118
                /// System variable MENU.
2119
                /// </remarks>
2120
                [CadSystemVariable("$MENU", 1)]
2121
                public string MenuFileName { get; set; } = ".";
1,938✔
2122

2123
                /// <summary>
2124
                /// Controls how MIRROR reflects text.
2125
                /// </summary>
2126
                /// <remarks>
2127
                /// System variable MIRRTEXT.
2128
                /// </remarks>
2129
                [CadSystemVariable("$MIRRTEXT", 70)]
2130
                public bool MirrorText { get; set; } = false;
2,590✔
2131

2132
                /// <summary>
2133
                /// X, Y, and Z drawing extents upper-right corner(in WCS)
2134
                /// </summary>
2135
                /// <remarks>
2136
                /// System variable EXTMAX
2137
                /// </remarks>
2138
                [CadSystemVariable("$EXTMAX", 10, 20, 30)]
2139
                public XYZ ModelSpaceExtMax { get; set; }
701✔
2140

2141
                /// <summary>
2142
                /// X, Y, and Z drawing extents lower-left corner (in WCS)
2143
                /// </summary>
2144
                /// <remarks>
2145
                /// System variable EXTMIN
2146
                /// </remarks>
2147
                [CadSystemVariable("$EXTMIN", 10, 20, 30)]
2148
                public XYZ ModelSpaceExtMin { get; set; }
701✔
2149

2150
                /// <summary>
2151
                /// Insertion base set by BASE command(in WCS)
2152
                /// </summary>
2153
                /// <remarks>
2154
                /// System variable INSBASE
2155
                /// </remarks>
2156
                [CadSystemVariable("$INSBASE", 10, 20, 30)]
2157
                public XYZ ModelSpaceInsertionBase { get; set; } = XYZ.Zero;
3,230✔
2158

2159
                /// <summary>
2160
                /// XY drawing limits upper-right corner (in WCS)
2161
                /// </summary>
2162
                /// <remarks>
2163
                /// System variable LIMMAX
2164
                /// </remarks>
2165
                [CadSystemVariable("$LIMMAX", 10, 20)]
2166
                public XY ModelSpaceLimitsMax { get; set; }
701✔
2167

2168
                /// <summary>
2169
                /// XY drawing limits lower-left corner (in WCS)
2170
                /// </summary>
2171
                /// <remarks>
2172
                /// System variable LIMMIN
2173
                /// </remarks>
2174
                [CadSystemVariable("$LIMMIN", 10, 20)]
2175
                public XY ModelSpaceLimitsMin { get; set; }
701✔
2176

2177
                /// <summary>
2178
                /// Origin of current UCS(in WCS)
2179
                /// </summary>
2180
                /// <remarks>
2181
                /// System variable UCSORG
2182
                /// </remarks>
2183
                [CadSystemVariable("$UCSORG", 10, 20, 30)]
2184
                public XYZ ModelSpaceOrigin
2185
                {
2186
                        get { return this.ModelSpaceUcs.Origin; }
750✔
2187
                        set
2188
                        {
451✔
2189
                                this.ModelSpaceUcs.Origin = value;
451✔
2190
                        }
451✔
2191
                }
2192

2193
                /// <summary>
2194
                /// Point which becomes the new UCS origin after changing model space UCS to BACK when PUCSBASE is set to WORLD
2195
                /// </summary>
2196
                /// <remarks>
2197
                /// System variable UCSORGBACK
2198
                /// </remarks>
2199
                [CadSystemVariable("$UCSORGBACK", 10, 20, 30)]
2200
                public XYZ ModelSpaceOrthographicBackDOrigin { get; set; }
631✔
2201

2202
                /// <summary>
2203
                /// Point which becomes the new UCS origin after changing model space UCS to BOTTOM when PUCSBASE is set to WORLD
2204
                /// </summary>
2205
                /// <remarks>
2206
                /// System variable UCSORGBOTTOM
2207
                /// </remarks>
2208
                [CadSystemVariable("$UCSORGBOTTOM", 10, 20, 30)]
2209
                public XYZ ModelSpaceOrthographicBottomDOrigin { get; set; }
631✔
2210

2211
                /// <summary>
2212
                /// Point which becomes the new UCS origin after changing model space UCS to FRONT when PUCSBASE is set to WORLD
2213
                /// </summary>
2214
                /// <remarks>
2215
                /// System variable UCSORGFRONT
2216
                /// </remarks>
2217
                [CadSystemVariable("$UCSORGFRONT", 10, 20, 30)]
2218
                public XYZ ModelSpaceOrthographicFrontDOrigin { get; set; }
631✔
2219

2220
                /// <summary>
2221
                /// Point which becomes the new UCS origin after changing model space UCS to LEFT when PUCSBASE is set to WORLD
2222
                /// </summary>
2223
                /// <remarks>
2224
                /// System variable UCSORGLEFT
2225
                /// </remarks>
2226
                [CadSystemVariable("$UCSORGLEFT", 10, 20, 30)]
2227
                public XYZ ModelSpaceOrthographicLeftDOrigin { get; set; }
631✔
2228

2229
                /// <summary>
2230
                /// Point which becomes the new UCS origin after changing model space UCS to RIGHT when PUCSBASE is set to WORLD
2231
                /// </summary>
2232
                /// <remarks>
2233
                /// System variable UCSORGRIGHT
2234
                /// </remarks>
2235
                [CadSystemVariable("$UCSORGRIGHT", 10, 20, 30)]
2236
                public XYZ ModelSpaceOrthographicRightDOrigin { get; set; }
631✔
2237

2238
                /// <summary>
2239
                /// Point which becomes the new UCS origin after changing model space UCS to TOP when PUCSBASE is set to WORLD
2240
                /// </summary>
2241
                /// <remarks>
2242
                /// System variable UCSORGTOP
2243
                /// </remarks>
2244
                [CadSystemVariable("$UCSORGTOP", 10, 20, 30)]
2245
                public XYZ ModelSpaceOrthographicTopDOrigin { get; set; }
631✔
2246

2247
                //TODO: How header UCS work??
2248
                public UCS ModelSpaceUcs { get; private set; } = new UCS();
4,291✔
2249

2250
                public UCS ModelSpaceUcsBase { get; private set; } = new UCS();
1,237✔
2251

2252
                /// <summary>
2253
                /// Direction of the current UCS X axis (in WCS)
2254
                /// </summary>
2255
                /// <remarks>
2256
                /// System variable UCSXDIR
2257
                /// </remarks>
2258
                [CadSystemVariable("$UCSXDIR", 10, 20, 30)]
2259
                public XYZ ModelSpaceXAxis
2260
                {
2261
                        get { return this.ModelSpaceUcs.XAxis; }
750✔
2262
                        set
2263
                        {
451✔
2264
                                this.ModelSpaceUcs.XAxis = value;
451✔
2265
                        }
451✔
2266
                }
2267

2268
                /// <summary>
2269
                /// Direction of the current UCS Y axis (in WCS)
2270
                /// </summary>
2271
                /// <remarks>
2272
                /// System variable UCSYDIR
2273
                /// </remarks>
2274
                [CadSystemVariable("$UCSYDIR", 10, 20, 30)]
2275
                public XYZ ModelSpaceYAxis
2276
                {
2277
                        get { return this.ModelSpaceUcs.YAxis; }
750✔
2278
                        set
2279
                        {
451✔
2280
                                this.ModelSpaceUcs.YAxis = value;
451✔
2281
                        }
451✔
2282
                }
2283

2284
                /// <remarks>
2285
                /// System variable NORTHDIRECTION
2286
                /// </remarks>
2287
                [CadSystemVariable("$NORTHDIRECTION", 40)]
2288
                public double NorthDirection { get; set; }
439✔
2289

2290
                /// <summary>
2291
                /// Sets the number of line segments to be generated for each spline-fit polyline generated by the Spline option of the PEDIT command.
2292
                /// </summary>
2293
                /// <remarks>
2294
                /// System variable SPLINESEGS.
2295
                /// </remarks>
2296
                [CadSystemVariable("$SPLINESEGS", 70)]
2297
                public short NumberOfSplineSegments { get; set; } = 8;
2,590✔
2298

2299
                /// <summary>
2300
                /// Sets running object snaps.
2301
                /// </summary>
2302
                /// <remarks>
2303
                /// System variable OSMODE.
2304
                /// </remarks>
2305
                [CadSystemVariable("$OSMODE", 70)]
2306
                public ObjectSnapMode ObjectSnapMode { get; set; } = (ObjectSnapMode)4133;
1,307✔
2307

2308
                public Color ObscuredColor { get; set; }
361✔
2309

2310
                /// <remarks>
2311
                /// System variable OBSCUREDLTYPE
2312
                /// </remarks>
2313
                public byte ObscuredType { get; set; }
361✔
2314

2315
                /// <summary>
2316
                /// Constrains cursor movement to the perpendicular.
2317
                /// </summary>
2318
                /// <remarks>
2319
                /// System variable ORTHOMODE.
2320
                /// </remarks>
2321
                [CadSystemVariable("$ORTHOMODE", 70)]
2322
                public bool OrthoMode { get; set; } = false;
1,938✔
2323

2324
                /// <summary>
2325
                /// Name of the UCS that defines the origin and orientation of orthographic UCS settings (paper space only)
2326
                /// </summary>
2327
                /// <remarks>
2328
                /// System variable PUCSBASE
2329
                /// </remarks>
2330
                [CadSystemVariable("$PUCSBASE", true, 2)]
2331
                public string PaperSpaceBaseName
2332
                {
2333
                        get { return this.PaperSpaceUcsBase.Name; }
×
2334
                        set
2335
                        {
×
2336
                                this.PaperSpaceUcsBase.Name = value;
×
2337
                        }
×
2338
                }
2339

2340
                /// <summary>
2341
                /// Current elevation set by ELEV command
2342
                /// </summary>
2343
                /// <remarks>
2344
                /// System variable PELEVATION
2345
                /// </remarks>
2346
                [CadSystemVariable("$PELEVATION", 40)]
2347
                public double PaperSpaceElevation
2348
                {
2349
                        get { return this.PaperSpaceUcs.Elevation; }
750✔
2350
                        set
2351
                        {
451✔
2352
                                this.PaperSpaceUcs.Elevation = value;
451✔
2353
                        }
451✔
2354
                }
2355

2356
                /// <summary>
2357
                /// X, Y, and Z drawing extents upper-right corner(in WCS).
2358
                /// </summary>
2359
                /// <remarks>
2360
                /// System variable PEXTMAX.
2361
                /// </remarks>
2362
                [CadSystemVariable("$PEXTMAX", 10, 20, 30)]
2363
                public XYZ PaperSpaceExtMax { get; set; } = XYZ.Zero;
1,938✔
2364

2365
                /// <summary>
2366
                /// X, Y, and Z drawing extents lower-left corner (in WCS).
2367
                /// </summary>
2368
                /// <remarks>
2369
                /// System variable PEXTMIN.
2370
                /// </remarks>
2371
                [CadSystemVariable("$PEXTMIN", 10, 20, 30)]
2372
                public XYZ PaperSpaceExtMin { get; set; } = XYZ.Zero;
1,938✔
2373

2374
                /// <summary>
2375
                /// Paper space insertion base point.
2376
                /// </summary>
2377
                /// <remarks>
2378
                /// System variable PINSBASE.
2379
                /// </remarks>
2380
                [CadSystemVariable("$PINSBASE", 10, 20, 30)]
2381
                public XYZ PaperSpaceInsertionBase { get; set; } = XYZ.Zero;
1,898✔
2382

2383
                /// <summary>
2384
                /// Limits checking in paper space when nonzero.
2385
                /// </summary>
2386
                /// <remarks>
2387
                /// System variable PLIMCHECK.
2388
                /// </remarks>
2389
                [CadSystemVariable("$PLIMCHECK", 70)]
2390
                public bool PaperSpaceLimitsChecking { get; set; } = false;
1,938✔
2391

2392
                /// <summary>
2393
                /// XY drawing limits upper-right corner (in WCS).
2394
                /// </summary>
2395
                /// <remarks>
2396
                /// System variable PLIMMAX.
2397
                /// </remarks>
2398
                [CadSystemVariable("$PLIMMAX", 10, 20)]
2399
                public XY PaperSpaceLimitsMax { get; set; } = XY.Zero;
1,938✔
2400

2401
                /// <summary>
2402
                /// XY drawing limits lower-left corner(in WCS).
2403
                /// </summary>
2404
                /// <remarks>
2405
                /// System variable PLIMMIN.
2406
                /// </remarks>
2407
                [CadSystemVariable("$PLIMMIN", 10, 20)]
2408
                public XY PaperSpaceLimitsMin { get; set; } = XY.Zero;
1,938✔
2409

2410
                /// <summary>
2411
                /// Controls paper space linetype scaling.
2412
                /// </summary>
2413
                /// <remarks>
2414
                /// System variable PSLTSCALE.
2415
                /// </remarks>
2416
                [CadSystemVariable("$PSLTSCALE", 70)]
2417
                public SpaceLineTypeScaling PaperSpaceLineTypeScaling { get; set; } = SpaceLineTypeScaling.Normal;
2,590✔
2418

2419
                /// <summary>
2420
                /// Current paper space UCS name
2421
                /// </summary>
2422
                /// <remarks>
2423
                /// System variable PUCSNAME
2424
                /// </remarks>
2425
                [CadSystemVariable("$PUCSNAME", true, 2)]
2426
                public string PaperSpaceName
2427
                {
2428
                        get { return this.PaperSpaceUcs.Name; }
×
2429
                        set
2430
                        {
×
2431
                                this.PaperSpaceUcs.Name = value;
×
2432
                        }
×
2433
                }
2434

2435
                /// <summary>
2436
                /// Point which becomes the new UCS origin after changing paper space UCS to BACK when PUCSBASE is set to WORLD
2437
                /// </summary>
2438
                /// <remarks>
2439
                /// System variable PUCSORGBACK
2440
                /// </remarks>
2441
                [CadSystemVariable("$PUCSORGBACK", 10, 20, 30)]
2442
                public XYZ PaperSpaceOrthographicBackDOrigin { get; set; }
631✔
2443

2444
                /// <summary>
2445
                /// Point which becomes the new UCS origin after changing paper space UCS to BOTTOM when PUCSBASE is set to WORLD
2446
                /// </summary>
2447
                /// <remarks>
2448
                /// System variable PUCSORGBOTTOM
2449
                /// </remarks>
2450
                [CadSystemVariable("$PUCSORGBOTTOM", 10, 20, 30)]
2451
                public XYZ PaperSpaceOrthographicBottomDOrigin { get; set; }
631✔
2452

2453
                /// <summary>
2454
                /// Point which becomes the new UCS origin after changing paper space UCS to FRONT when PUCSBASE is set to WORLD
2455
                /// </summary>
2456
                /// <remarks>
2457
                /// System variable PUCSORGFRONT
2458
                /// </remarks>
2459
                [CadSystemVariable("$PUCSORGFRONT", 10, 20, 30)]
2460
                public XYZ PaperSpaceOrthographicFrontDOrigin { get; set; }
631✔
2461

2462
                /// <summary>
2463
                /// Point which becomes the new UCS origin after changing paper space UCS to LEFT when PUCSBASE is set to WORLD
2464
                /// </summary>
2465
                /// <remarks>
2466
                /// System variable PUCSORGLEFT
2467
                /// </remarks>
2468
                [CadSystemVariable("$PUCSORGLEFT", 10, 20, 30)]
2469
                public XYZ PaperSpaceOrthographicLeftDOrigin { get; set; }
631✔
2470

2471
                /// <summary>
2472
                /// Point which becomes the new UCS origin after changing paper space UCS to RIGHT when PUCSBASE is set to WORLD
2473
                /// </summary>
2474
                /// <remarks>
2475
                /// System variable PUCSORGRIGHT
2476
                /// </remarks>
2477
                [CadSystemVariable("$PUCSORGRIGHT", 10, 20, 30)]
2478
                public XYZ PaperSpaceOrthographicRightDOrigin { get; set; }
631✔
2479

2480
                /// <summary>
2481
                /// Point which becomes the new UCS origin after changing paper space UCS to TOP when PUCSBASE is set to WORLD
2482
                /// </summary>
2483
                /// <remarks>
2484
                /// System variable PUCSORGTOP
2485
                /// </remarks>
2486
                [CadSystemVariable("$PUCSORGTOP", 10, 20, 30)]
2487
                public XYZ PaperSpaceOrthographicTopDOrigin { get; set; }
631✔
2488

2489
                public UCS PaperSpaceUcs { get; private set; } = new UCS();
4,291✔
2490

2491
                public UCS PaperSpaceUcsBase { get; private set; } = new UCS();
1,237✔
2492

2493
                /// <summary>
2494
                /// Origin of current UCS (in WCS)
2495
                /// </summary>
2496
                /// <remarks>
2497
                /// System variable PUCSORG
2498
                /// </remarks>
2499
                [CadSystemVariable("$PUCSORG", 10, 20, 30)]
2500
                public XYZ PaperSpaceUcsOrigin
2501
                {
2502
                        get { return this.PaperSpaceUcs.Origin; }
750✔
2503
                        set
2504
                        {
451✔
2505
                                this.PaperSpaceUcs.Origin = value;
451✔
2506
                        }
451✔
2507
                }
2508

2509
                /// <summary>
2510
                /// Direction of the current UCS X axis (in WCS)
2511
                /// </summary>
2512
                /// <remarks>
2513
                /// System variable PUCSXDIR
2514
                /// </remarks>
2515
                [CadSystemVariable("$PUCSXDIR", 10, 20, 30)]
2516
                public XYZ PaperSpaceUcsXAxis
2517
                {
2518
                        get { return this.PaperSpaceUcs.XAxis; }
750✔
2519
                        set
2520
                        {
451✔
2521
                                this.PaperSpaceUcs.XAxis = value;
451✔
2522
                        }
451✔
2523
                }
2524

2525
                /// <summary>
2526
                /// Direction of the current UCS Y aYis (in WCS)
2527
                /// </summary>
2528
                /// <remarks>
2529
                /// System variable PUCSYDIR
2530
                /// </remarks>
2531
                [CadSystemVariable("$PUCSYDIR", 10, 20, 30)]
2532
                public XYZ PaperSpaceUcsYAxis
2533
                {
2534
                        get { return this.PaperSpaceUcs.YAxis; }
750✔
2535
                        set
2536
                        {
451✔
2537
                                this.PaperSpaceUcs.YAxis = value;
451✔
2538
                        }
451✔
2539
                }
2540

2541
                /// <summary>
2542
                /// Indicates whether the current drawing is in a Color-Dependent or Named Plot Style mode
2543
                /// </summary>
2544
                /// <remarks>
2545
                /// System variable PSTYLEMODE
2546
                /// </remarks>
2547
                [CadSystemVariable("$PSTYLEMODE", 290)]
2548
                public short PlotStyleMode { get; set; }
631✔
2549

2550
                /// <summary>
2551
                /// Controls how point objects are displayed.
2552
                /// </summary>
2553
                /// <remarks>
2554
                /// System variable PDMODE.
2555
                /// </remarks>
2556
                [CadSystemVariable("$PDMODE", 70)]
2557
                public short PointDisplayMode { get; set; } = 0;
2,590✔
2558

2559
                /// <summary>
2560
                /// Sets the display size for point objects.
2561
                /// </summary>
2562
                /// <remarks>
2563
                /// System variable PDSIZE.
2564
                /// </remarks>
2565
                [CadSystemVariable("$PDSIZE", 40)]
2566
                public double PointDisplaySize { get; set; } = 0.0d;
2,590✔
2567

2568
                /// <summary>
2569
                /// Governs the generation of linetype patterns around the vertices of a 2D polyline:<br/>
2570
                /// 1 = Linetype is generated in a continuous pattern around vertices of the polyline<br/>
2571
                /// 0 = Each segment of the polyline starts and ends with a dash
2572
                /// </summary>
2573
                /// <remarks>
2574
                /// System variable PLINEGEN
2575
                /// </remarks>
2576
                [CadSystemVariable("$PLINEGEN", 70)]
2577
                public bool PolylineLineTypeGeneration { get; set; } = false;
2,590✔
2578

2579
                /// <summary>
2580
                /// Stores the default polyline width.
2581
                /// </summary>
2582
                /// <remarks>
2583
                /// System variable PLINEWID.
2584
                /// </remarks>
2585
                [CadSystemVariable("$PLINEWID", 40)]
2586
                public double PolylineWidthDefault { get; set; } = 0.0d;
1,938✔
2587

2588
                /// <summary>
2589
                /// 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
2590
                /// </summary>
2591
                /// <remarks>
2592
                /// System variable PROJECTNAME
2593
                /// </remarks>
2594
                [CadSystemVariable("$PROJECTNAME", 1)]
2595
                public string ProjectName { get; set; }
563✔
2596

2597
                /// <summary>
2598
                /// Specifies whether images of proxy objects are saved in the drawing.
2599
                /// </summary>
2600
                /// <remarks>
2601
                /// System variable PROXYGRAPHICS.
2602
                /// </remarks>
2603
                [CadSystemVariable("$PROXYGRAPHICS", 70)]
2604
                public bool ProxyGraphics { get; set; } = true;
1,898✔
2605

2606
                /// <summary>
2607
                /// Quick Text mode on if nonzero
2608
                /// </summary>
2609
                /// <remarks>
2610
                /// System variable QTEXTMODE.
2611
                /// </remarks>
2612
                [CadSystemVariable("$QTEXTMODE", 70)]
2613
                public bool QuickTextMode { get; set; } = false;
1,938✔
2614

2615
                /// <summary>
2616
                /// Obsolete. Controls automatic regeneration of the drawing.
2617
                /// </summary>
2618
                /// <remarks>
2619
                /// System variable REGENMODE.
2620
                /// </remarks>
2621
                [CadSystemVariable("$REGENMODE", 70)]
2622
                public bool RegenerationMode { get; set; } = false;
1,938✔
2623

2624
                /// <summary>
2625
                /// The default value is 0.
2626
                /// Read only.
2627
                /// </summary>
2628
                /// <remarks>
2629
                /// System variable REQUIREDVERSIONS <br/>
2630
                /// Only in <see cref="ACadVersion.AC1024"/> or above
2631
                /// </remarks>
2632
                [CadSystemVariable(DxfReferenceType.Ignored, "$REQUIREDVERSIONS", 70)]
2633
                public long RequiredVersions { get; set; }
132✔
2634

2635
                /// <summary>
2636
                /// Controls the properties of xref-dependent layers: <br/>
2637
                /// 0 = Don't retain xref-dependent visibility settings <br/>
2638
                /// 1 = Retain xref-dependent visibility settings <br/>
2639
                /// </summary>
2640
                /// <remarks>
2641
                /// System variable VISRETAIN.
2642
                /// </remarks>
2643
                [CadSystemVariable("$VISRETAIN", 70)]
2644
                public bool RetainXRefDependentVisibilitySettings { get; set; } = true;
1,938✔
2645

2646
                /// <summary>
2647
                /// Sets the ratio of diffuse reflective light to ambient light.
2648
                /// </summary>
2649
                /// <remarks>
2650
                /// System variable SHADEDIF.
2651
                /// </remarks>
2652
                /// <value>
2653
                /// range 1-100
2654
                /// </value>
2655
                [CadSystemVariable("$SHADEDIF", 70)]
2656
                public short ShadeDiffuseToAmbientPercentage { get; set; } = 70;
1,938✔
2657

2658
                /// <summary>
2659
                /// Controls the shading of edges.
2660
                /// </summary>
2661
                /// <remarks>
2662
                /// System variable SHADEDGE.
2663
                /// </remarks>
2664
                [CadSystemVariable("$SHADEDGE", 70)]
2665
                public ShadeEdgeType ShadeEdge { get; set; } = ShadeEdgeType.FacesInEntityColorEdgesInBlack;
1,938✔
2666

2667
                /// <summary>
2668
                /// Shadow mode for a 3D object
2669
                /// </summary>
2670
                /// <remarks>
2671
                /// System variable CSHADOW
2672
                /// </remarks>
2673
                [CadSystemVariable("$CSHADOW", 280)]
2674
                public ShadowMode ShadowMode { get; set; }
439✔
2675

2676
                /// <summary>
2677
                /// Location of the ground shadow plane. This is a Z axis ordinate
2678
                /// </summary>
2679
                /// <remarks>
2680
                /// System variable SHADOWPLANELOCATION
2681
                /// </remarks>
2682
                [CadSystemVariable("$SHADOWPLANELOCATION", 40)]
2683
                public double ShadowPlaneLocation { get; set; }
439✔
2684

2685
                /// <summary>
2686
                /// Determines whether the Model tab or the most-recently accessed named layout tab is active.
2687
                /// </summary>
2688
                /// <remarks>
2689
                /// System variable TILEMODE.
2690
                /// </remarks>
2691
                [CadSystemVariable("$TILEMODE", 70)]
2692
                public bool ShowModelSpace { get; set; }
1,252✔
2693

2694
                /// <remarks>
2695
                /// System variable SHOWHIST
2696
                /// </remarks>
2697
                [CadSystemVariable("$SHOWHIST", 280)]
2698
                public char ShowSolidsHistory { get; set; }
439✔
2699

2700
                /// <summary>
2701
                /// Controls the display of helixes and smoothed mesh objects.
2702
                /// </summary>
2703
                /// <remarks>
2704
                /// System variable SPLFRAME.
2705
                /// </remarks>
2706
                [CadSystemVariable("$SPLFRAME", 70)]
2707
                public bool ShowSplineControlPoints { get; set; } = false;
1,938✔
2708

2709
                /// <summary>
2710
                /// Sketch record increment.
2711
                /// </summary>
2712
                /// <remarks>
2713
                /// System variable SKETCHINC.
2714
                /// </remarks>
2715
                [CadSystemVariable("$SKETCHINC", 40)]
2716
                public double SketchIncrement { get; set; } = 1.0d;
1,938✔
2717

2718
                /// <summary>
2719
                /// Determines the object type created by the SKETCH command.
2720
                /// </summary>
2721
                /// <remarks>
2722
                /// System variable SKPOLY.
2723
                /// </remarks>
2724
                [CadSystemVariable("$SKPOLY", 70)]
2725
                public bool SketchPolylines { get; set; } = false;
1,938✔
2726

2727
                /// <remarks>
2728
                /// System variable LOFTPARAM
2729
                /// </remarks>
2730
                [CadSystemVariable("$LOFTPARAM", 70)]
2731
                public short SolidLoftedShape { get; set; }
439✔
2732

2733
                /// <remarks>
2734
                /// System variable SOLIDHIST
2735
                /// </remarks>
2736
                [CadSystemVariable("$SOLIDHIST", 280)]
2737
                public char SolidsRetainHistory { get; set; }
439✔
2738

2739
                /// <summary>
2740
                /// Specifies the maximum depth, that is, the number of times the tree-structured spatial index can divide into branches.
2741
                /// </summary>
2742
                /// <remarks>
2743
                /// System variable TREEDEPTH.
2744
                /// </remarks>
2745
                [CadSystemVariable("$TREEDEPTH", 70)]
2746
                public short SpatialIndexMaxTreeDepth { get; set; } = 3020;
1,898✔
2747

2748
                /// <summary>
2749
                /// Sets the type of curve generated by the Spline option of the PEDIT command.
2750
                /// </summary>
2751
                /// <remarks>
2752
                /// System variable SPLINETYPE.
2753
                /// </remarks>
2754
                [CadSystemVariable("$SPLINETYPE", 70)]
2755
                public SplineType SplineType { get; set; } = SplineType.CubicBSpline;
1,938✔
2756

2757
                /// <remarks>
2758
                /// System variable TSTACKALIGN, default = 1(not present in DXF)
2759
                /// </remarks>
2760
                public short StackedTextAlignment { get; internal set; } = 1;
1,626✔
2761

2762
                /// <remarks>
2763
                /// TSTACKSIZE, default = 70(not present in DXF)
2764
                /// </remarks>
2765
                public short StackedTextSizePercentage { get; internal set; } = 70;
1,626✔
2766

2767
                /// <summary>
2768
                /// Specifies the size of each step when in walk or fly mode, in drawing units.
2769
                /// </summary>
2770
                /// <remarks>
2771
                /// System variable STEPSIZE
2772
                /// </remarks>
2773
                [CadSystemVariable("$STEPSIZE", 40)]
2774
                public double StepSize { get; set; } = 6.0d;
1,676✔
2775

2776
                /// <summary>
2777
                /// Specifies the number of steps taken per second when you are in walk or fly mode.
2778
                /// </summary>
2779
                /// <remarks>
2780
                /// System variable STEPSPERSEC
2781
                /// </remarks>
2782
                /// <value>
2783
                /// Valid values are from 1 to 30
2784
                /// </value>
2785
                [CadSystemVariable("$STEPSPERSEC", 40)]
2786
                public double StepsPerSecond
2787
                {
2788
                        get
2789
                        {
181✔
2790
                                return this._stepsPerSecond;
181✔
2791
                        }
181✔
2792
                        set
2793
                        {
258✔
2794
                                ObjectExtensions.InRange(value, 1, 30, "STEPSPERSEC valid values are from 1 to 30");
258✔
2795
                                this._stepsPerSecond = value;
258✔
2796
                        }
258✔
2797
                }
2798

2799
                /// <remarks>
2800
                /// System variable STYLESHEET
2801
                /// </remarks>
2802
                [CadSystemVariable("$STYLESHEET", 1)]
2803
                public string StyleSheetName { get; set; }
631✔
2804

2805
                /// <summary>
2806
                /// Surface density (for PEDIT Smooth) in M direction.
2807
                /// </summary>
2808
                /// <remarks>
2809
                /// System variable SURFU.
2810
                /// </remarks>
2811
                [CadSystemVariable("$SURFU", 70)]
2812
                public short SurfaceDensityU { get; set; } = 6;
2,590✔
2813

2814
                /// <summary>
2815
                /// Surface density(for PEDIT Smooth) in N direction.
2816
                /// </summary>
2817
                /// <remarks>
2818
                /// System variable SURFV.
2819
                /// </remarks>
2820
                [CadSystemVariable("$SURFV", 70)]
2821
                public short SurfaceDensityV { get; set; } = 6;
2,590✔
2822

2823
                /// <summary>
2824
                /// Specifies the number of contour lines displayed on the curved surfaces of 3D solids.
2825
                /// </summary>
2826
                /// <remarks>
2827
                /// System variable ISOLINES.
2828
                /// </remarks>
2829
                public short SurfaceIsolineCount
2830
                {
2831
                        get
2832
                        {
250✔
2833
                                return this._surfaceIsolineCount;
250✔
2834
                        }
250✔
2835
                        set
2836
                        {
169✔
2837
                                ObjectExtensions.InRange(value, 0, 2047, "ISOLINES valid values are from 0 to 2047");
169✔
2838
                                this._surfaceIsolineCount = value;
169✔
2839
                        }
169✔
2840
                }
2841

2842
                /// <summary>
2843
                /// Number of mesh tabulations in first direction.
2844
                /// </summary>
2845
                /// <remarks>
2846
                /// System variable SURFTAB1.
2847
                /// </remarks>
2848
                [CadSystemVariable("$SURFTAB1", 70)]
2849
                public short SurfaceMeshTabulationCount1 { get; set; } = 6;
1,938✔
2850

2851
                /// <summary>
2852
                /// Number of mesh tabulations in second direction.
2853
                /// </summary>
2854
                /// <remarks>
2855
                /// System variable SURFTAB2.
2856
                /// </remarks>
2857
                [CadSystemVariable("$SURFTAB2", 70)]
2858
                public short SurfaceMeshTabulationCount2 { get; set; } = 6;
1,938✔
2859

2860
                /// <summary>
2861
                /// Surface type for PEDIT Smooth.
2862
                /// </summary>
2863
                /// <remarks>
2864
                /// System variable SURFTYPE.
2865
                /// </remarks>
2866
                [CadSystemVariable("$SURFTYPE", 70)]
2867
                public short SurfaceType { get; set; } = 6;
1,938✔
2868

2869
                /// <remarks>
2870
                /// System variable PSOLHEIGHT
2871
                /// </remarks>
2872
                [CadSystemVariable("$PSOLHEIGHT", 40)]
2873
                public double SweptSolidHeight { get; set; }
439✔
2874

2875
                /// <remarks>
2876
                /// System variable PSOLWIDTH
2877
                /// </remarks>
2878
                [CadSystemVariable("$PSOLWIDTH", 40)]
2879
                public double SweptSolidWidth { get; set; }
439✔
2880

2881
                /// <summary>
2882
                /// Sets the default text height when creating new text objects.
2883
                /// </summary>
2884
                /// <remarks>
2885
                /// System variable TEXTSIZE.
2886
                /// </remarks>
2887
                [CadSystemVariable("$TEXTSIZE", 40)]
2888
                public double TextHeightDefault { get; set; } = 2.5d;
2,590✔
2889

2890
                /// <summary>
2891
                /// Sets the resolution of TrueType text for plotting and rendering.
2892
                /// </summary>
2893
                /// <remarks>
2894
                /// System variable TEXTQLTY.
2895
                /// </remarks>
2896
                public short TextQuality
2897
                {
2898
                        get
2899
                        {
250✔
2900
                                return this._textQuality;
250✔
2901
                        }
250✔
2902
                        set
2903
                        {
169✔
2904
                                ObjectExtensions.InRange(value, 0, 100, "TEXTQLTY valid values are from 0 to 100");
169✔
2905
                                this._textQuality = value;
169✔
2906
                        }
169✔
2907
                }
2908

2909
                /// <summary>
2910
                /// Sets the name of the current text style.
2911
                /// </summary>
2912
                /// <remarks>
2913
                /// System variable TEXTSTYLE.
2914
                /// </remarks>
2915
                [CadSystemVariable("$TEXTSTYLE", true, 7)]
2916
                public string TextStyleName
2917
                {
2918
                        get { return this._currentTextStyle.Name; }
2,817✔
2919
                        set
2920
                        {
442✔
2921
                                if (this.Document != null)
442✔
2922
                                {
148✔
2923
                                        this._currentTextStyle = this.Document.TextStyles[value];
148✔
2924
                                }
148✔
2925
                                else
2926
                                {
294✔
2927
                                        this._currentTextStyle = new TextStyle(value);
294✔
2928
                                }
294✔
2929
                        }
442✔
2930
                }
2931

2932
                /// <summary>
2933
                /// Sets the default 3D thickness property when creating 2D geometric objects.
2934
                /// </summary>
2935
                /// <remarks>
2936
                /// System variable THICKNESS.
2937
                /// </remarks>
2938
                [CadSystemVariable("$THICKNESS", 40)]
2939
                public double ThicknessDefault { get; set; } = 0.0d;
1,938✔
2940

2941
                /// <summary>
2942
                /// Sets the time zone for the sun in the drawing.
2943
                /// </summary>
2944
                /// <remarks>
2945
                /// 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.
2946
                /// <br/>
2947
                /// System variable TIMEZONE
2948
                /// </remarks>
2949
                [CadSystemVariable("$TIMEZONE", 70)]
2950
                public int TimeZone { get; set; } = 0;
1,676✔
2951

2952
                /// <summary>
2953
                /// Cumulative editing time for this drawing(see Special Handling of Date/Time Variables)
2954
                /// </summary>
2955
                /// <remarks>
2956
                /// System variable TDINDWG
2957
                /// </remarks>
2958
                [CadSystemVariable("$TDINDWG", 40)]
2959
                public TimeSpan TotalEditingTime { get; set; } = new TimeSpan();
2,590✔
2960

2961
                /// <summary>
2962
                /// Default trace width.
2963
                /// </summary>
2964
                /// <remarks>
2965
                /// System variable TRACEWID.
2966
                /// </remarks>
2967
                [CadSystemVariable("$TRACEWID", 40)]
2968
                public double TraceWidthDefault { get; set; }
701✔
2969

2970
                /// <summary>
2971
                /// Name of the UCS that defines the origin and orientation of orthographic UCS settings
2972
                /// </summary>
2973
                /// <remarks>
2974
                /// System variable UCSBASE
2975
                /// </remarks>
2976
                [CadSystemVariable("$UCSBASE", true, 2)]
2977
                public string UcsBaseName
2978
                {
2979
                        get { return this.ModelSpaceUcsBase.Name; }
×
2980
                        set
2981
                        {
×
2982
                                this.ModelSpaceUcsBase.Name = value;
×
2983
                        }
×
2984
                }
2985

2986
                /// <summary>
2987
                /// Name of current UCS
2988
                /// </summary>
2989
                /// <remarks>
2990
                /// System variable UCSNAME
2991
                /// </remarks>
2992
                [CadSystemVariable("$UCSNAME", true, 2)]
2993
                public string UcsName
2994
                {
2995
                        get { return this.ModelSpaceUcs.Name; }
×
2996
                        set
2997
                        {
×
2998
                                this.ModelSpaceUcs.Name = value;
×
2999
                        }
×
3000
                }
3001

3002
                /// <summary>
3003
                /// Controls the display format for units.
3004
                /// </summary>
3005
                /// <remarks>
3006
                /// System variable UNITMODE.
3007
                /// </remarks>
3008
                [CadSystemVariable("$UNITMODE", 70)]
3009
                public short UnitMode { get; set; } = 0;
1,938✔
3010

3011
                /// <summary>
3012
                /// Universal date/time the drawing was created(see Special Handling of Date/Time Variables).
3013
                /// </summary>
3014
                /// <remarks>
3015
                /// System variable TDUCREATE.
3016
                /// </remarks>
3017
                [CadSystemVariable("$TDUCREATE", 40)]
3018
                public DateTime UniversalCreateDateTime { get; set; } = DateTime.UtcNow;
2,131✔
3019

3020
                /// <summary>
3021
                /// Universal date/time of the last update/save(see Special Handling of Date/Time Variables).
3022
                /// </summary>
3023
                /// <remarks>
3024
                /// System variable TDUUPDATE.
3025
                /// </remarks>
3026
                [CadSystemVariable("$TDUUPDATE", 40)]
3027
                public DateTime UniversalUpdateDateTime { get; set; } = DateTime.UtcNow;
2,370✔
3028

3029
                /// <summary>
3030
                /// Local date/time of last drawing update(see Special Handling of Date/Time Variables).
3031
                /// </summary>
3032
                /// <remarks>
3033
                /// System variable TDUPDATE.
3034
                /// </remarks>
3035
                [CadSystemVariable("$TDUPDATE", 40)]
3036
                public DateTime UpdateDateTime { get; set; } = DateTime.Now;
2,835✔
3037

3038
                /// <summary>
3039
                /// System variable DIMSHO
3040
                /// </summary>
3041
                [CadSystemVariable("$DIMSHO", 70)]
3042
                public bool UpdateDimensionsWhileDragging { get; set; } = true;
1,938✔
3043

3044
                /// <summary>
3045
                /// Real variable intended for use by third-party developers.
3046
                /// </summary>
3047
                /// <remarks>
3048
                /// System variable USERR1.
3049
                /// </remarks>
3050
                [CadSystemVariable("$USERR1", 40)]
3051
                public double UserDouble1 { get; set; }
701✔
3052

3053
                /// <summary>
3054
                /// Real variable intended for use by third-party developers.
3055
                /// </summary>
3056
                /// <remarks>
3057
                /// System variable USERR2.
3058
                /// </remarks>
3059
                [CadSystemVariable("$USERR2", 40)]
3060
                public double UserDouble2 { get; set; }
701✔
3061

3062
                /// <summary>
3063
                /// Real variable intended for use by third-party developers.
3064
                /// </summary>
3065
                /// <remarks>
3066
                /// System variable USERR3.
3067
                /// </remarks>
3068
                [CadSystemVariable("$USERR3", 40)]
3069
                public double UserDouble3 { get; set; }
701✔
3070

3071
                /// <summary>
3072
                /// Real variable intended for use by third-party developers.
3073
                /// </summary>
3074
                /// <remarks>
3075
                /// System variable USERR4.
3076
                /// </remarks>
3077
                [CadSystemVariable("$USERR4", 40)]
3078
                public double UserDouble4 { get; set; }
701✔
3079

3080
                /// <summary>
3081
                /// Real variable intended for use by third-party developers.
3082
                /// </summary>
3083
                /// <remarks>
3084
                /// System variable USERR5.
3085
                /// </remarks>
3086
                [CadSystemVariable("$USERR5", 40)]
3087
                public double UserDouble5 { get; set; }
701✔
3088

3089
                /// <summary>
3090
                /// User-elapsed timer
3091
                /// </summary>
3092
                /// <remarks>
3093
                /// System variable TDUSRTIMER
3094
                /// </remarks>
3095
                [CadSystemVariable("$TDUSRTIMER", 40)]
3096
                public TimeSpan UserElapsedTimeSpan { get; set; }
701✔
3097

3098
                /// <summary>
3099
                /// Integer variable intended for use by third-party developers.
3100
                /// </summary>
3101
                /// <remarks>
3102
                /// System variable USERI1.
3103
                /// </remarks>
3104
                [CadSystemVariable("$USERI1", 70)]
3105
                public short UserShort1 { get; set; } = 0;
1,938✔
3106

3107
                /// <summary>
3108
                /// Integer variable intended for use by third-party developers.
3109
                /// </summary>
3110
                /// <remarks>
3111
                /// System variable USERI2.
3112
                /// </remarks>
3113
                [CadSystemVariable("$USERI2", 70)]
3114
                public short UserShort2 { get; set; } = 0;
1,938✔
3115

3116
                /// <summary>
3117
                /// Integer variable intended for use by third-party developers.
3118
                /// </summary>
3119
                /// <remarks>
3120
                /// System variable USERI3.
3121
                /// </remarks>
3122
                [CadSystemVariable("$USERI3", 70)]
3123
                public short UserShort3 { get; set; } = 0;
1,938✔
3124

3125
                /// <summary>
3126
                /// Integer variable intended for use by third-party developers.
3127
                /// </summary>
3128
                /// <remarks>
3129
                /// System variable USERI4.
3130
                /// </remarks>
3131
                [CadSystemVariable("$USERI4", 70)]
3132
                public short UserShort4 { get; set; } = 0;
1,938✔
3133

3134
                /// <summary>
3135
                /// Integer variable intended for use by third-party developers.
3136
                /// </summary>
3137
                /// <remarks>
3138
                /// System variable USERI5.
3139
                /// </remarks>
3140
                [CadSystemVariable("$USERI5", 70)]
3141
                public short UserShort5 { get; set; } = 0;
1,938✔
3142

3143
                /// <summary>
3144
                /// Controls the user timer for the drawing.
3145
                /// </summary>
3146
                /// <remarks>
3147
                /// System variable USRTIMER.
3148
                /// </remarks>
3149
                [CadSystemVariable("$USRTIMER", 70)]
3150
                public bool UserTimer { get; set; } = false;
1,938✔
3151

3152
                public ACadVersion Version
3153
                {
3154
                        get { return this._version; }
84,798✔
3155
                        set
3156
                        {
3,050✔
3157
                                this._version = value;
3,050✔
3158

3159
                                //Values are relevant for the dwgWriter, manually checked form dxf
3160
                                switch (value)
3,050✔
3161
                                {
3162
                                        case ACadVersion.AC1015:
3163
                                                this.MaintenanceVersion = 20;
81✔
3164
                                                break;
81✔
3165
                                        case ACadVersion.AC1018:
3166
                                                this.MaintenanceVersion = 104;
192✔
3167
                                                break;
192✔
3168
                                        case ACadVersion.AC1021:
3169
                                                this.MaintenanceVersion = 50;
135✔
3170
                                                break;
135✔
3171
                                        case ACadVersion.AC1024:
3172
                                                this.MaintenanceVersion = 226;
192✔
3173
                                                break;
192✔
3174
                                        case ACadVersion.AC1027:
3175
                                                this.MaintenanceVersion = 125;
192✔
3176
                                                break;
192✔
3177
                                        case ACadVersion.AC1032:
3178
                                                this.MaintenanceVersion = 228;
2,173✔
3179
                                                break;
2,173✔
3180
                                        default:
3181
                                                this.MaintenanceVersion = 0;
85✔
3182
                                                break;
85✔
3183
                                }
3184
                        }
3,050✔
3185
                }
3186

3187
                /// <summary>
3188
                /// Uniquely identifies a particular version of a drawing. Updated when the drawing is modified
3189
                /// </summary>
3190
                /// <remarks>
3191
                /// System variable VERSIONGUID
3192
                /// </remarks>
3193
                [CadSystemVariable("$VERSIONGUID", 2)]
3194
                public string VersionGuid { get; internal set; } = Guid.NewGuid().ToString();
1,868✔
3195

3196
                /// <summary>
3197
                /// The Drawing database version number.
3198
                /// </summary>
3199
                /// <remarks>
3200
                /// System variable ACADVER.
3201
                /// </remarks>
3202
                [CadSystemVariable("$ACADVER", DxfCode.Text)]
3203
                public string VersionString
3204
                {
3205
                        get { return this.Version.ToString(); }
2,646✔
3206
                        set
3207
                        {
294✔
3208
                                this.Version = CadUtils.GetVersionFromName(value);
294✔
3209
                        }
294✔
3210
                }
3211

3212
                /// <summary>
3213
                /// View scale factor for new viewports.
3214
                /// </summary>
3215
                /// <remarks>
3216
                /// System variable PSVPSCALE.
3217
                /// </remarks>
3218
                [CadSystemVariable("$PSVPSCALE", 40)]
3219
                public double ViewportDefaultViewScaleFactor { get; set; }
631✔
3220

3221
                /// <summary>
3222
                /// Determines whether input to the DVIEW and VPOINT commands is relative to the WCS (default) or the current UCS.
3223
                /// </summary>
3224
                /// <remarks>
3225
                /// System variable WORLDVIEW.
3226
                /// </remarks>
3227
                [CadSystemVariable("$WORLDVIEW", 70)]
3228
                public bool WorldView { get; set; } = true;
1,938✔
3229

3230
                /// <summary>
3231
                /// Controls whether the current drawing can be edited in-place when being referenced by another drawing
3232
                /// </summary>
3233
                /// <remarks>
3234
                /// System variable XEDIT
3235
                /// </remarks>
3236
                [CadSystemVariable("$XEDIT", 290)]
3237
                public bool XEdit { get; set; }
631✔
3238

3239
                /// <summary>
3240
                /// Undocumented
3241
                /// </summary>
3242
                /// <remarks>
3243
                /// System variable DIMSAV
3244
                /// </remarks>
3245
                internal bool DIMSAV { get; set; }
30✔
3246

3247
                //Create enum for variable
3248
                private static readonly PropertyExpression<CadHeader, CadSystemVariableAttribute> _propertyCache;
3249

3250
                private short _angularUnitPrecision = 0;
1,237✔
3251
                private Layer _currentLayer = Layer.Default;
1,237✔
3252
                private LineType _currentLineType = LineType.ByLayer;
1,237✔
3253
                private MLineStyle _currentMLineStyle = MLineStyle.Default;
1,237✔
3254
                private TextStyle _currentTextStyle = TextStyle.Default;
1,237✔
3255
                private DimensionStyle _dimensionStyleOverrides = new DimensionStyle("override");
1,237✔
3256
                private DimensionStyle _currentDimensionStyle = DimensionStyle.Default;
1,237✔
3257
                private MultiLeaderStyle _currentMultiLeaderStyle = MultiLeaderStyle.Default;
1,237✔
3258
                private TextStyle _dimensionTextStyle = TextStyle.Default;
1,237✔
3259
                private double _facetResolution = 0.5;
1,237✔
3260
                private short _linearUnitPrecision = 4;
1,237✔
3261
                private double _stepsPerSecond = 2.0d;
1,237✔
3262
                private short _surfaceIsolineCount = 4;
1,237✔
3263
                private short _textQuality = 50;
1,237✔
3264
                private ACadVersion _version = ACadVersion.AC1032;
1,237✔
3265

3266
                static CadHeader()
3267
                {
1✔
3268
                        _propertyCache = new PropertyExpression<CadHeader, CadSystemVariableAttribute>(
1✔
3269
                                (info, attribute) => attribute.Name);
250✔
3270
                }
1✔
3271

3272
                public CadHeader() : this(ACadVersion.AC1032)
480✔
3273
                {
480✔
3274
                }
480✔
3275

3276
                public CadHeader(CadDocument document) : this(ACadVersion.AC1032)
757✔
3277
                {
757✔
3278
                        this.Document = document;
757✔
3279
                }
757✔
3280

3281
                public CadHeader(ACadVersion version)
1,237✔
3282
                {
1,237✔
3283
                        this.Version = version;
1,237✔
3284
                }
1,237✔
3285

3286
                /// <summary>
3287
                /// Gets a map of all the system variables and it's codes
3288
                /// </summary>
3289
                /// <returns></returns>
3290
                public static Dictionary<string, CadSystemVariable> GetHeaderMap()
3291
                {
614✔
3292
                        Dictionary<string, CadSystemVariable> map = new Dictionary<string, CadSystemVariable>();
614✔
3293
                        foreach (PropertyInfo p in typeof(CadHeader).GetProperties())
335,858✔
3294
                        {
167,008✔
3295
                                CadSystemVariableAttribute att = p.GetCustomAttribute<CadSystemVariableAttribute>();
167,008✔
3296
                                if (att == null)
167,008✔
3297
                                        continue;
14,122✔
3298

3299
                                map.Add(att.Name, new CadSystemVariable(p));
152,886✔
3300
                        }
152,886✔
3301

3302
                        return map;
614✔
3303
                }
614✔
3304

3305
                public object GetValue(string systemvar)
3306
                {
×
3307
                        var prop = _propertyCache.GetProperty(systemvar);
×
3308
                        return prop.Getter(this);
×
3309
                }
×
3310

3311
                /// <summary>
3312
                /// Get the primitive values in each dxf code
3313
                /// </summary>
3314
                /// <param name="systemvar"></param>
3315
                /// <returns>dictionary with the codes and values</returns>
3316
                public Dictionary<DxfCode, object> GetValues(string systemvar)
3317
                {
×
3318
                        Dictionary<DxfCode, object> value = null;
×
3319

3320
                        foreach (PropertyInfo p in this.GetType().GetProperties())
×
3321
                        {
×
3322
                                CadSystemVariableAttribute att = p.GetCustomAttribute<CadSystemVariableAttribute>();
×
3323
                                if (att == null)
×
3324
                                        continue;
×
3325

3326
                                if (att.Name == systemvar)
×
3327
                                {
×
3328
                                        value = new Dictionary<DxfCode, object>();
×
3329

3330
                                        if (att.ValueCodes.Length == 1)
×
3331
                                        {
×
3332
                                                value.Add(att.ValueCodes[0], p.GetValue(this));
×
3333
                                        }
×
3334
                                        else
3335
                                        {
×
3336
                                                IVector vector = (IVector)p.GetValue(this);
×
3337
                                                for (int i = 0; i < vector.Dimension; i++)
×
3338
                                                {
×
3339
                                                        value.Add(att.ValueCodes[i], vector[i]);
×
3340
                                                }
×
3341
                                        }
×
3342

3343
                                        break;
×
3344
                                }
3345
                        }
×
3346

3347
                        return value;
×
3348
                }
×
3349

3350
                /// <summary>
3351
                /// Set a value of a system variable by name
3352
                /// </summary>
3353
                /// <param name="systemvar">name of the system var</param>
3354
                /// <param name="values">parameters for the constructor of the value</param>
3355
                public void SetValue(string systemvar, params object[] values)
3356
                {
60,024✔
3357
                        PropertyExpression<CadHeader, CadSystemVariableAttribute>.Prop prop = _propertyCache.GetProperty(systemvar);
60,024✔
3358

3359
                        ConstructorInfo constr = prop.Property.PropertyType.GetConstructor(values.Select(o => o.GetType()).ToArray());
133,696✔
3360

3361
                        if (prop.Property.PropertyType.IsEnum)
60,024✔
3362
                        {
8,485✔
3363
                                int v = Convert.ToInt32(values.First());
8,485✔
3364
                                prop.Setter(this, Enum.ToObject(prop.Property.PropertyType, v));
8,485✔
3365
                        }
8,485✔
3366
                        else if (prop.Property.PropertyType.IsEquivalentTo(typeof(DateTime)))
51,539✔
3367
                        {
1,096✔
3368
                                double jvalue = (double)values.First();
1,096✔
3369

3370
                                prop.Setter(this, CadUtils.FromJulianCalendar((double)values.First()));
1,096✔
3371
                        }
1,096✔
3372
                        else if (prop.Property.PropertyType.IsEquivalentTo(typeof(TimeSpan)))
50,443✔
3373
                        {
576✔
3374
                                double jvalue = (double)values.First();
576✔
3375

3376
                                prop.Setter(this, CadUtils.EditingTime((double)values.First()));
576✔
3377
                        }
576✔
3378
                        else if (constr == null)
49,867✔
3379
                        {
41,015✔
3380
                                if (prop.Attribute.IsName && values.First() is string name)
41,015✔
3381
                                {
2,720✔
3382
                                        if (!name.IsNullOrEmpty())
2,720✔
3383
                                        {
1,672✔
3384
                                                prop.Setter(this, Convert.ChangeType(values.First(), prop.Property.PropertyType));
1,672✔
3385
                                        }
1,672✔
3386
                                }
2,720✔
3387
                                else
3388
                                {
38,295✔
3389
                                        prop.Setter(this, Convert.ChangeType(values.First(), prop.Property.PropertyType));
38,295✔
3390
                                }
38,295✔
3391
                        }
41,015✔
3392
                        else
3393
                        {
8,852✔
3394
                                prop.Setter(this, Activator.CreateInstance(prop.Property.PropertyType, values));
8,852✔
3395
                        }
8,852✔
3396
                }
60,024✔
3397

3398
                /// <inheritdoc/>
3399
                public override string ToString()
3400
                {
×
3401
                        return $"{this.Version}";
×
3402
                }
×
3403
        }
3404
}
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