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

DomCR / ACadSharp / 12747613042

13 Jan 2025 12:51PM UTC coverage: 75.732% (+0.09%) from 75.641%
12747613042

push

github

web-flow
Merge pull request #527 from DomCR/dwgWriter-xrecord-config

Dwg writer xdata fix

5250 of 7648 branches covered (68.65%)

Branch coverage included in aggregate %.

69 of 88 new or added lines in 16 files covered. (78.41%)

5 existing lines in 2 files now uncovered.

20935 of 26928 relevant lines covered (77.74%)

39111.6 hits per line

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

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

13
namespace ACadSharp.Header
14
{
15
        public class CadHeader
16
        {
17
                /// <summary>
18
                /// The Drawing database version number.
19
                /// </summary>
20
                /// <remarks>
21
                /// System variable ACADVER.
22
                /// </remarks>
23
                [CadSystemVariable("$ACADVER", DxfCode.Text)]
24
                public string VersionString
25
                {
26
                        get { return this.Version.ToString(); }
336✔
27
                        set
28
                        {
192✔
29
                                this.Version = CadUtils.GetVersionFromName(value);
192✔
30
                        }
192✔
31
                }
32

33
                public ACadVersion Version { get; set; } = ACadVersion.AC1018;
20,271✔
34

35
                /// <summary>
36
                /// Maintenance version number(should be ignored)
37
                /// </summary>
38
                /// <remarks>
39
                /// System variable ACADMAINTVER.
40
                /// </remarks>
41
                [CadSystemVariable(DxfReferenceType.Ignored, "$ACADMAINTVER", 70)]
42
                public short MaintenanceVersion { get; internal set; } = 0;
1,265✔
43

44
                /// <summary>
45
                /// Drawing code page.
46
                /// </summary>
47
                /// <remarks>
48
                /// System variable DWGCODEPAGE
49
                /// </remarks>
50
                [CadSystemVariable("$DWGCODEPAGE", 3)]
51
                public string CodePage { get; set; } = "ANSI_1252";
998✔
52

53
                /// <summary>
54
                /// Displays the name of the last person who modified the file
55
                /// </summary>
56
                /// <remarks>
57
                /// System variable LASTSAVEDBY
58
                /// </remarks>
59
                [CadSystemVariable(DxfReferenceType.Ignored, "$LASTSAVEDBY", 3)]
60
                public string LastSavedBy { get; set; } = "ACadSharp";
650✔
61

62
                /// <summary>
63
                /// The default value is 0.
64
                /// Read only.
65
                /// </summary>
66
                /// <remarks>
67
                /// System variable REQUIREDVERSIONS <br/>
68
                /// Only in <see cref="ACadVersion.AC1024"/> or above
69
                /// </remarks>
70
                [CadSystemVariable(DxfReferenceType.Ignored, "$REQUIREDVERSIONS", 70)]
71
                public long RequiredVersions { get; set; }
96✔
72

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

82
                /// <summary>
83
                /// System variable DIMSHO
84
                /// </summary>
85
                [CadSystemVariable("$DIMSHO", 70)]
86
                public bool UpdateDimensionsWhileDragging { get; set; } = true;
862✔
87

88
                /// <summary>
89
                /// Undocumented
90
                /// </summary>
91
                /// <remarks>
92
                /// System variable DIMSAV
93
                /// </remarks>
94
                internal bool DIMSAV { get; set; }
24✔
95

96
                /// <summary>
97
                /// Controls whether the current drawing uses imperial or metric hatch pattern and linetype files.
98
                /// </summary>
99
                /// <remarks>
100
                /// System variable MEASUREMENT
101
                /// </remarks>
102
                [CadSystemVariable("$MEASUREMENT", 70)]
103
                public MeasurementUnits MeasurementUnits { get; set; } = MeasurementUnits.Metric;
676✔
104

105
                /// <summary>
106
                /// Governs the generation of linetype patterns around the vertices of a 2D polyline:<br/>
107
                /// 1 = Linetype is generated in a continuous pattern around vertices of the polyline<br/>
108
                /// 0 = Each segment of the polyline starts and ends with a dash
109
                /// </summary>
110
                /// <remarks>
111
                /// System variable PLINEGEN
112
                /// </remarks>
113
                [CadSystemVariable("$PLINEGEN", 70)]
114
                public bool PolylineLineTypeGeneration { get; set; } = false;
964✔
115

116
                /// <summary>
117
                /// Constrains cursor movement to the perpendicular.
118
                /// </summary>
119
                /// <remarks>
120
                /// System variable ORTHOMODE.
121
                /// </remarks>
122
                [CadSystemVariable("$ORTHOMODE", 70)]
123
                public bool OrthoMode { get; set; } = false;
862✔
124

125
                /// <summary>
126
                /// Obsolete. Controls automatic regeneration of the drawing.
127
                /// </summary>
128
                /// <remarks>
129
                /// System variable REGENMODE.
130
                /// </remarks>
131
                [CadSystemVariable("$REGENMODE", 70)]
132
                public bool RegenerationMode { get; set; } = false;
862✔
133

134
                /// <summary>
135
                /// Specifies whether hatches and fills, 2D solids, and wide polylines are filled in.
136
                /// </summary>
137
                /// <remarks>
138
                /// System variable FILLMODE.
139
                /// </remarks>
140
                [CadSystemVariable("$FILLMODE", 70)]
141
                public bool FillMode { get; set; } = true;
862✔
142

143
                /// <summary>
144
                /// Quick Text mode on if nonzero
145
                /// </summary>
146
                /// <remarks>
147
                /// System variable QTEXTMODE.
148
                /// </remarks>
149
                [CadSystemVariable("$QTEXTMODE", 70)]
150
                public bool QuickTextMode { get; set; } = false;
862✔
151

152
                /// <summary>
153
                /// Controls paper space linetype scaling.
154
                /// </summary>
155
                /// <remarks>
156
                /// System variable PSLTSCALE.
157
                /// </remarks>
158
                [CadSystemVariable("$PSLTSCALE", 70)]
159
                public SpaceLineTypeScaling PaperSpaceLineTypeScaling { get; set; } = SpaceLineTypeScaling.Normal;
964✔
160

161
                /// <summary>
162
                /// Controls whether you can create objects outside the grid limits.
163
                /// </summary>
164
                /// <remarks>
165
                /// System variable LIMCHECK.
166
                /// </remarks>
167
                [CadSystemVariable("$LIMCHECK", 70)]
168
                public bool LimitCheckingOn { get; set; } = false;
862✔
169

170
                /// <summary>
171
                /// System variable BLIPMODE        ??
172
                /// </summary>
173
                [CadSystemVariable("$BLIPMODE", 70)]
174
                public bool BlipMode { get; set; }
48✔
175

176
                /// <summary>
177
                /// Controls the user timer for the drawing.
178
                /// </summary>
179
                /// <remarks>
180
                /// System variable USRTIMER.
181
                /// </remarks>
182
                [CadSystemVariable("$USRTIMER", 70)]
183
                public bool UserTimer { get; set; } = false;
862✔
184

185
                /// <summary>
186
                /// Determines the object type created by the SKETCH command.
187
                /// </summary>
188
                /// <remarks>
189
                /// System variable SKPOLY.
190
                /// </remarks>
191
                [CadSystemVariable("$SKPOLY", 70)]
192
                public bool SketchPolylines { get; set; } = false;
862✔
193

194
                /// <summary>
195
                /// Sets the direction of positive angles.
196
                /// </summary>
197
                /// <remarks>
198
                /// System variable ANGDIR.
199
                /// </remarks>
200
                [CadSystemVariable("$ANGDIR", 70)]
201
                public AngularDirection AngularDirection { get; set; } = AngularDirection.ClockWise;
964✔
202

203
                /// <summary>
204
                /// Controls the display of helixes and smoothed mesh objects.
205
                /// </summary>
206
                /// <remarks>
207
                /// System variable SPLFRAME.
208
                /// </remarks>
209
                [CadSystemVariable("$SPLFRAME", 70)]
210
                public bool ShowSplineControlPoints { get; set; } = false;
862✔
211

212
                /// <summary>
213
                /// Controls how MIRROR reflects text.
214
                /// </summary>
215
                /// <remarks>
216
                /// System variable MIRRTEXT.
217
                /// </remarks>
218
                [CadSystemVariable("$MIRRTEXT", 70)]
219
                public bool MirrorText { get; set; } = false;
964✔
220

221
                /// <summary>
222
                /// Determines whether input to the DVIEW and VPOINT commands is relative to the WCS (default) or the current UCS.
223
                /// </summary>
224
                /// <remarks>
225
                /// System variable WORLDVIEW.
226
                /// </remarks>
227
                [CadSystemVariable("$WORLDVIEW", 70)]
228
                public bool WorldView { get; set; } = true;
862✔
229

230
                /// <summary>
231
                /// Determines whether the Model tab or the most-recently accessed named layout tab is active.
232
                /// </summary>
233
                /// <remarks>
234
                /// System variable TILEMODE.
235
                /// </remarks>
236
                [CadSystemVariable("$TILEMODE", 70)]
237
                public bool ShowModelSpace { get; set; }
343✔
238

239
                /// <summary>
240
                /// Limits checking in paper space when nonzero.
241
                /// </summary>
242
                /// <remarks>
243
                /// System variable PLIMCHECK.
244
                /// </remarks>
245
                [CadSystemVariable("$PLIMCHECK", 70)]
246
                public bool PaperSpaceLimitsChecking { get; set; } = false;
862✔
247

248
                /// <summary>
249
                /// Controls the properties of xref-dependent layers: <br/>
250
                /// 0 = Don't retain xref-dependent visibility settings <br/>
251
                /// 1 = Retain xref-dependent visibility settings <br/>
252
                /// </summary>
253
                /// <remarks>
254
                /// System variable VISRETAIN.
255
                /// </remarks>
256
                [CadSystemVariable("$VISRETAIN", 70)]
257
                public bool RetainXRefDependentVisibilitySettings { get; set; } = true;
862✔
258

259
                /// <summary>
260
                /// Controls display of silhouette edges of 3D solid and surface objects in the Wireframe or 2D Wireframe visual styles.
261
                /// </summary>
262
                /// <remarks>
263
                /// System variable DISPSILH.
264
                /// </remarks>
265
                [CadSystemVariable("$DISPSILH", 70)]
266
                public bool DisplaySilhouetteCurves { get; set; } = false;
838✔
267

268
                /// <summary>
269
                /// Controls the ellipse type created with ELLIPSE.
270
                /// </summary>
271
                /// <remarks>
272
                /// System variable PELLIPSE.
273
                /// </remarks>
274
                [CadSystemVariable("$PELLIPSE", 70)]
275
                public bool CreateEllipseAsPolyline { get; set; } = false;
682✔
276

277
                /// <summary>
278
                /// Specifies whether images of proxy objects are saved in the drawing.
279
                /// </summary>
280
                /// <remarks>
281
                /// System variable PROXYGRAPHICS.
282
                /// </remarks>
283
                [CadSystemVariable("$PROXYGRAPHICS", 70)]
284
                public bool ProxyGraphics { get; set; } = true;
838✔
285

286
                /// <summary>
287
                /// Specifies the maximum depth, that is, the number of times the tree-structured spatial index can divide into branches.
288
                /// </summary>
289
                /// <remarks>
290
                /// System variable TREEDEPTH.
291
                /// </remarks>
292
                [CadSystemVariable("$TREEDEPTH", 70)]
293
                public short SpatialIndexMaxTreeDepth { get; set; } = 3020;
838✔
294

295
                /// <summary>
296
                /// Sets the linear units format for creating objects.
297
                /// </summary>
298
                /// <remarks>
299
                /// System variable LUNITS.
300
                /// </remarks>
301
                [CadSystemVariable("$LUNITS", 70)]
302
                public LinearUnitFormat LinearUnitFormat { get; set; } = LinearUnitFormat.Decimal;
964✔
303

304
                /// <summary>
305
                /// Sets the display precision for linear units and coordinates.
306
                /// </summary>
307
                /// <remarks>
308
                /// System variable LUPREC.
309
                /// </remarks>
310
                [CadSystemVariable("$LUPREC", 70)]
311
                public short LinearUnitPrecision
312
                {
313
                        get
314
                        {
120✔
315
                                return this._linearUnitPrecision;
120✔
316
                        }
120✔
317
                        set
318
                        {
324✔
319
                                ObjectExtensions.InRange(value, 0, 8, "LUPREC valid values are from 0 to 8");
324✔
320
                                this._linearUnitPrecision = value;
324✔
321
                        }
324✔
322
                }
323

324
                private short _linearUnitPrecision = 4;
520✔
325

326
                /// <summary>
327
                /// Sets units for angles.
328
                /// </summary>
329
                /// <remarks>
330
                /// System variable AUNITS.
331
                /// </remarks>
332
                [CadSystemVariable("$AUNITS", 70)]
333
                public AngularUnitFormat AngularUnit { get; set; } = AngularUnitFormat.DecimalDegrees;
964✔
334

335
                /// <summary>
336
                /// Sets the display precision for angular units and coordinates.
337
                /// </summary>
338
                /// <remarks>
339
                /// System variable AUPREC.
340
                /// </remarks>
341
                [CadSystemVariable("$AUPREC", 70)]
342
                public short AngularUnitPrecision
343
                {
344
                        get
345
                        {
120✔
346
                                return this._angularUnitPrecision;
120✔
347
                        }
120✔
348
                        set
349
                        {
324✔
350
                                ObjectExtensions.InRange(value, 0, 8, "AUPREC valid values are from 0 to 8");
324✔
351
                                this._angularUnitPrecision = value;
324✔
352
                        }
324✔
353
                }
354

355
                private short _angularUnitPrecision = 0;
520✔
356

357
                /// <summary>
358
                /// Sets running object snaps.
359
                /// </summary>
360
                /// <remarks>
361
                /// System variable OSMODE.
362
                /// </remarks>
363
                [CadSystemVariable("$OSMODE", 70)]
364
                public ObjectSnapMode ObjectSnapMode { get; set; } = (ObjectSnapMode)4133;
568✔
365

366
                /// <summary>
367
                /// Controls display of attributes.
368
                /// </summary>
369
                /// <remarks>
370
                /// System variable ATTMODE.
371
                /// </remarks>
372
                [CadSystemVariable("$ATTMODE", 70)]
373
                public AttributeVisibilityMode AttributeVisibility { get; set; } = AttributeVisibilityMode.Normal;
964✔
374

375
                /// <summary>
376
                /// Controls how point objects are displayed.
377
                /// </summary>
378
                /// <remarks>
379
                /// System variable PDMODE.
380
                /// </remarks>
381
                [CadSystemVariable("$PDMODE", 70)]
382
                public short PointDisplayMode { get; set; } = 0;
964✔
383

384
                /// <summary>
385
                /// Integer variable intended for use by third-party developers.
386
                /// </summary>
387
                /// <remarks>
388
                /// System variable USERI1.
389
                /// </remarks>
390
                [CadSystemVariable("$USERI1", 70)]
391
                public short UserShort1 { get; set; } = 0;
862✔
392

393
                /// <summary>
394
                /// Integer variable intended for use by third-party developers.
395
                /// </summary>
396
                /// <remarks>
397
                /// System variable USERI2.
398
                /// </remarks>
399
                [CadSystemVariable("$USERI2", 70)]
400
                public short UserShort2 { get; set; } = 0;
862✔
401

402
                /// <summary>
403
                /// Integer variable intended for use by third-party developers.
404
                /// </summary>
405
                /// <remarks>
406
                /// System variable USERI3.
407
                /// </remarks>
408
                [CadSystemVariable("$USERI3", 70)]
409
                public short UserShort3 { get; set; } = 0;
862✔
410

411
                /// <summary>
412
                /// Integer variable intended for use by third-party developers.
413
                /// </summary>
414
                /// <remarks>
415
                /// System variable USERI4.
416
                /// </remarks>
417
                [CadSystemVariable("$USERI4", 70)]
418
                public short UserShort4 { get; set; } = 0;
862✔
419

420
                /// <summary>
421
                /// Integer variable intended for use by third-party developers.
422
                /// </summary>
423
                /// <remarks>
424
                /// System variable USERI5.
425
                /// </remarks>
426
                [CadSystemVariable("$USERI5", 70)]
427
                public short UserShort5 { get; set; } = 0;
862✔
428

429
                /// <summary>
430
                /// Sets the number of line segments to be generated for each spline-fit polyline generated by the Spline option of the PEDIT command.
431
                /// </summary>
432
                /// <remarks>
433
                /// System variable SPLINESEGS.
434
                /// </remarks>
435
                [CadSystemVariable("$SPLINESEGS", 70)]
436
                public short NumberOfSplineSegments { get; set; } = 8;
964✔
437

438
                /// <summary>
439
                /// Surface density (for PEDIT Smooth) in M direction.
440
                /// </summary>
441
                /// <remarks>
442
                /// System variable SURFU.
443
                /// </remarks>
444
                [CadSystemVariable("$SURFU", 70)]
445
                public short SurfaceDensityU { get; set; } = 6;
964✔
446

447
                /// <summary>
448
                /// Surface density(for PEDIT Smooth) in N direction.
449
                /// </summary>
450
                /// <remarks>
451
                /// System variable SURFV.
452
                /// </remarks>
453
                [CadSystemVariable("$SURFV", 70)]
454
                public short SurfaceDensityV { get; set; } = 6;
964✔
455

456
                /// <summary>
457
                /// Surface type for PEDIT Smooth.
458
                /// </summary>
459
                /// <remarks>
460
                /// System variable SURFTYPE.
461
                /// </remarks>
462
                [CadSystemVariable("$SURFTYPE", 70)]
463
                public short SurfaceType { get; set; } = 6;
862✔
464

465
                /// <summary>
466
                /// Number of mesh tabulations in first direction.
467
                /// </summary>
468
                /// <remarks>
469
                /// System variable SURFTAB1.
470
                /// </remarks>
471
                [CadSystemVariable("$SURFTAB1", 70)]
472
                public short SurfaceMeshTabulationCount1 { get; set; } = 6;
862✔
473

474
                /// <summary>
475
                /// Number of mesh tabulations in second direction.
476
                /// </summary>
477
                /// <remarks>
478
                /// System variable SURFTAB2.
479
                /// </remarks>
480
                [CadSystemVariable("$SURFTAB2", 70)]
481
                public short SurfaceMeshTabulationCount2 { get; set; } = 6;
862✔
482

483
                /// <summary>
484
                /// Sets the type of curve generated by the Spline option of the PEDIT command.
485
                /// </summary>
486
                /// <remarks>
487
                /// System variable SPLINETYPE.
488
                /// </remarks>
489
                [CadSystemVariable("$SPLINETYPE", 70)]
490
                public SplineType SplineType { get; set; } = SplineType.CubicBSpline;
862✔
491

492
                /// <summary>
493
                /// Controls the shading of edges.
494
                /// </summary>
495
                /// <remarks>
496
                /// System variable SHADEDGE.
497
                /// </remarks>
498
                [CadSystemVariable("$SHADEDGE", 70)]
499
                public ShadeEdgeType ShadeEdge { get; set; } = ShadeEdgeType.FacesInEntityColorEdgesInBlack;
862✔
500

501
                /// <summary>
502
                /// Sets the ratio of diffuse reflective light to ambient light.
503
                /// </summary>
504
                /// <remarks>
505
                /// System variable SHADEDIF.
506
                /// </remarks>
507
                /// <value>
508
                /// range 1-100
509
                /// </value>
510
                [CadSystemVariable("$SHADEDIF", 70)]
511
                public short ShadeDiffuseToAmbientPercentage { get; set; } = 70;
862✔
512

513
                /// <summary>
514
                /// Controls the display format for units.
515
                /// </summary>
516
                /// <remarks>
517
                /// System variable UNITMODE.
518
                /// </remarks>
519
                [CadSystemVariable("$UNITMODE", 70)]
520
                public short UnitMode { get; set; } = 0;
862✔
521

522
                /// <summary>
523
                /// Sets the maximum number of viewports that can be active at one time in a layout.
524
                /// </summary>
525
                /// <remarks>
526
                /// System variable MAXACTVP.
527
                /// </remarks>
528
                [CadSystemVariable("$MAXACTVP", 70)]
529
                public short MaxViewportCount { get; set; } = 64;
862✔
530

531
                /// <summary>
532
                /// Specifies the number of contour lines displayed on the curved surfaces of 3D solids.
533
                /// </summary>
534
                /// <remarks>
535
                /// System variable ISOLINES.
536
                /// </remarks>
537
                public short SurfaceIsolineCount
538
                {
539
                        get
540
                        {
30✔
541
                                return this._surfaceIsolineCount;
30✔
542
                        }
30✔
543
                        set
544
                        {
132✔
545
                                ObjectExtensions.InRange(value, 0, 2047, "ISOLINES valid values are from 0 to 2047");
132✔
546
                                this._surfaceIsolineCount = value;
132✔
547
                        }
132✔
548
                }
549

550
                private short _surfaceIsolineCount = 4;
520✔
551

552
                /// <summary>
553
                /// Current multiline justification.
554
                /// </summary>
555
                /// <remarks>
556
                /// System variable CMLJUST.
557
                /// </remarks>
558
                [CadSystemVariable("$CMLJUST", 70)]
559
                public VerticalAlignmentType CurrentMultilineJustification { get; set; } = VerticalAlignmentType.Top;
940✔
560

561
                /// <summary>
562
                /// Sets the resolution of TrueType text for plotting and rendering.
563
                /// </summary>
564
                /// <remarks>
565
                /// System variable TEXTQLTY.
566
                /// </remarks>
567
                public short TextQuality
568
                {
569
                        get
570
                        {
30✔
571
                                return this._textQuality;
30✔
572
                        }
30✔
573
                        set
574
                        {
132✔
575
                                ObjectExtensions.InRange(value, 0, 100, "TEXTQLTY valid values are from 0 to 100");
132✔
576
                                this._textQuality = value;
132✔
577
                        }
132✔
578
                }
579

580
                private short _textQuality = 50;
520✔
581

582
                /// <summary>
583
                /// Sets the global linetype scale factor.
584
                /// </summary>
585
                /// <remarks>
586
                /// System variable LTSCALE.
587
                /// </remarks>
588
                [CadSystemVariable("$LTSCALE", 40)]
589
                public double LineTypeScale { get; set; } = 1.0d;
964✔
590

591
                /// <summary>
592
                /// Sets the default text height when creating new text objects.
593
                /// </summary>
594
                /// <remarks>
595
                /// System variable TEXTSIZE.
596
                /// </remarks>
597
                [CadSystemVariable("$TEXTSIZE", 40)]
598
                public double TextHeightDefault { get; set; } = 2.5d;
964✔
599

600
                /// <summary>
601
                /// Sets the name of the current text style.
602
                /// </summary>
603
                /// <remarks>
604
                /// System variable TEXTSTYLE.
605
                /// </remarks>
606
                [CadSystemVariable("$TEXTSTYLE", true, 7)]
607
                public string TextStyleName
608
                {
609
                        get { return this._currentTextStyle.Name; }
507✔
610
                        set
611
                        {
303✔
612
                                if (this.Document != null)
303✔
613
                                {
111✔
614
                                        this._currentTextStyle = this.Document.TextStyles[value];
111✔
615
                                }
111✔
616
                                else
617
                                {
192✔
618
                                        this._currentTextStyle = new TextStyle(value);
192✔
619
                                }
192✔
620
                        }
303✔
621
                }
622

623
                /// <summary>
624
                /// Sets the current layer.
625
                /// </summary>
626
                /// <remarks>
627
                /// System variable CLAYER
628
                /// </remarks>
629
                [CadSystemVariable("$CLAYER", true, 8)]
630
                public string CurrentLayerName
631
                {
632
                        get { return this._currentLayer.Name; }
510✔
633
                        set
634
                        {
303✔
635
                                if (this.Document != null)
303✔
636
                                {
111✔
637
                                        this._currentLayer = this.Document.Layers[value];
111✔
638
                                }
111✔
639
                                else
640
                                {
192✔
641
                                        this._currentLayer = new Layer(value);
192✔
642
                                }
192✔
643
                        }
303✔
644
                }
645

646
                /// <summary>
647
                /// Sets the linetype of new objects.
648
                /// </summary>
649
                /// <remarks>
650
                /// System variable CELTYPE.
651
                /// </remarks>
652
                [CadSystemVariable("$CELTYPE", true, 6)]
653
                public string CurrentLineTypeName
654
                {
655
                        get { return this._currentLineType.Name; }
486✔
656
                        set
657
                        {
303✔
658
                                if (this.Document != null)
303✔
659
                                {
111✔
660
                                        this._currentLineType = this.Document.LineTypes[value];
111✔
661
                                }
111✔
662
                                else
663
                                {
192✔
664
                                        this._currentLineType = new LineType(value);
192✔
665
                                }
192✔
666
                        }
303✔
667
                }
668

669
                /// <summary>
670
                /// Current multiline style name.
671
                /// </summary>
672
                /// <remarks>
673
                /// System variable CMLSTYLE.
674
                /// </remarks>
675
                [CadSystemVariable("$CMLSTYLE", true, 2)]
676
                public string CurrentMultiLineStyleName
677
                {
678
                        get { return this._currentMLineStyle.Name; }
270✔
679
                        set
680
                        {
168✔
681
                                if (this.Document != null)
168!
682
                                {
×
683
                                        this._currentMLineStyle = this.Document.MLineStyles[value];
×
684
                                }
×
685
                                else
686
                                {
168✔
687
                                        this._currentMLineStyle = new MLineStyle(value);
168✔
688
                                }
168✔
689
                        }
168✔
690
                }
691

692
                /// <summary>
693
                /// Default trace width.
694
                /// </summary>
695
                /// <remarks>
696
                /// System variable TRACEWID.
697
                /// </remarks>
698
                [CadSystemVariable("$TRACEWID", 40)]
699
                public double TraceWidthDefault { get; set; }
342✔
700

701
                /// <summary>
702
                /// Sketch record increment.
703
                /// </summary>
704
                /// <remarks>
705
                /// System variable SKETCHINC.
706
                /// </remarks>
707
                [CadSystemVariable("$SKETCHINC", 40)]
708
                public double SketchIncrement { get; set; } = 1.0d;
862✔
709

710
                /// <summary>
711
                /// Stores the current fillet radius for 2D objects.
712
                /// </summary>
713
                /// <remarks>
714
                /// System variable FILLETRAD.
715
                /// </remarks>
716
                [CadSystemVariable("$FILLETRAD", 40)]
717
                public double FilletRadius { get; set; } = 0.0d;
862✔
718

719
                /// <summary>
720
                /// Sets the default 3D thickness property when creating 2D geometric objects.
721
                /// </summary>
722
                /// <remarks>
723
                /// System variable THICKNESS.
724
                /// </remarks>
725
                [CadSystemVariable("$THICKNESS", 40)]
726
                public double ThicknessDefault { get; set; } = 0.0d;
862✔
727

728
                /// <summary>
729
                /// Sets the zero (0) base angle with respect to the current UCS.
730
                /// </summary>
731
                /// <remarks>
732
                /// System variable ANGBASE
733
                /// </remarks>
734
                [CadSystemVariable("$ANGBASE", 50)]
735
                public double AngleBase { get; set; } = 0.0d;
964✔
736

737
                /// <summary>
738
                /// Sets the display size for point objects.
739
                /// </summary>
740
                /// <remarks>
741
                /// System variable PDSIZE.
742
                /// </remarks>
743
                [CadSystemVariable("$PDSIZE", 40)]
744
                public double PointDisplaySize { get; set; } = 0.0d;
964✔
745

746
                /// <summary>
747
                /// Stores the default polyline width.
748
                /// </summary>
749
                /// <remarks>
750
                /// System variable PLINEWID.
751
                /// </remarks>
752
                [CadSystemVariable("$PLINEWID", 40)]
753
                public double PolylineWidthDefault { get; set; } = 0.0d;
862✔
754

755
                /// <summary>
756
                /// Real variable intended for use by third-party developers.
757
                /// </summary>
758
                /// <remarks>
759
                /// System variable USERR1.
760
                /// </remarks>
761
                [CadSystemVariable("$USERR1", 40)]
762
                public double UserDouble1 { get; set; }
342✔
763

764
                /// <summary>
765
                /// Real variable intended for use by third-party developers.
766
                /// </summary>
767
                /// <remarks>
768
                /// System variable USERR2.
769
                /// </remarks>
770
                [CadSystemVariable("$USERR2", 40)]
771
                public double UserDouble2 { get; set; }
342✔
772

773
                /// <summary>
774
                /// Real variable intended for use by third-party developers.
775
                /// </summary>
776
                /// <remarks>
777
                /// System variable USERR3.
778
                /// </remarks>
779
                [CadSystemVariable("$USERR3", 40)]
780
                public double UserDouble3 { get; set; }
342✔
781

782
                /// <summary>
783
                /// Real variable intended for use by third-party developers.
784
                /// </summary>
785
                /// <remarks>
786
                /// System variable USERR4.
787
                /// </remarks>
788
                [CadSystemVariable("$USERR4", 40)]
789
                public double UserDouble4 { get; set; }
342✔
790

791
                /// <summary>
792
                /// Real variable intended for use by third-party developers.
793
                /// </summary>
794
                /// <remarks>
795
                /// System variable USERR5.
796
                /// </remarks>
797
                [CadSystemVariable("$USERR5", 40)]
798
                public double UserDouble5 { get; set; }
342✔
799

800
                /// <summary>
801
                /// Sets the first chamfer distance when CHAMMODE is set to 0.
802
                /// </summary>
803
                /// <remarks>
804
                /// System variable CHAMFERA.
805
                /// </remarks>
806
                [CadSystemVariable("$CHAMFERA", 40)]
807
                public double ChamferDistance1 { get; set; } = 0.0d;
862✔
808

809
                /// <summary>
810
                /// Sets the second chamfer distance when CHAMMODE is set to 0.
811
                /// </summary>
812
                /// <remarks>
813
                /// System variable CHAMFERB.
814
                /// </remarks>
815
                [CadSystemVariable("$CHAMFERB", 40)]
816
                public double ChamferDistance2 { get; set; } = 0.0d;
862✔
817

818
                /// <summary>
819
                /// Sets the chamfer length when CHAMMODE is set to 1.
820
                /// </summary>
821
                /// <remarks>
822
                /// System variable CHAMFERC.
823
                /// </remarks>
824
                [CadSystemVariable("$CHAMFERC", 40)]
825
                public double ChamferLength { get; set; } = 0.0d;
838✔
826

827
                /// <summary>
828
                /// Sets the chamfer angle when CHAMMODE is set to 1.
829
                /// </summary>
830
                /// <remarks>
831
                /// System variable CHAMFERD.
832
                /// </remarks>
833
                [CadSystemVariable("$CHAMFERD", 40)]
834
                public double ChamferAngle { get; set; } = 0.0d;
838✔
835

836
                /// <summary>
837
                /// Adjusts the smoothness of shaded and rendered objects, rendered shadows, and objects with hidden lines removed.
838
                /// </summary>
839
                /// <remarks>
840
                /// System variable FACETRES.
841
                /// </remarks>
842
                /// <value>
843
                /// Valid values are from 0.01 to 10.0.
844
                /// </value>
845
                [CadSystemVariable("$FACETRES", 40)]
846
                public double FacetResolution
847
                {
848
                        get
849
                        {
30✔
850
                                return this._facetResolution;
30✔
851
                        }
30✔
852
                        set
853
                        {
132✔
854
                                ObjectExtensions.InRange(value, 0.01, 10, "FACETRES valid values are from 0.01 to 10.0");
132✔
855
                                this._facetResolution = value;
132✔
856
                        }
132✔
857
                }
858

859
                private double _facetResolution = 0.5;
520✔
860

861
                /// <summary>
862
                /// Current multiline scale.
863
                /// </summary>
864
                /// <remarks>
865
                /// System variable CMLSCALE.
866
                /// </remarks>
867
                [CadSystemVariable("$CMLSCALE", 40)]
868
                public double CurrentMultilineScale { get; set; } = 20.0d;
940✔
869

870
                /// <summary>
871
                /// Current entity linetype scale.
872
                /// </summary>
873
                /// <remarks>
874
                /// System variable CELTSCALE.
875
                /// </remarks>
876
                [CadSystemVariable("$CELTSCALE", 40)]
877
                public double CurrentEntityLinetypeScale { get; set; } = 1.0d;
940✔
878

879
                /// <summary>
880
                /// Name of menu file.
881
                /// </summary>
882
                /// <remarks>
883
                /// System variable MENU.
884
                /// </remarks>
885
                [CadSystemVariable("$MENU", 1)]
886
                public string MenuFileName { get; set; } = ".";
862✔
887

888
                /// <summary>
889
                /// Next available handle.
890
                /// </summary>
891
                /// <remarks>
892
                /// System variable HANDSEED.
893
                /// </remarks>
894
                [CadSystemVariable("$HANDSEED", 5)]
895
                public ulong HandleSeed { get; internal set; } = 0x0;
34,526✔
896

897
                /// <summary>
898
                /// Local date/time of drawing creation (see Special Handling of Date/Time Variables).
899
                /// </summary>
900
                /// <remarks>
901
                /// System variable TDCREATE.
902
                /// </remarks>
903
                [CadSystemVariable("$TDCREATE", 40)]
904
                public DateTime CreateDateTime { get; set; } = DateTime.Now;
986✔
905

906
                /// <summary>
907
                /// Universal date/time the drawing was created(see Special Handling of Date/Time Variables).
908
                /// </summary>
909
                /// <remarks>
910
                /// System variable TDUCREATE.
911
                /// </remarks>
912
                [CadSystemVariable("$TDUCREATE", 40)]
913
                public DateTime UniversalCreateDateTime { get; set; } = DateTime.UtcNow;
778✔
914

915
                /// <summary>
916
                /// Local date/time of last drawing update(see Special Handling of Date/Time Variables).
917
                /// </summary>
918
                /// <remarks>
919
                /// System variable TDUPDATE.
920
                /// </remarks>
921
                [CadSystemVariable("$TDUPDATE", 40)]
922
                public DateTime UpdateDateTime { get; set; } = DateTime.Now;
989✔
923

924
                /// <summary>
925
                /// Universal date/time of the last update/save(see Special Handling of Date/Time Variables).
926
                /// </summary>
927
                /// <remarks>
928
                /// System variable TDUUPDATE.
929
                /// </remarks>
930
                [CadSystemVariable("$TDUUPDATE", 40)]
931
                public DateTime UniversalUpdateDateTime { get; set; } = DateTime.UtcNow;
797✔
932

933
                /// <summary>
934
                /// Cumulative editing time for this drawing(see Special Handling of Date/Time Variables)
935
                /// </summary>
936
                /// <remarks>
937
                /// System variable TDINDWG
938
                /// </remarks>
939
                [CadSystemVariable("$TDINDWG", 40)]
940
                public TimeSpan TotalEditingTime { get; set; } = new TimeSpan();
964✔
941

942
                /// <summary>
943
                /// User-elapsed timer
944
                /// </summary>
945
                /// <remarks>
946
                /// System variable TDUSRTIMER
947
                /// </remarks>
948
                [CadSystemVariable("$TDUSRTIMER", 40)]
949
                public TimeSpan UserElapsedTimeSpan { get; set; }
342✔
950

951
                /// <summary>
952
                /// Current entity color number.
953
                /// </summary>
954
                /// <remarks>
955
                /// System variable CECOLOR.
956
                /// </remarks>
957
                [CadSystemVariable("$CECOLOR", 62)]
958
                public Color CurrentEntityColor { get; set; } = Color.ByLayer;
966✔
959

960
                /// <summary>
961
                /// View scale factor for new viewports.
962
                /// </summary>
963
                /// <remarks>
964
                /// System variable PSVPSCALE.
965
                /// </remarks>
966
                [CadSystemVariable("$PSVPSCALE", 40)]
967
                public double ViewportDefaultViewScaleFactor { get; set; }
294✔
968

969
                /// <summary>
970
                /// Paper space insertion base point.
971
                /// </summary>
972
                /// <remarks>
973
                /// System variable PINSBASE.
974
                /// </remarks>
975
                [CadSystemVariable("$PINSBASE", 10, 20, 30)]
976
                public XYZ PaperSpaceInsertionBase { get; set; } = XYZ.Zero;
838✔
977

978
                /// <summary>
979
                /// X, Y, and Z drawing extents lower-left corner (in WCS).
980
                /// </summary>
981
                /// <remarks>
982
                /// System variable PEXTMIN.
983
                /// </remarks>
984
                [CadSystemVariable("$PEXTMIN", 10, 20, 30)]
985
                public XYZ PaperSpaceExtMin { get; set; } = XYZ.Zero;
862✔
986

987
                /// <summary>
988
                /// X, Y, and Z drawing extents upper-right corner(in WCS).
989
                /// </summary>
990
                /// <remarks>
991
                /// System variable PEXTMAX.
992
                /// </remarks>
993
                [CadSystemVariable("$PEXTMAX", 10, 20, 30)]
994
                public XYZ PaperSpaceExtMax { get; set; } = XYZ.Zero;
862✔
995

996
                /// <summary>
997
                /// XY drawing limits lower-left corner(in WCS).
998
                /// </summary>
999
                /// <remarks>
1000
                /// System variable PLIMMIN.
1001
                /// </remarks>
1002
                [CadSystemVariable("$PLIMMIN", 10, 20)]
1003
                public XY PaperSpaceLimitsMin { get; set; } = XY.Zero;
862✔
1004

1005
                /// <summary>
1006
                /// XY drawing limits upper-right corner (in WCS).
1007
                /// </summary>
1008
                /// <remarks>
1009
                /// System variable PLIMMAX.
1010
                /// </remarks>
1011
                [CadSystemVariable("$PLIMMAX", 10, 20)]
1012
                public XY PaperSpaceLimitsMax { get; set; } = XY.Zero;
862✔
1013

1014
                /// <summary>
1015
                /// Current elevation set by ELEV command
1016
                /// </summary>
1017
                /// <remarks>
1018
                /// System variable PELEVATION
1019
                /// </remarks>
1020
                [CadSystemVariable("$PELEVATION", 40)]
1021
                public double PaperSpaceElevation
1022
                {
1023
                        get { return this.PaperSpaceUcs.Elevation; }
90✔
1024
                        set
1025
                        {
312✔
1026
                                this.PaperSpaceUcs.Elevation = value;
312✔
1027
                        }
312✔
1028
                }
1029

1030
                /// <summary>
1031
                /// Name of the UCS that defines the origin and orientation of orthographic UCS settings (paper space only)
1032
                /// </summary>
1033
                /// <remarks>
1034
                /// System variable PUCSBASE
1035
                /// </remarks>
1036
                [CadSystemVariable("$PUCSBASE", true, 2)]
1037
                public string PaperSpaceBaseName
1038
                {
1039
                        get { return this.PaperSpaceUcsBase.Name; }
×
1040
                        set
1041
                        {
×
1042
                                this.PaperSpaceUcsBase.Name = value;
×
1043
                        }
×
1044
                }
1045

1046
                /// <summary>
1047
                /// Current paper space UCS name
1048
                /// </summary>
1049
                /// <remarks>
1050
                /// System variable PUCSNAME
1051
                /// </remarks>
1052
                [CadSystemVariable("$PUCSNAME", true, 2)]
1053
                public string PaperSpaceName
1054
                {
1055
                        get { return this.PaperSpaceUcs.Name; }
×
1056
                        set
1057
                        {
×
1058
                                this.PaperSpaceUcs.Name = value;
×
1059
                        }
×
1060
                }
1061

1062
                /// <summary>
1063
                /// Origin of current UCS (in WCS)
1064
                /// </summary>
1065
                /// <remarks>
1066
                /// System variable PUCSORG
1067
                /// </remarks>
1068
                [CadSystemVariable("$PUCSORG", 10, 20, 30)]
1069
                public XYZ PaperSpaceUcsOrigin
1070
                {
1071
                        get { return this.PaperSpaceUcs.Origin; }
90✔
1072
                        set
1073
                        {
312✔
1074
                                this.PaperSpaceUcs.Origin = value;
312✔
1075
                        }
312✔
1076
                }
1077

1078
                /// <summary>
1079
                /// Direction of the current UCS X axis (in WCS)
1080
                /// </summary>
1081
                /// <remarks>
1082
                /// System variable PUCSXDIR
1083
                /// </remarks>
1084
                [CadSystemVariable("$PUCSXDIR", 10, 20, 30)]
1085
                public XYZ PaperSpaceUcsXAxis
1086
                {
1087
                        get { return this.PaperSpaceUcs.XAxis; }
90✔
1088
                        set
1089
                        {
312✔
1090
                                this.PaperSpaceUcs.XAxis = value;
312✔
1091
                        }
312✔
1092
                }
1093

1094
                /// <summary>
1095
                /// Direction of the current UCS Y aYis (in WCS)
1096
                /// </summary>
1097
                /// <remarks>
1098
                /// System variable PUCSYDIR
1099
                /// </remarks>
1100
                [CadSystemVariable("$PUCSYDIR", 10, 20, 30)]
1101
                public XYZ PaperSpaceUcsYAxis
1102
                {
1103
                        get { return this.PaperSpaceUcs.YAxis; }
90✔
1104
                        set
1105
                        {
312✔
1106
                                this.PaperSpaceUcs.YAxis = value;
312✔
1107
                        }
312✔
1108
                }
1109

1110
                /// <summary>
1111
                /// Point which becomes the new UCS origin after changing paper space UCS to TOP when PUCSBASE is set to WORLD
1112
                /// </summary>
1113
                /// <remarks>
1114
                /// System variable PUCSORGTOP
1115
                /// </remarks>
1116
                [CadSystemVariable("$PUCSORGTOP", 10, 20, 30)]
1117
                public XYZ PaperSpaceOrthographicTopDOrigin { get; set; }
294✔
1118

1119
                /// <summary>
1120
                /// Point which becomes the new UCS origin after changing paper space UCS to BOTTOM when PUCSBASE is set to WORLD
1121
                /// </summary>
1122
                /// <remarks>
1123
                /// System variable PUCSORGBOTTOM
1124
                /// </remarks>
1125
                [CadSystemVariable("$PUCSORGBOTTOM", 10, 20, 30)]
1126
                public XYZ PaperSpaceOrthographicBottomDOrigin { get; set; }
294✔
1127

1128
                /// <summary>
1129
                /// Point which becomes the new UCS origin after changing paper space UCS to LEFT when PUCSBASE is set to WORLD
1130
                /// </summary>
1131
                /// <remarks>
1132
                /// System variable PUCSORGLEFT
1133
                /// </remarks>
1134
                [CadSystemVariable("$PUCSORGLEFT", 10, 20, 30)]
1135
                public XYZ PaperSpaceOrthographicLeftDOrigin { get; set; }
294✔
1136

1137
                /// <summary>
1138
                /// Point which becomes the new UCS origin after changing paper space UCS to RIGHT when PUCSBASE is set to WORLD
1139
                /// </summary>
1140
                /// <remarks>
1141
                /// System variable PUCSORGRIGHT
1142
                /// </remarks>
1143
                [CadSystemVariable("$PUCSORGRIGHT", 10, 20, 30)]
1144
                public XYZ PaperSpaceOrthographicRightDOrigin { get; set; }
294✔
1145

1146
                /// <summary>
1147
                /// Point which becomes the new UCS origin after changing paper space UCS to FRONT when PUCSBASE is set to WORLD
1148
                /// </summary>
1149
                /// <remarks>
1150
                /// System variable PUCSORGFRONT
1151
                /// </remarks>
1152
                [CadSystemVariable("$PUCSORGFRONT", 10, 20, 30)]
1153
                public XYZ PaperSpaceOrthographicFrontDOrigin { get; set; }
294✔
1154

1155
                /// <summary>
1156
                /// Point which becomes the new UCS origin after changing paper space UCS to BACK when PUCSBASE is set to WORLD
1157
                /// </summary>
1158
                /// <remarks>
1159
                /// System variable PUCSORGBACK
1160
                /// </remarks>
1161
                [CadSystemVariable("$PUCSORGBACK", 10, 20, 30)]
1162
                public XYZ PaperSpaceOrthographicBackDOrigin { get; set; }
294✔
1163

1164
                /// <summary>
1165
                /// Point which becomes the new UCS origin after changing model space UCS to TOP when PUCSBASE is set to WORLD
1166
                /// </summary>
1167
                /// <remarks>
1168
                /// System variable UCSORGTOP
1169
                /// </remarks>
1170
                [CadSystemVariable("$UCSORGTOP", 10, 20, 30)]
1171
                public XYZ ModelSpaceOrthographicTopDOrigin { get; set; }
294✔
1172

1173
                /// <summary>
1174
                /// Point which becomes the new UCS origin after changing model space UCS to BOTTOM when PUCSBASE is set to WORLD
1175
                /// </summary>
1176
                /// <remarks>
1177
                /// System variable UCSORGBOTTOM
1178
                /// </remarks>
1179
                [CadSystemVariable("$UCSORGBOTTOM", 10, 20, 30)]
1180
                public XYZ ModelSpaceOrthographicBottomDOrigin { get; set; }
294✔
1181

1182
                /// <summary>
1183
                /// Point which becomes the new UCS origin after changing model space UCS to LEFT when PUCSBASE is set to WORLD
1184
                /// </summary>
1185
                /// <remarks>
1186
                /// System variable UCSORGLEFT
1187
                /// </remarks>
1188
                [CadSystemVariable("$UCSORGLEFT", 10, 20, 30)]
1189
                public XYZ ModelSpaceOrthographicLeftDOrigin { get; set; }
294✔
1190

1191
                /// <summary>
1192
                /// Point which becomes the new UCS origin after changing model space UCS to RIGHT when PUCSBASE is set to WORLD
1193
                /// </summary>
1194
                /// <remarks>
1195
                /// System variable UCSORGRIGHT
1196
                /// </remarks>
1197
                [CadSystemVariable("$UCSORGRIGHT", 10, 20, 30)]
1198
                public XYZ ModelSpaceOrthographicRightDOrigin { get; set; }
294✔
1199

1200
                /// <summary>
1201
                /// Point which becomes the new UCS origin after changing model space UCS to FRONT when PUCSBASE is set to WORLD
1202
                /// </summary>
1203
                /// <remarks>
1204
                /// System variable UCSORGFRONT
1205
                /// </remarks>
1206
                [CadSystemVariable("$UCSORGFRONT", 10, 20, 30)]
1207
                public XYZ ModelSpaceOrthographicFrontDOrigin { get; set; }
294✔
1208

1209
                /// <summary>
1210
                /// Point which becomes the new UCS origin after changing model space UCS to BACK when PUCSBASE is set to WORLD
1211
                /// </summary>
1212
                /// <remarks>
1213
                /// System variable UCSORGBACK
1214
                /// </remarks>
1215
                [CadSystemVariable("$UCSORGBACK", 10, 20, 30)]
1216
                public XYZ ModelSpaceOrthographicBackDOrigin { get; set; }
294✔
1217

1218
                /// <summary>
1219
                /// Insertion base set by BASE command(in WCS)
1220
                /// </summary>
1221
                /// <remarks>
1222
                /// System variable INSBASE
1223
                /// </remarks>
1224
                [CadSystemVariable("$INSBASE", 10, 20, 30)]
1225
                public XYZ ModelSpaceInsertionBase { get; set; } = XYZ.Zero;
1,054✔
1226

1227
                /// <summary>
1228
                /// X, Y, and Z drawing extents lower-left corner (in WCS)
1229
                /// </summary>
1230
                /// <remarks>
1231
                /// System variable EXTMIN
1232
                /// </remarks>
1233
                [CadSystemVariable("$EXTMIN", 10, 20, 30)]
1234
                public XYZ ModelSpaceExtMin { get; set; }
342✔
1235

1236
                /// <summary>
1237
                /// X, Y, and Z drawing extents upper-right corner(in WCS)
1238
                /// </summary>
1239
                /// <remarks>
1240
                /// System variable EXTMAX
1241
                /// </remarks>
1242
                [CadSystemVariable("$EXTMAX", 10, 20, 30)]
1243
                public XYZ ModelSpaceExtMax { get; set; }
342✔
1244

1245
                /// <summary>
1246
                /// XY drawing limits lower-left corner (in WCS)
1247
                /// </summary>
1248
                /// <remarks>
1249
                /// System variable LIMMIN
1250
                /// </remarks>
1251
                [CadSystemVariable("$LIMMIN", 10, 20)]
1252
                public XY ModelSpaceLimitsMin { get; set; }
342✔
1253

1254
                /// <summary>
1255
                /// XY drawing limits upper-right corner (in WCS)
1256
                /// </summary>
1257
                /// <remarks>
1258
                /// System variable LIMMAX
1259
                /// </remarks>
1260
                [CadSystemVariable("$LIMMAX", 10, 20)]
1261
                public XY ModelSpaceLimitsMax { get; set; }
342✔
1262

1263
                /// <summary>
1264
                /// Name of the UCS that defines the origin and orientation of orthographic UCS settings
1265
                /// </summary>
1266
                /// <remarks>
1267
                /// System variable UCSBASE
1268
                /// </remarks>
1269
                [CadSystemVariable("$UCSBASE", true, 2)]
1270
                public string UcsBaseName
1271
                {
1272
                        get { return this.ModelSpaceUcsBase.Name; }
×
1273
                        set
1274
                        {
×
1275
                                this.ModelSpaceUcsBase.Name = value;
×
1276
                        }
×
1277
                }
1278

1279
                /// <summary>
1280
                /// Name of current UCS
1281
                /// </summary>
1282
                /// <remarks>
1283
                /// System variable UCSNAME
1284
                /// </remarks>
1285
                [CadSystemVariable("$UCSNAME", true, 2)]
1286
                public string UcsName
1287
                {
1288
                        get { return this.ModelSpaceUcs.Name; }
×
1289
                        set
1290
                        {
×
1291
                                this.ModelSpaceUcs.Name = value;
×
1292
                        }
×
1293
                }
1294

1295
                /// <summary>
1296
                /// Current elevation set by ELEV command
1297
                /// </summary>
1298
                /// <remarks>
1299
                /// System variable ELEVATION
1300
                /// </remarks>
1301
                [CadSystemVariable("$ELEVATION", 40)]
1302
                public double Elevation
1303
                {
1304
                        get { return this.ModelSpaceUcs.Elevation; }
90✔
1305
                        set
1306
                        {
312✔
1307
                                this.ModelSpaceUcs.Elevation = value;
312✔
1308
                        }
312✔
1309
                }
1310

1311
                /// <summary>
1312
                /// Origin of current UCS(in WCS)
1313
                /// </summary>
1314
                /// <remarks>
1315
                /// System variable UCSORG
1316
                /// </remarks>
1317
                [CadSystemVariable("$UCSORG", 10, 20, 30)]
1318
                public XYZ ModelSpaceOrigin
1319
                {
1320
                        get { return this.ModelSpaceUcs.Origin; }
90✔
1321
                        set
1322
                        {
312✔
1323
                                this.ModelSpaceUcs.Origin = value;
312✔
1324
                        }
312✔
1325
                }
1326

1327
                /// <summary>
1328
                /// Direction of the current UCS X axis (in WCS)
1329
                /// </summary>
1330
                /// <remarks>
1331
                /// System variable UCSXDIR
1332
                /// </remarks>
1333
                [CadSystemVariable("$UCSXDIR", 10, 20, 30)]
1334
                public XYZ ModelSpaceXAxis
1335
                {
1336
                        get { return this.ModelSpaceUcs.XAxis; }
90✔
1337
                        set
1338
                        {
312✔
1339
                                this.ModelSpaceUcs.XAxis = value;
312✔
1340
                        }
312✔
1341
                }
1342

1343
                /// <summary>
1344
                /// Direction of the current UCS Y axis (in WCS)
1345
                /// </summary>
1346
                /// <remarks>
1347
                /// System variable UCSYDIR
1348
                /// </remarks>
1349
                [CadSystemVariable("$UCSYDIR", 10, 20, 30)]
1350
                public XYZ ModelSpaceYAxis
1351
                {
1352
                        get { return this.ModelSpaceUcs.YAxis; }
90✔
1353
                        set
1354
                        {
312✔
1355
                                this.ModelSpaceUcs.YAxis = value;
312✔
1356
                        }
312✔
1357
                }
1358

1359
                /// <summary>
1360
                /// Arrow block name
1361
                /// </summary>
1362
                /// <remarks>
1363
                /// System variable DIMBLK
1364
                /// </remarks>
1365
                [CadSystemVariable("$DIMBLK", 1)]
1366
                public string DimensionBlockName { get; set; } = string.Empty;
724✔
1367

1368
                /// <summary>
1369
                /// Arrow block name for leaders
1370
                /// </summary>
1371
                /// <remarks>
1372
                /// System variable DIMLDRBLK
1373
                /// </remarks>
1374
                [CadSystemVariable("$DIMLDRBLK", 1)]
1375
                public string ArrowBlockName { get; set; } = string.Empty;
676✔
1376

1377
                /// <summary>
1378
                /// First arrow block name
1379
                /// </summary>
1380
                /// <remarks>
1381
                /// System variable DIMBLK1
1382
                /// </remarks>
1383
                [CadSystemVariable("$DIMBLK1", 1)]
1384
                public string DimensionBlockNameFirst { get; set; }
204✔
1385

1386
                /// <summary>
1387
                /// Second arrow block name
1388
                /// </summary>
1389
                /// <remarks>
1390
                /// System variable DIMBLK2
1391
                /// </remarks>
1392
                [CadSystemVariable("$DIMBLK2", 1)]
1393
                public string DimensionBlockNameSecond { get; set; }
204✔
1394

1395
                /// <remarks>
1396
                /// System variable TSTACKALIGN, default = 1(not present in DXF)
1397
                /// </remarks>
1398
                public short StackedTextAlignment { get; internal set; } = 1;
658✔
1399

1400
                /// <remarks>
1401
                /// TSTACKSIZE, default = 70(not present in DXF)
1402
                /// </remarks>
1403
                public short StackedTextSizePercentage { get; internal set; } = 70;
658✔
1404

1405
                /// <summary>
1406
                /// Path for all relative hyperlinks in the drawing. If null, the drawing path is used
1407
                /// </summary>
1408
                /// <remarks>
1409
                /// System variable HYPERLINKBASE
1410
                /// </remarks>
1411
                [CadSystemVariable("$HYPERLINKBASE", 1)]
1412
                public string HyperLinkBase { get; set; }
294✔
1413

1414
                /// <summary>
1415
                /// Line weight of new objects
1416
                /// </summary>
1417
                /// <remarks>
1418
                /// System variable CELWEIGHT
1419
                /// </remarks>
1420
                [CadSystemVariable("$CELWEIGHT", 370)]
1421
                public LineweightType CurrentEntityLineWeight { get; set; } = LineweightType.ByLayer;
916✔
1422

1423
                /// <summary>
1424
                /// Line weight end-caps setting for new objects
1425
                /// </summary>
1426
                /// <remarks>
1427
                /// System variable ENDCAPS
1428
                /// </remarks>
1429
                [CadSystemVariable("$ENDCAPS", 280)]
1430
                public short EndCaps { get; set; }
294✔
1431

1432
                /// <summary>
1433
                /// Line weight joint setting for new objects
1434
                /// </summary>
1435
                /// <remarks>
1436
                /// System variable JOINSTYLE
1437
                /// </remarks>
1438
                [CadSystemVariable("$JOINSTYLE", 280)]
1439
                public short JoinStyle { get; set; }
294✔
1440

1441
                /// <summary>
1442
                /// Controls whether the lineweights of objects are displayed.<br/>
1443
                /// 0 = Lineweight is not displayed<br/>
1444
                /// 1 = Lineweight is displayed
1445
                /// </summary>
1446
                /// <remarks>
1447
                /// System variable LWDISPLAY
1448
                /// </remarks>
1449
                [CadSystemVariable("$LWDISPLAY", 290)]
1450
                public bool DisplayLineWeight { get; set; } = false;
916✔
1451

1452
                /// <summary>
1453
                /// Controls whether the current drawing can be edited in-place when being referenced by another drawing
1454
                /// </summary>
1455
                /// <remarks>
1456
                /// System variable XEDIT
1457
                /// </remarks>
1458
                [CadSystemVariable("$XEDIT", 290)]
1459
                public bool XEdit { get; set; }
294✔
1460

1461
                /// <summary>
1462
                /// Controls symbol table naming
1463
                /// </summary>
1464
                /// <remarks>
1465
                /// System variable EXTNAMES
1466
                /// </remarks>
1467
                [CadSystemVariable("$EXTNAMES", 290)]
1468
                public bool ExtendedNames { get; set; } = true;
916✔
1469

1470
                /// <summary>
1471
                /// Indicates whether the current drawing is in a Color-Dependent or Named Plot Style mode
1472
                /// </summary>
1473
                /// <remarks>
1474
                /// System variable PSTYLEMODE
1475
                /// </remarks>
1476
                [CadSystemVariable("$PSTYLEMODE", 290)]
1477
                public short PlotStyleMode { get; set; }
294✔
1478

1479
                /// <remarks>
1480
                /// System variable OLESTARTUP
1481
                /// </remarks>
1482
                //[CadSystemVariable("$OLESTARTUP", 290)]
1483
                public bool LoadOLEObject { get; set; }
138✔
1484

1485
                /// <summary>
1486
                /// Default drawing units for blocks
1487
                /// </summary>
1488
                /// <remarks>
1489
                /// System variable INSUNITS
1490
                /// </remarks>
1491
                [CadSystemVariable("$INSUNITS", 70)]
1492
                public UnitsType InsUnits { get; set; } = UnitsType.Unitless;
916✔
1493

1494
                /// <summary>
1495
                /// Plot style type of new objects
1496
                /// </summary>
1497
                /// <remarks>
1498
                /// System variable CEPSNTYPE
1499
                /// </remarks>
1500
                [CadSystemVariable("$CEPSNTYPE", 380)]
1501
                public EntityPlotStyleType CurrentEntityPlotStyle { get; set; }
432✔
1502

1503
                /// <summary>
1504
                /// Set at creation time, uniquely identifies a particular drawing
1505
                /// </summary>
1506
                /// <remarks>
1507
                /// System variable FINGERPRINTGUID
1508
                /// </remarks>
1509
                [CadSystemVariable("$FINGERPRINTGUID", 2)]
1510
                public string FingerPrintGuid { get; internal set; } = Guid.NewGuid().ToString();
814✔
1511

1512
                /// <summary>
1513
                /// Uniquely identifies a particular version of a drawing. Updated when the drawing is modified
1514
                /// </summary>
1515
                /// <remarks>
1516
                /// System variable VERSIONGUID
1517
                /// </remarks>
1518
                [CadSystemVariable("$VERSIONGUID", 2)]
1519
                public string VersionGuid { get; internal set; } = Guid.NewGuid().ToString();
814✔
1520

1521
                /// <summary>
1522
                /// Controls the object sorting methods
1523
                /// </summary>
1524
                /// <remarks>
1525
                /// System variable SORTENTS
1526
                /// </remarks>
1527
                [CadSystemVariable("$SORTENTS", 280)]
1528
                public ObjectSortingFlags EntitySortingFlags { get; set; }
245✔
1529

1530
                /// <summary>
1531
                /// Controls whether layer and spatial indexes are created and saved in drawing files
1532
                /// </summary>
1533
                /// <remarks>
1534
                /// System variable INDEXCTL
1535
                /// </remarks>
1536
                [CadSystemVariable("$INDEXCTL", 280)]
1537
                public IndexCreationFlags IndexCreationFlags { get; set; }
245✔
1538

1539
                /// <summary>
1540
                /// Specifies HIDETEXT system variable
1541
                /// </summary>
1542
                /// <remarks>
1543
                /// System variable HIDETEXT
1544
                /// </remarks>
1545
                [CadSystemVariable("$HIDETEXT", 280)]   //note: mismatch with docs, code 290
1546
                public byte HideText { get; set; }
245✔
1547

1548
                /// <summary>
1549
                /// Controls the visibility of xref clipping boundaries
1550
                /// </summary>
1551
                /// <remarks>
1552
                /// System variable XCLIPFRAME
1553
                /// </remarks>
1554
                [CadSystemVariable("$XCLIPFRAME", 280)] //note: mismatch with docs, code 290
1555
                public byte ExternalReferenceClippingBoundaryType { get; set; }
245✔
1556

1557
                /// <summary>
1558
                /// Controls the associativity of dimension objects
1559
                /// </summary>
1560
                /// <remarks>
1561
                /// System variable DIMASSOC
1562
                /// </remarks>
1563
                [CadSystemVariable("$DIMASSOC", 280)]
1564
                public DimensionAssociation DimensionAssociativity { get; set; } = DimensionAssociation.CreateExplodedDimensions;
765✔
1565

1566
                /// <summary>
1567
                /// 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
1568
                /// </summary>
1569
                /// <remarks>
1570
                /// System variable HALOGAP
1571
                /// </remarks>
1572
                [CadSystemVariable("$HALOGAP", 280)]
1573
                public byte HaloGapPercentage { get; set; } = 0;
765✔
1574

1575
                public Color ObscuredColor { get; set; }
115✔
1576

1577
                /// <summary>
1578
                /// Represents the ACI color index of the "interference objects" created during the INTERFERE command. Default value is 1
1579
                /// </summary>
1580
                /// <remarks>
1581
                /// System variable INTERFERECOLOR
1582
                /// </remarks>
1583
                [CadSystemVariable("$INTERFERECOLOR", 62)]
1584
                public Color InterfereColor { get; set; } = new Color(1);
832✔
1585

1586
                /// <remarks>
1587
                /// System variable OBSCUREDLTYPE
1588
                /// </remarks>
1589
                public byte ObscuredType { get; set; }
115✔
1590

1591
                public byte IntersectionDisplay { get; set; }
115✔
1592

1593
                /// <summary>
1594
                /// 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
1595
                /// </summary>
1596
                /// <remarks>
1597
                /// System variable PROJECTNAME
1598
                /// </remarks>
1599
                [CadSystemVariable("$PROJECTNAME", 1)]
1600
                public string ProjectName { get; set; }
245✔
1601

1602
                /// <remarks>
1603
                /// System variable CAMERADISPLAY
1604
                /// </remarks>
1605
                [CadSystemVariable("$CAMERADISPLAY", 290)]
1606
                public bool CameraDisplayObjects { get; set; }
197✔
1607

1608
                /// <summary>
1609
                /// Specifies the number of steps taken per second when you are in walk or fly mode.
1610
                /// </summary>
1611
                /// <remarks>
1612
                /// System variable STEPSPERSEC
1613
                /// </remarks>
1614
                /// <value>
1615
                /// Valid values are from 1 to 30
1616
                /// </value>
1617
                [CadSystemVariable("$STEPSPERSEC", 40)]
1618
                public double StepsPerSecond
1619
                {
1620
                        get
1621
                        {
16✔
1622
                                return this._stepsPerSecond;
16✔
1623
                        }
16✔
1624
                        set
1625
                        {
181✔
1626
                                ObjectExtensions.InRange(value, 1, 30, "STEPSPERSEC valid values are from 1 to 30");
181✔
1627
                                this._stepsPerSecond = value;
181✔
1628
                        }
181✔
1629
                }
1630

1631
                private double _stepsPerSecond = 2.0d;
520✔
1632

1633
                /// <summary>
1634
                /// Specifies the size of each step when in walk or fly mode, in drawing units.
1635
                /// </summary>
1636
                /// <remarks>
1637
                /// System variable STEPSIZE
1638
                /// </remarks>
1639
                [CadSystemVariable("$STEPSIZE", 40)]
1640
                public double StepSize { get; set; } = 6.0d;
717✔
1641

1642
                /// <remarks>
1643
                /// System variable 3DDWFPREC
1644
                /// </remarks>
1645
                [CadSystemVariable("$3DDWFPREC", 40)]
1646
                public double Dw3DPrecision { get; set; }
197✔
1647

1648
                /// <remarks>
1649
                /// System variable LENSLENGTH
1650
                /// </remarks>
1651
                [CadSystemVariable("$LENSLENGTH", 40)]
1652
                public double LensLength { get; set; }
197✔
1653

1654
                /// <remarks>
1655
                /// System variable CAMERAHEIGHT
1656
                /// </remarks>
1657
                [CadSystemVariable("$CAMERAHEIGHT", 40)]
1658
                public double CameraHeight { get; set; }
197✔
1659

1660
                /// <remarks>
1661
                /// System variable SOLIDHIST
1662
                /// </remarks>
1663
                [CadSystemVariable("$SOLIDHIST", 280)]
1664
                public char SolidsRetainHistory { get; set; }
197✔
1665

1666
                /// <remarks>
1667
                /// System variable SHOWHIST
1668
                /// </remarks>
1669
                [CadSystemVariable("$SHOWHIST", 280)]
1670
                public char ShowSolidsHistory { get; set; }
197✔
1671

1672
                /// <remarks>
1673
                /// System variable PSOLWIDTH
1674
                /// </remarks>
1675
                [CadSystemVariable("$PSOLWIDTH", 40)]
1676
                public double SweptSolidWidth { get; set; }
197✔
1677

1678
                /// <remarks>
1679
                /// System variable PSOLHEIGHT
1680
                /// </remarks>
1681
                [CadSystemVariable("$PSOLHEIGHT", 40)]
1682
                public double SweptSolidHeight { get; set; }
197✔
1683

1684
                /// <remarks>
1685
                /// System variable LOFTANG1
1686
                /// </remarks>
1687
                [CadSystemVariable("$LOFTANG1", 40)]
1688
                public double DraftAngleFirstCrossSection { get; set; }
197✔
1689

1690
                /// <remarks>
1691
                /// System variable LOFTANG2
1692
                /// </remarks>
1693
                [CadSystemVariable("$LOFTANG2", 40)]
1694
                public double DraftAngleSecondCrossSection { get; set; }
197✔
1695

1696
                /// <remarks>
1697
                /// System variable LOFTMAG1
1698
                /// </remarks>
1699
                [CadSystemVariable("$LOFTMAG1", 40)]
1700
                public double DraftMagnitudeFirstCrossSection { get; set; }
197✔
1701

1702
                /// <remarks>
1703
                /// System variable LOFTMAG2
1704
                /// </remarks>
1705
                [CadSystemVariable("$LOFTMAG2", 40)]
1706
                public double DraftMagnitudeSecondCrossSection { get; set; }
197✔
1707

1708
                /// <remarks>
1709
                /// System variable LOFTPARAM
1710
                /// </remarks>
1711
                [CadSystemVariable("$LOFTPARAM", 70)]
1712
                public short SolidLoftedShape { get; set; }
197✔
1713

1714
                /// <remarks>
1715
                /// System variable LOFTNORMALS
1716
                /// </remarks>
1717
                [CadSystemVariable("$LOFTNORMALS", 280)]
1718
                public char LoftedObjectNormals { get; set; }
197✔
1719

1720
                /// <summary>
1721
                /// Specifies the latitude of the drawing model in decimal format.
1722
                /// </summary>
1723
                /// <remarks>
1724
                /// System variable LATITUDE
1725
                /// </remarks>
1726
                [CadSystemVariable("$LATITUDE", 40)]
1727
                public double Latitude { get; set; } = 37.7950d;
717✔
1728

1729
                /// <summary>
1730
                /// Specifies the longitude of the drawing model in decimal format.
1731
                /// </summary>
1732
                /// <remarks>
1733
                /// System variable LONGITUDE
1734
                /// </remarks>
1735
                [CadSystemVariable("$LONGITUDE", 40)]
1736
                public double Longitude { get; set; } = -122.394d;
717✔
1737

1738
                /// <remarks>
1739
                /// System variable NORTHDIRECTION
1740
                /// </remarks>
1741
                [CadSystemVariable("$NORTHDIRECTION", 40)]
1742
                public double NorthDirection { get; set; }
197✔
1743

1744
                /// <summary>
1745
                /// Sets the time zone for the sun in the drawing.
1746
                /// </summary>
1747
                /// <remarks>
1748
                /// 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.
1749
                /// <br/>
1750
                /// System variable TIMEZONE
1751
                /// </remarks>
1752
                [CadSystemVariable("$TIMEZONE", 70)]
1753
                public int TimeZone { get; set; } = 0;  //Create enum for variable
717✔
1754

1755
                /// <remarks>
1756
                /// System variable LIGHTGLYPHDISPLAY
1757
                /// </remarks>
1758
                [CadSystemVariable("$LIGHTGLYPHDISPLAY", 280)]
1759
                public char DisplayLightGlyphs { get; set; }
197✔
1760

1761
                /// <remarks>
1762
                /// System variable DWFFRAME
1763
                /// </remarks>
1764
                [CadSystemVariable("$DWFFRAME", 280)]
1765
                public char DwgUnderlayFramesVisibility { get; set; }
197✔
1766

1767
                /// <remarks>
1768
                /// System variable DGNFRAME
1769
                /// </remarks>
1770
                [CadSystemVariable("$DGNFRAME", 280)]
1771
                public char DgnUnderlayFramesVisibility { get; set; }
197✔
1772

1773
                /// <summary>
1774
                /// Shadow mode for a 3D object
1775
                /// </summary>
1776
                /// <remarks>
1777
                /// System variable CSHADOW
1778
                /// </remarks>
1779
                [CadSystemVariable("$CSHADOW", 280)]
1780
                public ShadowMode ShadowMode { get; set; }
197✔
1781

1782
                /// <summary>
1783
                /// Location of the ground shadow plane. This is a Z axis ordinate
1784
                /// </summary>
1785
                /// <remarks>
1786
                /// System variable SHADOWPLANELOCATION
1787
                /// </remarks>
1788
                [CadSystemVariable("$SHADOWPLANELOCATION", 40)]
1789
                public double ShadowPlaneLocation { get; set; }
197✔
1790

1791
                /// <remarks>
1792
                /// System variable STYLESHEET
1793
                /// </remarks>
1794
                [CadSystemVariable("$STYLESHEET", 1)]
1795
                public string StyleSheetName { get; set; }
294✔
1796

1797
                /// <summary>
1798
                /// Dimension text style
1799
                /// </summary>
1800
                /// <remarks>
1801
                /// System variable DIMTXSTY
1802
                /// </remarks>
1803
                [CadSystemVariable("$DIMTXSTY", true, 7)]
1804
                public string DimensionTextStyleName
1805
                {
1806
                        get { return this._dimensionTextStyle.Name; }
×
1807
                        set
1808
                        {
257✔
1809
                                if (this.Document != null)
257✔
1810
                                {
101✔
1811
                                        this._dimensionTextStyle = this.Document.TextStyles[value];
101✔
1812
                                }
101✔
1813
                                else
1814
                                {
156✔
1815
                                        this._dimensionTextStyle = new TextStyle(value);
156✔
1816
                                }
156✔
1817
                        }
257✔
1818
                }
1819

1820
                /// <summary>
1821
                /// Dimension style name
1822
                /// </summary>
1823
                /// <remarks>
1824
                /// System variable DIMSTYLE
1825
                /// </remarks>
1826
                [CadSystemVariable("$DIMSTYLE", true, 2)]
1827
                public string DimensionStyleOverridesName
1828
                {
1829
                        get { return this._dimensionStyleOverrides.Name; }
6,078✔
1830
                        set
1831
                        {
303✔
1832
                                if (this.Document != null)
303✔
1833
                                {
111✔
1834
                                        this._dimensionStyleOverrides = this.Document.DimensionStyles[value];
111✔
1835
                                }
111✔
1836
                                else
1837
                                {
192✔
1838
                                        this._dimensionStyleOverrides = new DimensionStyle(value);
192✔
1839
                                }
192✔
1840
                        }
303✔
1841
                }
1842

1843
                /// <summary>
1844
                /// Number of precision places displayed in angular dimensions
1845
                /// </summary>
1846
                /// <remarks>
1847
                /// System variable DIMADEC
1848
                /// </remarks>
1849
                [CadSystemVariable("$DIMADEC", 70)]
1850
                public short DimensionAngularDimensionDecimalPlaces
1851
                {
1852
                        get { return this.DimensionStyleOverrides.AngularDimensionDecimalPlaces; }
90✔
1853
                        set
1854
                        {
288✔
1855
                                this.DimensionStyleOverrides.AngularDimensionDecimalPlaces = value;
288✔
1856
                        }
288✔
1857
                }
1858

1859
                /// <summary>
1860
                /// Number of decimal places for the tolerance values of a primary units dimension
1861
                /// </summary>
1862
                /// <remarks>
1863
                /// System variable DIMDEC
1864
                /// </remarks>
1865
                [CadSystemVariable("$DIMDEC", 70)]
1866
                public short DimensionDecimalPlaces
1867
                {
1868
                        get { return this.DimensionStyleOverrides.DecimalPlaces; }
90✔
1869
                        set
1870
                        {
288✔
1871
                                this.DimensionStyleOverrides.DecimalPlaces = value;
288✔
1872
                        }
288✔
1873
                }
1874

1875
                /// <summary>
1876
                /// Number of decimal places to display the tolerance values
1877
                /// </summary>
1878
                /// <remarks>
1879
                /// System variable DIMTDEC
1880
                /// </remarks>
1881
                [CadSystemVariable("$DIMTDEC", 70)]
1882
                public short DimensionToleranceDecimalPlaces
1883
                {
1884
                        get { return this.DimensionStyleOverrides.ToleranceDecimalPlaces; }
90✔
1885
                        set
1886
                        {
288✔
1887
                                this.DimensionStyleOverrides.ToleranceDecimalPlaces = value;
288✔
1888
                        }
288✔
1889
                }
1890

1891
                /// <summary>
1892
                /// Alternate unit dimensioning performed if nonzero
1893
                /// </summary>
1894
                /// <remarks>
1895
                /// System variable DIMALT
1896
                /// </remarks>
1897
                [CadSystemVariable("$DIMALT", 70)]
1898
                public bool DimensionAlternateUnitDimensioning
1899
                {
1900
                        get { return this.DimensionStyleOverrides.AlternateUnitDimensioning; }
90✔
1901
                        set
1902
                        {
312✔
1903
                                this.DimensionStyleOverrides.AlternateUnitDimensioning = value;
312✔
1904
                        }
312✔
1905
                }
1906

1907
                /// <summary>
1908
                /// Units format for alternate units of all dimension style family members except angular
1909
                /// </summary>
1910
                /// <remarks>
1911
                /// System variable DIMALTU
1912
                /// </remarks>
1913
                [CadSystemVariable("$DIMALTU", 70)]
1914
                public LinearUnitFormat DimensionAlternateUnitFormat
1915
                {
1916
                        get { return this.DimensionStyleOverrides.AlternateUnitFormat; }
90✔
1917
                        set
1918
                        {
288✔
1919
                                this.DimensionStyleOverrides.AlternateUnitFormat = value;
288✔
1920
                        }
288✔
1921
                }
1922

1923
                /// <summary>
1924
                /// Alternate unit scale factor
1925
                /// </summary>
1926
                /// <remarks>
1927
                /// System variable DIMALTF
1928
                /// </remarks>
1929
                [CadSystemVariable("$DIMALTF", 40)]
1930
                public double DimensionAlternateUnitScaleFactor
1931
                {
1932
                        get { return this.DimensionStyleOverrides.AlternateUnitScaleFactor; }
90✔
1933
                        set
1934
                        {
312✔
1935
                                this.DimensionStyleOverrides.AlternateUnitScaleFactor = value;
312✔
1936
                        }
312✔
1937
                }
1938

1939
                /// <summary>
1940
                /// Extension line offset
1941
                /// </summary>
1942
                /// <remarks>
1943
                /// System variable DIMEXO
1944
                /// </remarks>
1945
                [CadSystemVariable("$DIMEXO", 40)]
1946
                public double DimensionExtensionLineOffset
1947
                {
1948
                        get { return this.DimensionStyleOverrides.ExtensionLineOffset; }
90✔
1949
                        set
1950
                        {
312✔
1951
                                this.DimensionStyleOverrides.ExtensionLineOffset = value;
312✔
1952
                        }
312✔
1953
                }
1954

1955
                /// <summary>
1956
                /// Overall dimensioning scale factor
1957
                /// </summary>
1958
                /// <remarks>
1959
                /// System variable DIMSCALE
1960
                /// </remarks>
1961
                [CadSystemVariable("$DIMSCALE", 40)]
1962
                public double DimensionScaleFactor
1963
                {
1964
                        get { return this.DimensionStyleOverrides.ScaleFactor; }
90✔
1965
                        set
1966
                        {
312✔
1967
                                this.DimensionStyleOverrides.ScaleFactor = value;
312✔
1968
                        }
312✔
1969
                }
1970

1971
                /// <summary>
1972
                /// Alternate unit decimal places
1973
                /// </summary>
1974
                /// <remarks>
1975
                /// System variable DIMALTD
1976
                /// </remarks>
1977
                [CadSystemVariable("$DIMALTD", 70)]
1978
                public short DimensionAlternateUnitDecimalPlaces
1979
                {
1980
                        get { return this.DimensionStyleOverrides.AlternateUnitDecimalPlaces; }
90✔
1981
                        set
1982
                        {
312✔
1983
                                this.DimensionStyleOverrides.AlternateUnitDecimalPlaces = value;
312✔
1984
                        }
312✔
1985
                }
1986

1987
                /// <summary>
1988
                /// Number of decimal places for tolerance values of an alternate units dimension
1989
                /// </summary>
1990
                /// <remarks>
1991
                /// System variable DIMALTTD
1992
                /// </remarks>
1993
                [CadSystemVariable("$DIMALTTD", 70)]
1994
                public short DimensionAlternateUnitToleranceDecimalPlaces
1995
                {
1996
                        get { return this.DimensionStyleOverrides.AlternateUnitToleranceDecimalPlaces; }
90✔
1997
                        set
1998
                        {
288✔
1999
                                this.DimensionStyleOverrides.AlternateUnitToleranceDecimalPlaces = value;
288✔
2000
                        }
288✔
2001
                }
2002

2003
                /// <summary>
2004
                /// Angle format for angular dimensions
2005
                /// </summary>
2006
                /// <remarks>
2007
                /// System variable DIMAUNIT
2008
                /// </remarks>
2009
                [CadSystemVariable("$DIMAUNIT", 70)]
2010
                public AngularUnitFormat DimensionAngularUnit
2011
                {
2012
                        get { return this.DimensionStyleOverrides.AngularUnit; }
75✔
2013
                        set
2014
                        {
269✔
2015
                                this.DimensionStyleOverrides.AngularUnit = value;
269✔
2016
                        }
269✔
2017
                }
2018

2019
                /// <summary>
2020
                /// Undocumented
2021
                /// </summary>
2022
                /// <remarks>
2023
                /// System variable DIMFRAC
2024
                /// </remarks>
2025
                [CadSystemVariable("$DIMFRAC", 70)]
2026
                public FractionFormat DimensionFractionFormat
2027
                {
2028
                        get { return this.DimensionStyleOverrides.FractionFormat; }
75✔
2029
                        set
2030
                        {
269✔
2031
                                this.DimensionStyleOverrides.FractionFormat = value;
269✔
2032
                        }
269✔
2033
                }
2034

2035
                /// <summary>
2036
                /// Sets units for all dimension types except Angular
2037
                /// </summary>
2038
                /// <remarks>
2039
                /// System variable DIMLUNIT
2040
                /// </remarks>
2041
                [CadSystemVariable("$DIMLUNIT", 70)]
2042
                public LinearUnitFormat DimensionLinearUnitFormat
2043
                {
2044
                        get { return this.DimensionStyleOverrides.LinearUnitFormat; }
75✔
2045
                        set
2046
                        {
269✔
2047
                                this.DimensionStyleOverrides.LinearUnitFormat = value;
269✔
2048
                        }
269✔
2049
                }
2050

2051
                /// <summary>
2052
                /// Single-character decimal separator used when creating dimensions whose unit format is decimal
2053
                /// </summary>
2054
                /// <remarks>
2055
                /// System variable DIMLUNIT
2056
                /// </remarks>
2057
                [CadSystemVariable("$DIMDSEP", 70)]
2058
                public char DimensionDecimalSeparator
2059
                {
2060
                        get { return this.DimensionStyleOverrides.DecimalSeparator; }
75✔
2061
                        set
2062
                        {
269✔
2063
                                this.DimensionStyleOverrides.DecimalSeparator = value;
269✔
2064
                        }
269✔
2065
                }
2066

2067
                /// <summary>
2068
                /// Dimension text movement rules decimal
2069
                /// </summary>
2070
                /// <remarks>
2071
                /// System variable DIMTMOVE
2072
                /// </remarks>
2073
                [CadSystemVariable("$DIMTMOVE", 70)]
2074
                public TextMovement DimensionTextMovement
2075
                {
2076
                        get { return this.DimensionStyleOverrides.TextMovement; }
75✔
2077
                        set
2078
                        {
269✔
2079
                                this.DimensionStyleOverrides.TextMovement = value;
269✔
2080
                        }
269✔
2081
                }
2082

2083
                /// <summary>
2084
                /// Horizontal dimension text position
2085
                /// </summary>
2086
                /// <remarks>
2087
                /// System variable DIMJUST
2088
                /// </remarks>
2089
                [CadSystemVariable("$DIMJUST", 70)]
2090
                public DimensionTextHorizontalAlignment DimensionTextHorizontalAlignment
2091
                {
2092
                        get { return this.DimensionStyleOverrides.TextHorizontalAlignment; }
90✔
2093
                        set
2094
                        {
288✔
2095
                                this.DimensionStyleOverrides.TextHorizontalAlignment = value;
288✔
2096
                        }
288✔
2097
                }
2098

2099
                /// <summary>
2100
                /// Suppression of first extension line
2101
                /// </summary>
2102
                /// <remarks>
2103
                /// System variable DIMSD1
2104
                /// </remarks>
2105
                [CadSystemVariable("$DIMSD1", 70)]
2106
                public bool DimensionSuppressFirstDimensionLine
2107
                {
2108
                        get { return this.DimensionStyleOverrides.SuppressFirstDimensionLine; }
15✔
2109
                        set
2110
                        {
175✔
2111
                                this.DimensionStyleOverrides.SuppressFirstDimensionLine = value;
175✔
2112
                        }
175✔
2113
                }
2114

2115
                /// <summary>
2116
                /// Suppression of second extension line
2117
                /// </summary>
2118
                /// <remarks>
2119
                /// System variable DIMSD2
2120
                /// </remarks>
2121
                [CadSystemVariable("$DIMSD2", 70)]
2122
                public bool DimensionSuppressSecondDimensionLine
2123
                {
2124
                        get { return this.DimensionStyleOverrides.SuppressSecondDimensionLine; }
15✔
2125
                        set
2126
                        {
175✔
2127
                                this.DimensionStyleOverrides.SuppressSecondDimensionLine = value;
175✔
2128
                        }
175✔
2129
                }
2130

2131
                /// <summary>
2132
                /// Vertical justification for tolerance values
2133
                /// </summary>
2134
                /// <remarks>
2135
                /// System variable DIMTOL
2136
                /// </remarks>
2137
                [CadSystemVariable("$DIMTOL", 70)]
2138
                public bool DimensionGenerateTolerances
2139
                {
2140
                        get { return this.DimensionStyleOverrides.GenerateTolerances; }
90✔
2141
                        set
2142
                        {
312✔
2143
                                this.DimensionStyleOverrides.GenerateTolerances = value;
312✔
2144
                        }
312✔
2145
                }
2146

2147
                /// <summary>
2148
                /// Vertical justification for tolerance values
2149
                /// </summary>
2150
                /// <remarks>
2151
                /// System variable DIMTOLJ
2152
                /// </remarks>
2153
                [CadSystemVariable("$DIMTOLJ", 70)]
2154
                public ToleranceAlignment DimensionToleranceAlignment
2155
                {
2156
                        get { return this.DimensionStyleOverrides.ToleranceAlignment; }
90✔
2157
                        set
2158
                        {
288✔
2159
                                this.DimensionStyleOverrides.ToleranceAlignment = value;
288✔
2160
                        }
288✔
2161
                }
2162

2163
                /// <summary>
2164
                /// Controls suppression of zeros for primary unit values
2165
                /// </summary>
2166
                /// <remarks>
2167
                /// System variable DIMZIN
2168
                /// </remarks>
2169
                [CadSystemVariable("$DIMZIN", 70)]
2170
                public ZeroHandling DimensionZeroHandling
2171
                {
2172
                        get { return this.DimensionStyleOverrides.ZeroHandling; }
90✔
2173
                        set
2174
                        {
312✔
2175
                                this.DimensionStyleOverrides.ZeroHandling = value;
312✔
2176
                        }
312✔
2177
                }
2178

2179
                /// <summary>
2180
                /// Controls suppression of zeros for tolerance values
2181
                /// </summary>
2182
                /// <remarks>
2183
                /// System variable DIMTZIN
2184
                /// </remarks>
2185
                [CadSystemVariable("$DIMTZIN", 70)]
2186
                public ZeroHandling DimensionToleranceZeroHandling
2187
                {
2188
                        get { return this.DimensionStyleOverrides.ToleranceZeroHandling; }
90✔
2189
                        set
2190
                        {
288✔
2191
                                this.DimensionStyleOverrides.ToleranceZeroHandling = value;
288✔
2192
                        }
288✔
2193
                }
2194

2195
                /// <remarks>
2196
                /// System variable DIMFIT
2197
                /// </remarks>
2198
                [CadSystemVariable("$DIMFIT", 70)]
2199
                public short DimensionFit
2200
                {
2201
                        get { return this.DimensionStyleOverrides.DimensionFit; }
15✔
2202
                        set
2203
                        {
19✔
2204
                                this.DimensionStyleOverrides.DimensionFit = value;
19✔
2205
                        }
19✔
2206
                }
2207

2208
                /// <summary>
2209
                /// Controls suppression of zeros for alternate unit dimension values
2210
                /// </summary>
2211
                /// <remarks>
2212
                /// System variable DIMALTZ
2213
                /// </remarks>
2214
                [CadSystemVariable("$DIMALTZ", 70)]
2215
                public ZeroHandling DimensionAlternateUnitZeroHandling
2216
                {
2217
                        get { return this.DimensionStyleOverrides.AlternateUnitZeroHandling; }
90✔
2218
                        set
2219
                        {
288✔
2220
                                this.DimensionStyleOverrides.AlternateUnitZeroHandling = value;
288✔
2221
                        }
288✔
2222
                }
2223

2224
                /// <summary>
2225
                /// Controls suppression of zeros for alternate tolerance values
2226
                /// </summary>
2227
                /// <remarks>
2228
                /// System variable DIMALTTZ
2229
                /// </remarks>
2230
                [CadSystemVariable("$DIMALTTZ", 70)]
2231
                public ZeroHandling DimensionAlternateUnitToleranceZeroHandling
2232
                {
2233
                        get { return this.DimensionStyleOverrides.AlternateUnitToleranceZeroHandling; }
90✔
2234
                        set
2235
                        {
288✔
2236
                                this.DimensionStyleOverrides.AlternateUnitToleranceZeroHandling = value;
288✔
2237
                        }
288✔
2238
                }
2239

2240
                /// <summary>
2241
                /// Cursor functionality for user-positioned text
2242
                /// </summary>
2243
                /// <remarks>
2244
                /// System variable DIMUPT
2245
                /// </remarks>
2246
                [CadSystemVariable("$DIMUPT", 70)]
2247
                public bool DimensionCursorUpdate
2248
                {
2249
                        get { return this.DimensionStyleOverrides.CursorUpdate; }
90✔
2250
                        set
2251
                        {
288✔
2252
                                this.DimensionStyleOverrides.CursorUpdate = value;
288✔
2253
                        }
288✔
2254
                }
2255

2256
                /// <summary>
2257
                /// Controls dimension text and arrow placement when space is not sufficient to place both within the extension lines
2258
                /// </summary>
2259
                /// <remarks>
2260
                /// System variable DIMATFIT
2261
                /// </remarks>
2262
                [CadSystemVariable("$DIMATFIT", 70)]
2263
                public TextArrowFitType DimensionDimensionTextArrowFit
2264
                {
2265
                        get { return this.DimensionStyleOverrides.DimensionTextArrowFit; }
75✔
2266
                        set
2267
                        {
269✔
2268
                                this.DimensionStyleOverrides.DimensionTextArrowFit = value;
269✔
2269
                        }
269✔
2270
                }
2271

2272
                /// <summary>
2273
                /// Determines rounding of alternate units
2274
                /// </summary>
2275
                /// <remarks>
2276
                /// System variable DIMALTRND
2277
                /// </remarks>
2278
                [CadSystemVariable("$DIMALTRND", 40)]
2279
                public double DimensionAlternateUnitRounding
2280
                {
2281
                        get { return this.DimensionStyleOverrides.AlternateUnitRounding; }
75✔
2282
                        set
2283
                        {
269✔
2284
                                this.DimensionStyleOverrides.AlternateUnitRounding = value;
269✔
2285
                        }
269✔
2286
                }
2287

2288
                /// <summary>
2289
                /// Alternate dimensioning suffix
2290
                /// </summary>
2291
                /// <remarks>
2292
                /// System variable DIMAPOST
2293
                /// </remarks>
2294
                [CadSystemVariable("$DIMAPOST", 1)]
2295
                public string DimensionAlternateDimensioningSuffix
2296
                {
2297
                        get { return this.DimensionStyleOverrides.AlternateDimensioningSuffix; }
90✔
2298
                        set
2299
                        {
312✔
2300
                                this.DimensionStyleOverrides.AlternateDimensioningSuffix = value;
312✔
2301
                        }
312✔
2302
                }
2303

2304
                /// <summary>
2305
                /// Dimensioning arrow size
2306
                /// </summary>
2307
                /// <remarks>
2308
                /// System variable DIMASZ
2309
                /// </remarks>
2310
                [CadSystemVariable("$DIMASZ", 40)]
2311
                public double DimensionArrowSize
2312
                {
2313
                        get { return this.DimensionStyleOverrides.ArrowSize; }
90✔
2314
                        set
2315
                        {
312✔
2316
                                this.DimensionStyleOverrides.ArrowSize = value;
312✔
2317
                        }
312✔
2318
                }
2319

2320
                /// <summary>
2321
                /// Controls suppression of zeros for angular dimensions
2322
                /// </summary>
2323
                /// <remarks>
2324
                /// System variable DIMAZIN
2325
                /// </remarks>
2326
                [CadSystemVariable("$DIMAZIN", 70)]
2327
                public ZeroHandling DimensionAngularZeroHandling
2328
                {
2329
                        get { return this.DimensionStyleOverrides.AngularZeroHandling; }
75✔
2330
                        set
2331
                        {
269✔
2332
                                this.DimensionStyleOverrides.AngularZeroHandling = value;
269✔
2333
                        }
269✔
2334
                }
2335

2336
                /// <summary>
2337
                /// Undocumented
2338
                /// </summary>
2339
                /// <remarks>
2340
                /// System variable DIMARCSYM
2341
                /// </remarks>
2342
                [CadSystemVariable("$DIMARCSYM", 70)]
2343
                public ArcLengthSymbolPosition DimensionArcLengthSymbolPosition
2344
                {
2345
                        get { return this.DimensionStyleOverrides.ArcLengthSymbolPosition; }
48✔
2346
                        set
2347
                        {
181✔
2348
                                this.DimensionStyleOverrides.ArcLengthSymbolPosition = value;
181✔
2349
                        }
181✔
2350
                }
2351

2352
                /// <summary>
2353
                /// Use separate arrow blocks if nonzero
2354
                /// </summary>
2355
                /// <remarks>
2356
                /// System variable DIMSAH
2357
                /// </remarks>
2358
                [CadSystemVariable("$DIMSAH", 70)]
2359
                public bool DimensionSeparateArrowBlocks
2360
                {
2361
                        get { return this.DimensionStyleOverrides.SeparateArrowBlocks; }
90✔
2362
                        set
2363
                        {
312✔
2364
                                this.DimensionStyleOverrides.SeparateArrowBlocks = value;
312✔
2365
                        }
312✔
2366
                }
2367

2368
                /// <summary>
2369
                /// Size of center mark/lines
2370
                /// </summary>
2371
                /// <remarks>
2372
                /// System variable DIMCEN
2373
                /// </remarks>
2374
                [CadSystemVariable("$DIMCEN", 40)]
2375
                public double DimensionCenterMarkSize
2376
                {
2377
                        get { return this.DimensionStyleOverrides.CenterMarkSize; }
90✔
2378
                        set
2379
                        {
312✔
2380
                                this.DimensionStyleOverrides.CenterMarkSize = value;
312✔
2381
                        }
312✔
2382
                }
2383

2384
                /// <summary>
2385
                /// Dimensioning tick size
2386
                /// </summary>
2387
                /// <remarks>
2388
                /// System variable DIMTSZ
2389
                /// </remarks>
2390
                [CadSystemVariable("$DIMTSZ", 40)]
2391
                public double DimensionTickSize
2392
                {
2393
                        get { return this.DimensionStyleOverrides.TickSize; }
90✔
2394
                        set
2395
                        {
312✔
2396
                                this.DimensionStyleOverrides.TickSize = value;
312✔
2397
                        }
312✔
2398
                }
2399

2400
                /// <summary>
2401
                /// Dimension line color
2402
                /// </summary>
2403
                /// <remarks>
2404
                /// System variable DIMCLRD
2405
                /// </remarks>
2406
                [CadSystemVariable("$DIMCLRD", 70)]
2407
                public Color DimensionLineColor
2408
                {
2409
                        get { return this.DimensionStyleOverrides.DimensionLineColor; }
90✔
2410
                        set
2411
                        {
312✔
2412
                                this.DimensionStyleOverrides.DimensionLineColor = value;
312✔
2413
                        }
312✔
2414
                }
2415

2416
                /// <summary>
2417
                /// Dimension extension line color
2418
                /// </summary>
2419
                /// <remarks>
2420
                /// System variable DIMCLRE
2421
                /// </remarks>
2422
                [CadSystemVariable("$DIMCLRE", 70)]
2423
                public Color DimensionExtensionLineColor
2424
                {
2425
                        get { return this.DimensionStyleOverrides.ExtensionLineColor; }
90✔
2426
                        set
2427
                        {
312✔
2428
                                this.DimensionStyleOverrides.ExtensionLineColor = value;
312✔
2429
                        }
312✔
2430
                }
2431

2432
                /// <summary>
2433
                /// Dimension text color
2434
                /// </summary>
2435
                /// <remarks>
2436
                /// System variable DIMCLRT
2437
                /// </remarks>
2438
                [CadSystemVariable("$DIMCLRT", 70)]
2439
                public Color DimensionTextColor
2440
                {
2441
                        get { return this.DimensionStyleOverrides.TextColor; }
90✔
2442
                        set
2443
                        {
312✔
2444
                                this.DimensionStyleOverrides.TextColor = value;
312✔
2445
                        }
312✔
2446
                }
2447

2448
                /// <summary>
2449
                /// Dimension line extension
2450
                /// </summary>
2451
                /// <remarks>
2452
                /// System variable DIMDLE
2453
                /// </remarks>
2454
                [CadSystemVariable("$DIMDLE", 40)]
2455
                public double DimensionLineExtension
2456
                {
2457
                        get { return this.DimensionStyleOverrides.DimensionLineExtension; }
90✔
2458
                        set
2459
                        {
312✔
2460
                                this.DimensionStyleOverrides.DimensionLineExtension = value;
312✔
2461
                        }
312✔
2462
                }
2463

2464
                /// <summary>
2465
                /// Dimension line increment
2466
                /// </summary>
2467
                /// <remarks>
2468
                /// System variable DIMDLI
2469
                /// </remarks>
2470
                [CadSystemVariable("$DIMDLI", 40)]
2471
                public double DimensionLineIncrement
2472
                {
2473
                        get { return this.DimensionStyleOverrides.DimensionLineIncrement; }
90✔
2474
                        set
2475
                        {
312✔
2476
                                this.DimensionStyleOverrides.DimensionLineIncrement = value;
312✔
2477
                        }
312✔
2478
                }
2479

2480
                /// <summary>
2481
                /// Extension line extension
2482
                /// </summary>
2483
                /// <remarks>
2484
                /// System variable DIMEXE
2485
                /// </remarks>
2486
                [CadSystemVariable("$DIMEXE", 40)]
2487
                public double DimensionExtensionLineExtension
2488
                {
2489
                        get { return this.DimensionStyleOverrides.ExtensionLineExtension; }
90✔
2490
                        set
2491
                        {
312✔
2492
                                this.DimensionStyleOverrides.ExtensionLineExtension = value;
312✔
2493
                        }
312✔
2494
                }
2495

2496
                /// <summary>
2497
                /// Undocumented
2498
                /// </summary>
2499
                /// <remarks>
2500
                /// System variable DIMFXLON
2501
                /// </remarks>
2502
                [CadSystemVariable("$DIMFXLON", 70)]
2503
                public bool DimensionIsExtensionLineLengthFixed
2504
                {
2505
                        get { return this.DimensionStyleOverrides.IsExtensionLineLengthFixed; }
48✔
2506
                        set
2507
                        {
181✔
2508
                                this.DimensionStyleOverrides.IsExtensionLineLengthFixed = value;
181✔
2509
                        }
181✔
2510
                }
2511

2512
                /// <summary>
2513
                /// Undocumented
2514
                /// </summary>
2515
                /// <remarks>
2516
                /// System variable DIMFXL
2517
                /// </remarks>
2518
                [CadSystemVariable("$DIMFXL", 40)]
2519
                public double DimensionFixedExtensionLineLength
2520
                {
2521
                        get { return this.DimensionStyleOverrides.FixedExtensionLineLength; }
48✔
2522
                        set
2523
                        {
181✔
2524
                                this.DimensionStyleOverrides.FixedExtensionLineLength = value;
181✔
2525
                        }
181✔
2526
                }
2527

2528
                /// <summary>
2529
                /// Undocumented
2530
                /// </summary>
2531
                /// <remarks>
2532
                /// System variable DIMJOGANG
2533
                /// </remarks>
2534
                [CadSystemVariable("$DIMJOGANG", 40)]
2535
                public double DimensionJoggedRadiusDimensionTransverseSegmentAngle
2536
                {
2537
                        get { return this.DimensionStyleOverrides.JoggedRadiusDimensionTransverseSegmentAngle; }
48✔
2538
                        set
2539
                        {
181✔
2540
                                this.DimensionStyleOverrides.JoggedRadiusDimensionTransverseSegmentAngle = value;
181✔
2541
                        }
181✔
2542
                }
2543

2544
                /// <summary>
2545
                /// Undocumented
2546
                /// </summary>
2547
                /// <remarks>
2548
                /// System variable DIMTFILL
2549
                /// </remarks>
2550
                [CadSystemVariable("$DIMTFILL", 70)]
2551
                public DimensionTextBackgroundFillMode DimensionTextBackgroundFillMode
2552
                {
2553
                        get { return this.DimensionStyleOverrides.TextBackgroundFillMode; }
48✔
2554
                        set
2555
                        {
181✔
2556
                                this.DimensionStyleOverrides.TextBackgroundFillMode = value;
181✔
2557
                        }
181✔
2558
                }
2559

2560
                /// <summary>
2561
                /// Undocumented
2562
                /// </summary>
2563
                /// <remarks>
2564
                /// System variable DIMTFILLCLR
2565
                /// </remarks>
2566
                [CadSystemVariable(DxfReferenceType.Ignored, "$DIMTFILLCLR", 62)]
2567
                public Color DimensionTextBackgroundColor
2568
                {
2569
                        get { return this.DimensionStyleOverrides.TextBackgroundColor; }
48✔
2570
                        set
2571
                        {
181✔
2572
                                this.DimensionStyleOverrides.TextBackgroundColor = value;
181✔
2573
                        }
181✔
2574
                }
2575

2576
                /// <summary>
2577
                /// Undocumented
2578
                /// </summary>
2579
                /// <remarks>
2580
                /// System variable DIMGAP
2581
                /// </remarks>
2582
                [CadSystemVariable("$DIMGAP", 40)]
2583
                public double DimensionLineGap
2584
                {
2585
                        get { return this.DimensionStyleOverrides.DimensionLineGap; }
90✔
2586
                        set
2587
                        {
312✔
2588
                                this.DimensionStyleOverrides.DimensionLineGap = value;
312✔
2589
                        }
312✔
2590
                }
2591

2592
                /// <summary>
2593
                /// Linear measurements scale factor
2594
                /// </summary>
2595
                /// <remarks>
2596
                /// System variable DIMLFAC
2597
                /// </remarks>
2598
                [CadSystemVariable("$DIMLFAC", 40)]
2599
                public double DimensionLinearScaleFactor
2600
                {
2601
                        get { return this.DimensionStyleOverrides.LinearScaleFactor; }
90✔
2602
                        set
2603
                        {
312✔
2604
                                this.DimensionStyleOverrides.LinearScaleFactor = value;
312✔
2605
                        }
312✔
2606
                }
2607

2608
                /// <summary>
2609
                /// Text vertical position
2610
                /// </summary>
2611
                /// <remarks>
2612
                /// System variable DIMTVP
2613
                /// </remarks>
2614
                [CadSystemVariable("$DIMTVP", 40)]
2615
                public double DimensionTextVerticalPosition
2616
                {
2617
                        get { return this.DimensionStyleOverrides.TextVerticalPosition; }
90✔
2618
                        set
2619
                        {
312✔
2620
                                this.DimensionStyleOverrides.TextVerticalPosition = value;
312✔
2621
                        }
312✔
2622
                }
2623

2624
                /// <summary>
2625
                /// Dimension line lineweight
2626
                /// </summary>
2627
                /// <remarks>
2628
                /// System variable DIMLWD
2629
                /// </remarks>
2630
                [CadSystemVariable("$DIMLWD", 70)]
2631
                public LineweightType DimensionLineWeight
2632
                {
2633
                        get { return this.DimensionStyleOverrides.DimensionLineWeight; }
75✔
2634
                        set
2635
                        {
269✔
2636
                                this.DimensionStyleOverrides.DimensionLineWeight = value;
269✔
2637
                        }
269✔
2638
                }
2639

2640
                /// <summary>
2641
                /// Extension line lineweight
2642
                /// </summary>
2643
                /// <remarks>
2644
                /// System variable DIMLWE
2645
                /// </remarks>
2646
                [CadSystemVariable("$DIMLWE", 70)]
2647
                public LineweightType ExtensionLineWeight
2648
                {
2649
                        get { return this.DimensionStyleOverrides.ExtensionLineWeight; }
75✔
2650
                        set
2651
                        {
269✔
2652
                                this.DimensionStyleOverrides.ExtensionLineWeight = value;
269✔
2653
                        }
269✔
2654
                }
2655

2656
                /// <summary>
2657
                /// Undocumented
2658
                /// </summary>
2659
                /// <remarks>
2660
                /// System variable DIMPOST
2661
                /// </remarks>
2662
                [CadSystemVariable("$DIMPOST", 1)]
2663
                public string DimensionPostFix
2664
                {
2665
                        get { return this.DimensionStyleOverrides.PostFix; }
90✔
2666
                        set
2667
                        {
312✔
2668
                                this.DimensionStyleOverrides.PostFix = value;
312✔
2669
                        }
312✔
2670
                }
2671

2672
                /// <summary>
2673
                /// Rounding value for dimension distances
2674
                /// </summary>
2675
                /// <remarks>
2676
                /// System variable DIMRND
2677
                /// </remarks>
2678
                [CadSystemVariable("$DIMRND", 40)]
2679
                public double DimensionRounding
2680
                {
2681
                        get { return this.DimensionStyleOverrides.Rounding; }
90✔
2682
                        set
2683
                        {
312✔
2684
                                this.DimensionStyleOverrides.Rounding = value;
312✔
2685
                        }
312✔
2686
                }
2687

2688
                /// <summary>
2689
                /// First extension line suppressed if nonzero
2690
                /// </summary>
2691
                /// <remarks>
2692
                /// System variable DIMSE1
2693
                /// </remarks>
2694
                [CadSystemVariable("$DIMSE1", 70)]
2695
                public bool DimensionSuppressFirstExtensionLine
2696
                {
2697
                        get { return this.DimensionStyleOverrides.SuppressFirstExtensionLine; }
165✔
2698
                        set
2699
                        {
425✔
2700
                                this.DimensionStyleOverrides.SuppressFirstExtensionLine = value;
425✔
2701
                        }
425✔
2702
                }
2703

2704
                /// <summary>
2705
                /// Second extension line suppressed if nonzero
2706
                /// </summary>
2707
                /// <remarks>
2708
                /// System variable DIMSE2
2709
                /// </remarks>
2710
                [CadSystemVariable("$DIMSE2", 70)]
2711
                public bool DimensionSuppressSecondExtensionLine
2712
                {
2713
                        get { return this.DimensionStyleOverrides.SuppressSecondExtensionLine; }
165✔
2714
                        set
2715
                        {
425✔
2716
                                this.DimensionStyleOverrides.SuppressSecondExtensionLine = value;
425✔
2717
                        }
425✔
2718
                }
2719

2720
                /// <summary>
2721
                /// Suppress outside-extensions dimension lines if nonzero
2722
                /// </summary>
2723
                /// <remarks>
2724
                /// System variable DIMSOXD
2725
                /// </remarks>
2726
                [CadSystemVariable("$DIMSOXD", 70)]
2727
                public bool DimensionSuppressOutsideExtensions
2728
                {
2729
                        get { return this.DimensionStyleOverrides.SuppressOutsideExtensions; }
90✔
2730
                        set
2731
                        {
312✔
2732
                                this.DimensionStyleOverrides.SuppressOutsideExtensions = value;
312✔
2733
                        }
312✔
2734
                }
2735

2736
                /// <summary>
2737
                /// Text above dimension line if nonzero
2738
                /// </summary>
2739
                /// <remarks>
2740
                /// System variable DIMTAD
2741
                /// </remarks>
2742
                [CadSystemVariable("$DIMTAD", 70)]
2743
                public DimensionTextVerticalAlignment DimensionTextVerticalAlignment
2744
                {
2745
                        get { return this.DimensionStyleOverrides.TextVerticalAlignment; }
90✔
2746
                        set
2747
                        {
312✔
2748
                                this.DimensionStyleOverrides.TextVerticalAlignment = value;
312✔
2749
                        }
312✔
2750
                }
2751

2752
                /// <summary>
2753
                /// Controls suppression of zeros for alternate unit dimension values
2754
                /// </summary>
2755
                /// <remarks>
2756
                /// System variable DIMUNIT
2757
                /// </remarks>
2758
                [CadSystemVariable("$DIMUNIT", 70)]
2759
                public short DimensionUnit
2760
                {
2761
                        get { return this.DimensionStyleOverrides.DimensionUnit; }
15✔
2762
                        set
2763
                        {
19✔
2764
                                this.DimensionStyleOverrides.DimensionUnit = value;
19✔
2765
                        }
19✔
2766
                }
2767

2768
                /// <summary>
2769
                /// Dimension tolerance display scale factor
2770
                /// </summary>
2771
                /// <remarks>
2772
                /// System variable DIMTFAC
2773
                /// </remarks>
2774
                [CadSystemVariable("$DIMTFAC", 40)]
2775
                public double DimensionToleranceScaleFactor
2776
                {
2777
                        get { return this.DimensionStyleOverrides.ToleranceScaleFactor; }
90✔
2778
                        set
2779
                        {
312✔
2780
                                this.DimensionStyleOverrides.ToleranceScaleFactor = value;
312✔
2781
                        }
312✔
2782
                }
2783

2784
                /// <summary>
2785
                /// Text inside horizontal if nonzero
2786
                /// </summary>
2787
                /// <remarks>
2788
                /// System variable DIMTIH
2789
                /// </remarks>
2790
                [CadSystemVariable("$DIMTIH", 70)]
2791
                public bool DimensionTextInsideHorizontal
2792
                {
2793
                        get { return this.DimensionStyleOverrides.TextInsideHorizontal; }
90✔
2794
                        set
2795
                        {
312✔
2796
                                this.DimensionStyleOverrides.TextInsideHorizontal = value;
312✔
2797
                        }
312✔
2798
                }
2799

2800
                /// <summary>
2801
                /// Force text inside extensions if nonzero
2802
                /// </summary>
2803
                /// <remarks>
2804
                /// System variable DIMTIX
2805
                /// </remarks>
2806
                [CadSystemVariable("$DIMTIX", 70)]
2807
                public bool DimensionTextInsideExtensions
2808
                {
2809
                        get { return this.DimensionStyleOverrides.TextInsideExtensions; }
90✔
2810
                        set
2811
                        {
312✔
2812
                                this.DimensionStyleOverrides.TextInsideExtensions = value;
312✔
2813
                        }
312✔
2814
                }
2815

2816
                /// <summary>
2817
                /// Minus tolerance
2818
                /// </summary>
2819
                /// <remarks>
2820
                /// System variable DIMTM
2821
                /// </remarks>
2822
                [CadSystemVariable("$DIMTM", 40)]
2823
                public double DimensionMinusTolerance
2824
                {
2825
                        get { return this.DimensionStyleOverrides.MinusTolerance; }
90✔
2826
                        set
2827
                        {
312✔
2828
                                this.DimensionStyleOverrides.MinusTolerance = value;
312✔
2829
                        }
312✔
2830
                }
2831

2832
                /// <summary>
2833
                /// If text is outside the extension lines, dimension lines are forced between the extension lines if nonzero
2834
                /// </summary>
2835
                /// <remarks>
2836
                /// System variable DIMTOFL
2837
                /// </remarks>
2838
                [CadSystemVariable("$DIMTOFL", 70)]
2839
                public bool DimensionTextOutsideExtensions
2840
                {
2841
                        get { return this.DimensionStyleOverrides.TextOutsideExtensions; }
90✔
2842
                        set
2843
                        {
312✔
2844
                                this.DimensionStyleOverrides.TextOutsideExtensions = value;
312✔
2845
                        }
312✔
2846
                }
2847

2848
                /// <summary>
2849
                /// Text outside horizontal if nonzero
2850
                /// </summary>
2851
                /// <remarks>
2852
                /// System variable DIMTOH
2853
                /// </remarks>
2854
                [CadSystemVariable("$DIMTOH", 70)]
2855
                public bool DimensionTextOutsideHorizontal
2856
                {
2857
                        get { return this.DimensionStyleOverrides.TextOutsideHorizontal; }
90✔
2858
                        set
2859
                        {
312✔
2860
                                this.DimensionStyleOverrides.TextOutsideHorizontal = value;
312✔
2861
                        }
312✔
2862
                }
2863

2864
                /// <summary>
2865
                /// Dimension limits generated if nonzero
2866
                /// </summary>
2867
                /// <remarks>
2868
                /// System variable DIMLIM
2869
                /// </remarks>
2870
                [CadSystemVariable("$DIMLIM", 70)]
2871
                public bool DimensionLimitsGeneration
2872
                {
2873
                        get { return this.DimensionStyleOverrides.LimitsGeneration; }
90✔
2874
                        set
2875
                        {
312✔
2876
                                this.DimensionStyleOverrides.LimitsGeneration = value;
312✔
2877
                        }
312✔
2878
                }
2879

2880
                /// <summary>
2881
                /// Plus tolerance
2882
                /// </summary>
2883
                /// <remarks>
2884
                /// System variable DIMTP
2885
                /// </remarks>
2886
                [CadSystemVariable("$DIMTP", 40)]
2887
                public double DimensionPlusTolerance
2888
                {
2889
                        get { return this.DimensionStyleOverrides.PlusTolerance; }
90✔
2890
                        set
2891
                        {
312✔
2892
                                this.DimensionStyleOverrides.PlusTolerance = value;
312✔
2893
                        }
312✔
2894
                }
2895

2896
                /// <summary>
2897
                /// Dimensioning text height
2898
                /// </summary>
2899
                /// <remarks>
2900
                /// System variable DIMTXT
2901
                /// </remarks>
2902
                [CadSystemVariable("$DIMTXT", 40)]
2903
                public double DimensionTextHeight
2904
                {
2905
                        get { return this.DimensionStyleOverrides.TextHeight; }
90✔
2906
                        set
2907
                        {
312✔
2908
                                this.DimensionStyleOverrides.TextHeight = value;
312✔
2909
                        }
312✔
2910
                }
2911

2912
                /// <summary>
2913
                /// Undocumented
2914
                /// </summary>
2915
                /// <remarks>
2916
                /// System variable DIMTXTDIRECTION
2917
                /// </remarks>
2918
                [CadSystemVariable("$DIMTXTDIRECTION", 70)]
2919
                public TextDirection DimensionTextDirection
2920
                {
2921
                        get { return this.DimensionStyleOverrides.TextDirection; }
45✔
2922
                        set
2923
                        {
140✔
2924
                                this.DimensionStyleOverrides.TextDirection = value;
140✔
2925
                        }
140✔
2926
                }
2927

2928
                /// <summary>
2929
                /// Undocumented
2930
                /// </summary>
2931
                /// <remarks>
2932
                /// System variable DIMALTMZF
2933
                /// </remarks>
2934
                [CadSystemVariable("$DIMALTMZF", 40)]
2935
                public double DimensionAltMzf
2936
                {
2937
                        get { return this.DimensionStyleOverrides.AltMzf; }
45✔
2938
                        set
2939
                        {
60✔
2940
                                this.DimensionStyleOverrides.AltMzf = value;
60✔
2941
                        }
60✔
2942
                }
2943

2944
                /// <summary>
2945
                /// Undocumented
2946
                /// </summary>
2947
                /// <remarks>
2948
                /// System variable DIMALTMZS
2949
                /// </remarks>
2950
                [CadSystemVariable("$DIMALTMZS", 6)]
2951
                public string DimensionAltMzs
2952
                {
2953
                        get { return this.DimensionStyleOverrides.AltMzs; }
45✔
2954
                        set
2955
                        {
60✔
2956
                                this.DimensionStyleOverrides.AltMzs = value;
60✔
2957
                        }
60✔
2958
                }
2959

2960
                /// <summary>
2961
                /// Undocumented
2962
                /// </summary>
2963
                /// <remarks>
2964
                /// System variable DIMMZF
2965
                /// </remarks>
2966
                [CadSystemVariable("$DIMMZF", 40)]
2967
                public double DimensionMzf
2968
                {
2969
                        get { return this.DimensionStyleOverrides.Mzf; }
45✔
2970
                        set
2971
                        {
60✔
2972
                                this.DimensionStyleOverrides.Mzf = value;
60✔
2973
                        }
60✔
2974
                }
2975

2976
                /// <summary>
2977
                /// Undocumented
2978
                /// </summary>
2979
                /// <remarks>
2980
                /// System variable DIMMZS
2981
                /// </remarks>
2982
                [CadSystemVariable("$DIMMZS", 6)]
2983
                public string DimensionMzs
2984
                {
2985
                        get { return this.DimensionStyleOverrides.Mzs; }
45✔
2986
                        set
2987
                        {
60✔
2988
                                this.DimensionStyleOverrides.Mzs = value;
60✔
2989
                        }
60✔
2990
                }
2991

2992
                /// <summary>
2993
                /// Undocumented
2994
                /// </summary>
2995
                /// <remarks>
2996
                /// System variable DIMLTYPE
2997
                /// </remarks>
2998
                [CadSystemVariable("$DIMLTYPE", 6)]
2999
                public string DimensionLineType { get; set; } = "ByBlock";
626✔
3000

3001
                /// <summary>
3002
                /// Undocumented
3003
                /// </summary>
3004
                /// <remarks>
3005
                /// System variable DIMLTEX1
3006
                /// </remarks>
3007
                [CadSystemVariable("$DIMLTEX1", 6)]
3008
                public string DimensionTex1 { get; set; } = "ByBlock";
626✔
3009

3010
                /// <summary>
3011
                /// Undocumented
3012
                /// </summary>
3013
                /// <remarks>
3014
                /// System variable DIMLTEX2
3015
                /// </remarks>
3016
                [CadSystemVariable("$DIMLTEX2", 6)]
3017
                public string DimensionTex2 { get; set; } = "ByBlock";
626✔
3018

3019
                public Layer CurrentLayer
3020
                {
3021
                        get
3022
                        {
61✔
3023
                                if (this.Document == null)
61✔
3024
                                {
5✔
3025
                                        return this._currentLayer;
5✔
3026
                                }
3027
                                else
3028
                                {
56✔
3029
                                        return this.Document.Layers[this.CurrentLayerName];
56✔
3030
                                }
3031
                        }
61✔
3032
                        private set
3033
                        {
×
3034
                                this._currentLayer = value;
×
3035
                        }
×
3036
                }
3037

3038
                public LineType CurrentLineType
3039
                {
3040
                        get
3041
                        {
51✔
3042
                                if (this.Document == null)
51!
3043
                                {
×
3044
                                        return this._currentLineType;
×
3045
                                }
3046
                                else
3047
                                {
51✔
3048
                                        return this.Document.LineTypes[this.CurrentLineTypeName];
51✔
3049
                                }
3050
                        }
51✔
3051
                        private set
3052
                        {
×
3053
                                _currentLineType = value;
×
3054
                        }
×
3055
                }
3056

3057
                public TextStyle CurrentTextStyle
3058
                {
3059
                        get
3060
                        {
56✔
3061
                                if (this.Document == null)
56!
3062
                                {
×
3063
                                        return this._currentTextStyle;
×
3064
                                }
3065
                                else
3066
                                {
56✔
3067
                                        return this.Document.TextStyles[this.TextStyleName];
56✔
3068
                                }
3069
                        }
56✔
3070
                        private set
3071
                        {
×
3072
                                this._currentTextStyle = value;
×
3073
                        }
×
3074
                }
3075

3076
                public TextStyle DimensionTextStyle
3077
                {
3078
                        get
3079
                        {
×
3080
                                if (this.Document == null)
×
3081
                                {
×
3082
                                        return this._dimensionTextStyle;
×
3083
                                }
3084
                                else
3085
                                {
×
3086
                                        return this.Document.TextStyles[this.DimensionTextStyleName];
×
3087
                                }
3088
                        }
×
3089
                        private set
3090
                        {
×
3091
                                this._dimensionTextStyle = value;
×
3092
                        }
×
3093
                }
3094

3095
                public DimensionStyle DimensionStyleOverrides
3096
                {
3097
                        get
3098
                        {
21,106✔
3099
                                if (this.Document == null)
21,106✔
3100
                                {
19,170✔
3101
                                        return this._dimensionStyleOverrides;
19,170✔
3102
                                }
3103
                                else
3104
                                {
1,936✔
3105
                                        return this.Document.DimensionStyles[this.DimensionStyleOverridesName];
1,936✔
3106
                                }
3107
                        }
21,106✔
3108
                        private set
3109
                        {
×
3110
                                this._dimensionStyleOverrides = value;
×
3111
                        }
×
3112
                }
3113

3114
                public MLineStyle CurrentMLineStyle
3115
                {
3116
                        get
3117
                        {
×
3118
                                if (this.Document == null)
×
3119
                                {
×
3120
                                        return this._currentMLineStyle;
×
3121
                                }
3122
                                else
3123
                                {
×
3124
                                        return this.Document.MLineStyles[this.CurrentMultiLineStyleName];
×
3125
                                }
3126
                        }
×
3127
                        private set
3128
                        {
×
3129
                                this._currentMLineStyle = value;
×
3130
                        }
×
3131
                }
3132

3133
                //TODO: How header UCS work??
3134
                public UCS ModelSpaceUcs { get; private set; } = new UCS();
1,918✔
3135

3136
                public UCS ModelSpaceUcsBase { get; private set; } = new UCS();
520✔
3137

3138
                public UCS PaperSpaceUcs { get; private set; } = new UCS();
1,918✔
3139

3140
                public UCS PaperSpaceUcsBase { get; private set; } = new UCS();
520✔
3141

3142
                /// <summary>
3143
                /// Document where this header resides
3144
                /// </summary>
3145
                public CadDocument Document { get; internal set; }
26,009✔
3146

3147
                private readonly static PropertyExpression<CadHeader, CadSystemVariableAttribute> _propertyCache;
3148

3149
                private Layer _currentLayer = Layer.Default;
520✔
3150

3151
                private TextStyle _currentTextStyle = TextStyle.Default;
520✔
3152

3153
                private TextStyle _dimensionTextStyle = TextStyle.Default;
520✔
3154

3155
                private DimensionStyle _dimensionStyleOverrides = DimensionStyle.Default;
520✔
3156

3157
                private LineType _currentLineType = LineType.ByLayer;
520✔
3158

3159
                private MLineStyle _currentMLineStyle = MLineStyle.Default;
520✔
3160

3161
                static CadHeader()
3162
                {
1✔
3163
                        _propertyCache = new PropertyExpression<CadHeader, CadSystemVariableAttribute>(
1✔
3164
                                (info, attribute) => attribute.Name);
250✔
3165
                }
1✔
3166

3167
                public CadHeader() : this(ACadVersion.AC1032) { }
1,023✔
3168

3169
                public CadHeader(CadDocument document) : this(ACadVersion.AC1032)
179✔
3170
                {
179✔
3171
                        this.Document = document;
179✔
3172
                }
179✔
3173

3174
                public CadHeader(ACadVersion version)
520✔
3175
                {
520✔
3176
                        this.Version = version;
520✔
3177
                }
520✔
3178

3179
                /// <summary>
3180
                /// Gets a map of all the system variables and it's codes
3181
                /// </summary>
3182
                /// <returns></returns>
3183
                public static Dictionary<string, CadSystemVariable> GetHeaderMap()
3184
                {
237✔
3185
                        Dictionary<string, CadSystemVariable> map = new Dictionary<string, CadSystemVariable>();
237✔
3186
                        foreach (PropertyInfo p in typeof(CadHeader).GetProperties())
128,217✔
3187
                        {
63,753✔
3188
                                CadSystemVariableAttribute att = p.GetCustomAttribute<CadSystemVariableAttribute>();
63,753✔
3189
                                if (att == null)
63,753✔
3190
                                        continue;
4,740✔
3191

3192
                                map.Add(att.Name, new CadSystemVariable(p));
59,013✔
3193
                        }
59,013✔
3194

3195
                        return map;
237✔
3196
                }
237✔
3197

3198
                /// <summary>
3199
                /// Set a value of a system variable by name
3200
                /// </summary>
3201
                /// <param name="systemvar">name of the system var</param>
3202
                /// <param name="values">parameters for the constructor of the value</param>
3203
                public void SetValue(string systemvar, params object[] values)
3204
                {
38,688✔
3205
                        PropertyExpression<CadHeader, CadSystemVariableAttribute>.Prop prop = _propertyCache.GetProperty(systemvar);
38,688✔
3206

3207
                        ConstructorInfo constr = prop.Property.PropertyType.GetConstructor(values.Select(o => o.GetType()).ToArray());
86,136✔
3208

3209
                        if (prop.Property.PropertyType.IsEnum)
38,688✔
3210
                        {
5,492✔
3211
                                int v = Convert.ToInt32(values.First());
5,492✔
3212
                                prop.Setter(this, Enum.ToObject(prop.Property.PropertyType, v));
5,492✔
3213
                        }
5,492✔
3214
                        else if (prop.Property.PropertyType.IsEquivalentTo(typeof(DateTime)))
33,196✔
3215
                        {
720✔
3216
                                double jvalue = (double)values.First();
720✔
3217

3218
                                prop.Setter(this, CadUtils.FromJulianCalendar((double)values.First()));
720✔
3219
                        }
720✔
3220
                        else if (prop.Property.PropertyType.IsEquivalentTo(typeof(TimeSpan)))
32,476✔
3221
                        {
372✔
3222
                                double jvalue = (double)values.First();
372✔
3223

3224
                                prop.Setter(this, CadUtils.EditingTime((double)values.First()));
372✔
3225
                        }
372✔
3226
                        else if (constr == null)
32,104✔
3227
                        {
26,420✔
3228
                                if (prop.Attribute.IsName && values.First() is string name)
26,420✔
3229
                                {
1,764✔
3230
                                        if (!name.IsNullOrEmpty())
1,764✔
3231
                                        {
1,092✔
3232
                                                prop.Setter(this, Convert.ChangeType(values.First(), prop.Property.PropertyType));
1,092✔
3233
                                        }
1,092✔
3234
                                }
1,764✔
3235
                                else
3236
                                {
24,656✔
3237
                                        prop.Setter(this, Convert.ChangeType(values.First(), prop.Property.PropertyType));
24,656✔
3238
                                }
24,656✔
3239
                        }
26,420✔
3240
                        else
3241
                        {
5,684✔
3242
                                prop.Setter(this, Activator.CreateInstance(prop.Property.PropertyType, values));
5,684✔
3243
                        }
5,684✔
3244
                }
38,688✔
3245

3246
                public object GetValue(string systemvar)
3247
                {
×
3248
                        var prop = _propertyCache.GetProperty(systemvar);
×
3249
                        return prop.Getter(this);
×
3250
                }
×
3251

3252
                /// <summary>
3253
                /// Get the primitive values in each dxf code
3254
                /// </summary>
3255
                /// <param name="systemvar"></param>
3256
                /// <returns>dictionary with the codes and values</returns>
3257
                public Dictionary<DxfCode, object> GetValues(string systemvar)
3258
                {
×
3259
                        Dictionary<DxfCode, object> value = null;
×
3260

3261
                        foreach (PropertyInfo p in this.GetType().GetProperties())
×
3262
                        {
×
3263
                                CadSystemVariableAttribute att = p.GetCustomAttribute<CadSystemVariableAttribute>();
×
3264
                                if (att == null)
×
3265
                                        continue;
×
3266

3267
                                if (att.Name == systemvar)
×
3268
                                {
×
3269
                                        value = new Dictionary<DxfCode, object>();
×
3270

3271
                                        if (att.ValueCodes.Length == 1)
×
3272
                                        {
×
3273
                                                value.Add(att.ValueCodes[0], p.GetValue(this));
×
3274
                                        }
×
3275
                                        else
3276
                                        {
×
3277
                                                IVector vector = (IVector)p.GetValue(this);
×
3278
                                                for (int i = 0; i < vector.Dimension; i++)
×
3279
                                                {
×
3280
                                                        value.Add(att.ValueCodes[i], vector[i]);
×
3281
                                                }
×
3282
                                        }
×
3283

3284
                                        break;
×
3285
                                }
3286
                        }
×
3287

3288
                        return value;
×
3289
                }
×
3290

3291
                /// <inheritdoc/>
3292
                public override string ToString()
NEW
3293
                {
×
NEW
3294
                        return $"{this.Version}";
×
NEW
3295
                }
×
3296
        }
3297
}
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