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

DomCR / ACadSharp / 16263272139

14 Jul 2025 09:33AM UTC coverage: 75.046% (+0.03%) from 75.014%
16263272139

Pull #710

github

web-flow
Merge b348803a5 into 9d213afc7
Pull Request #710: dimension reference points

5861 of 8589 branches covered (68.24%)

Branch coverage included in aggregate %.

49 of 58 new or added lines in 7 files covered. (84.48%)

4 existing lines in 3 files now uncovered.

23308 of 30279 relevant lines covered (76.98%)

81438.94 hits per line

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

80.33
/src/ACadSharp/Objects/PlotSettings.cs
1
using ACadSharp.Attributes;
2
using CSMath;
3
using System;
4

5
namespace ACadSharp.Objects
6
{
7
        /// <summary>
8
        /// Represents a <see cref="PlotSettings"/> object
9
        /// </summary>
10
        /// <remarks>
11
        /// Object name <see cref="DxfFileToken.ObjectPlotSettings"/> <br/>
12
        /// Dxf class name <see cref="DxfSubclassMarker.PlotSettings"/>
13
        /// </remarks>
14
        [DxfName(DxfFileToken.ObjectPlotSettings)]
15
        [DxfSubClass(DxfSubclassMarker.PlotSettings)]
16
        public class PlotSettings : NonGraphicalObject
17
        {
18
                /// <inheritdoc/>
19
                public override ObjectType ObjectType => ObjectType.INVALID;
×
20

21
                /// <inheritdoc/>
22
                public override string ObjectName => DxfFileToken.ObjectPlotSettings;
×
23

24
                /// <inheritdoc/>
25
                public override string SubclassMarker => DxfSubclassMarker.PlotSettings;
×
26

27
                /// <summary>
28
                /// Page Setup name
29
                /// </summary>
30
                [DxfCodeValue(1)]
31
                public string PageName { get; set; } = "none_device";
2,619✔
32

33
                /// <summary>
34
                /// Name of system printer or plot configuration file
35
                /// </summary>
36
                [DxfCodeValue(2)]
37
                public string SystemPrinterName { get; set; }
1,594✔
38

39
                /// <summary>
40
                /// Paper size
41
                /// </summary>
42
                [DxfCodeValue(4)]
43
                public string PaperSize { get; set; } = "ISO_A4_(210.00_x_297.00_MM)";
3,513✔
44

45
                /// <summary>
46
                /// Plot view name
47
                /// </summary>
48
                [DxfCodeValue(6)]
49
                public string PlotViewName { get; set; }
1,116✔
50

51
                /// <summary>
52
                /// Size, in millimeters, of unprintable margins of paper
53
                /// </summary>
54
                [DxfCodeValue(40, 41, 42, 43)]
55
                public PaperMargin UnprintableMargin { get; set; } 
8,256✔
56

57
                /// <summary>
58
                /// Physical paper width in millimeters
59
                /// </summary>
60
                [DxfCodeValue(44)]
61
                public double PaperWidth { get; set; }
1,620✔
62

63
                /// <summary>
64
                /// Physical paper height in millimeters
65
                /// </summary>
66
                [DxfCodeValue(45)]
67
                public double PaperHeight { get; set; } 
1,620✔
68

69
                /// <summary>
70
                /// Plot origin: X value of origin offset in millimeters
71
                /// </summary>
72
                [DxfCodeValue(46)]
73
                public double PlotOriginX { get; set; }
1,620✔
74

75
                /// <summary>
76
                /// Plot origin: Y value of origin offset in millimeters
77
                /// </summary>
78
                [DxfCodeValue(47)]
79
                public double PlotOriginY { get; set; }
1,620✔
80

81
                /// <summary>
82
                /// Plot window area: X value of lower-left window corner
83
                /// </summary>
84
                [DxfCodeValue(48)]
85
                public double WindowLowerLeftX { get; set; }
1,620✔
86

87
                /// <summary>
88
                /// Plot window area: Y value of upper-right window corner
89
                /// </summary>
90
                [DxfCodeValue(49)]
91
                public double WindowLowerLeftY { get; set; }
1,620✔
92

93
                /// <summary>
94
                /// Plot window area: X value of lower-left window corner
95
                /// </summary>
96
                [DxfCodeValue(140)]
97
                public double WindowUpperLeftX { get; set; }
1,620✔
98

99
                /// <summary>
100
                /// Plot window area: Y value of upper-right window corner
101
                /// </summary>
102
                [DxfCodeValue(141)]
103
                public double WindowUpperLeftY { get; set; }
1,620✔
104

105
                /// <summary>
106
                /// Gets the scale factor.
107
                /// </summary>
108
                public double PrintScale
109
                {
110
                        get { return this.NumeratorScale / this.DenominatorScale; }
150✔
111
                }
112

113
                /// <summary>
114
                /// Numerator of custom print scale: real world(paper) units
115
                /// </summary>
116
                [DxfCodeValue(142)]
117
                public double NumeratorScale
118
                {
119
                        get { return this._numeratorScale; }
528✔
120
                        set
121
                        {
1,494✔
122
                                if (value <= 0.0)
1,494!
123
                                {
×
124
                                        throw new ArgumentOutOfRangeException(nameof(this.NumeratorScale), value, "Value must be greater than zero");
×
125
                                }
126

127
                                this._numeratorScale = value;
1,494✔
128
                        }
1,494✔
129
                }
130

131
                /// <summary>
132
                /// Denominator of custom print scale: drawing units
133
                /// </summary>
134
                [DxfCodeValue(143)]
135
                public double DenominatorScale
136
                {
137
                        get { return this._denominatorScale; }
528✔
138
                        set
139
                        {
1,494✔
140
                                if (value <= 0.0)
1,494!
141
                                {
×
142
                                        throw new ArgumentOutOfRangeException(nameof(this.DenominatorScale), value, "Value must be greater than zero");
×
143
                                }
144

145
                                this._denominatorScale = value;
1,494✔
146
                        }
1,494✔
147
                }
148

149
                /// <summary>
150
                /// Plot layout flags
151
                /// </summary>
152
                [DxfCodeValue(70)]
153
                public PlotFlags Flags { get; set; } = PlotFlags.DrawViewportsFirst | PlotFlags.PrintLineweights | PlotFlags.PlotPlotStyles | PlotFlags.UseStandardScale;
2,619✔
154

155
                /// <summary>
156
                /// Plot paper units.
157
                /// </summary>
158
                [DxfCodeValue(72)]
159
                public PlotPaperUnits PaperUnits { get; set; } = PlotPaperUnits.Milimeters;
3,513✔
160

161
                /// <summary>
162
                /// Plot paper rotation.
163
                /// </summary>
164
                [DxfCodeValue(73)]
165
                public PlotRotation PaperRotation { get; set; }
1,618✔
166

167
                /// <summary>
168
                /// Portion of paper space to output to the media
169
                /// </summary>
170
                [DxfCodeValue(74)]
171
                public PlotType PlotType { get; set; } = PlotType.DrawingExtents;
3,513✔
172

173
                /// <summary>
174
                /// Current style sheet
175
                /// </summary>
176
                [DxfCodeValue(7)]
177
                public string StyleSheet { get; set; }
1,594✔
178

179
                /// <summary>
180
                /// Standard scale type
181
                /// </summary>
182
                [DxfCodeValue(75)]
183
                public ScaledType ScaledFit { get; set; }
1,618✔
184

185
                /// <summary>
186
                /// Plot shade mode.
187
                /// </summary>
188
                [DxfCodeValue(76)]
189
                public ShadePlotMode ShadePlotMode { get; set; }
528✔
190

191
                /// <summary>
192
                /// Plot resolution.
193
                /// </summary>
194
                [DxfCodeValue(77)]
195
                public ShadePlotResolutionMode ShadePlotResolutionMode { get; set; }
1,278✔
196

197
                /// <summary>
198
                /// Shade plot custom DPI.
199
                /// </summary>
200
                /// <remarks>
201
                /// Only applied when the ShadePlot resolution level is set to 5 (Custom)
202
                /// </remarks>
203
                /// <value>
204
                /// Valid shade plot DPI values range from 100 to 23767.
205
                /// </value>
206
                [DxfCodeValue(78)]
207
                public short ShadePlotDPI
208
                {
209
                        get { return this._shadePlotDPI; }
306✔
210
                        set
211
                        {
1,178✔
212
                                if (value < 100 || value > 32767)
1,178!
UNCOV
213
                                        throw new ArgumentOutOfRangeException(nameof(value), value, "The valid shade plot DPI values range from 100 to 23767.");
×
214
                                this._shadePlotDPI = value;
1,178✔
215
                        }
1,178✔
216
                }
217

218
                /// <summary>
219
                /// A floating point scale factor that represents the standard scale value specified in code 75.
220
                /// </summary>
221
                [DxfCodeValue(147)]
222
                public double StandardScale { get; set; } = 1.0d;
3,465✔
223

224
                /// <summary>
225
                /// Paper image origin
226
                /// </summary>
227
                public XY PaperImageOrigin { get; set; }
776✔
228

229
                /// <summary>
230
                /// Paper image origin: X value
231
                /// </summary>
232
                [DxfCodeValue(148)]
233
                public double PaperImageOriginX { get; set; }
896✔
234

235
                /// <summary>
236
                /// Paper image origin: Y value
237
                /// </summary>
238
                [DxfCodeValue(149)]
239
                public double PaperImageOriginY { get; set; }
896✔
240

241
                /// <summary>
242
                ///ShadePlot ID/Handle(optional)
243
                /// </summary>
244
                [DxfCodeValue(DxfReferenceType.Ignored, 333)]
245
                public ulong ShadePlotIDHandle { get; set; }
2✔
246

247
                private short _shadePlotDPI = 300;
1,895✔
248

249
                private double _numeratorScale = 1.0d;
1,895✔
250

251
                private double _denominatorScale = 1.0d;
1,895✔
252
        }
253
}
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

© 2025 Coveralls, Inc