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

DomCR / ACadSharp / 19925453945

04 Dec 2025 10:17AM UTC coverage: 78.004% (-0.02%) from 78.026%
19925453945

push

github

web-flow
Merge pull request #910 from DomCR/AC1015-dwgwriter-refine

Ac1015 dwgwriter refine

7580 of 10537 branches covered (71.94%)

Branch coverage included in aggregate %.

157 of 181 new or added lines in 12 files covered. (86.74%)

28 existing lines in 4 files now uncovered.

28135 of 35249 relevant lines covered (79.82%)

162678.23 hits per line

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

82.09
/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
                /// <summary>
19
                /// Denominator of custom print scale: drawing units
20
                /// </summary>
21
                [DxfCodeValue(143)]
22
                public double DenominatorScale
23
                {
24
                        get { return this._denominatorScale; }
5,994✔
25
                        set
26
                        {
1,534✔
27
                                if (value <= 0.0)
1,534!
NEW
28
                                {
×
NEW
29
                                        throw new ArgumentOutOfRangeException(nameof(this.DenominatorScale), value, "Value must be greater than zero");
×
30
                                }
31

32
                                this._denominatorScale = value;
1,534✔
33
                        }
1,534✔
34
                }
35

36
                /// <summary>
37
                /// Plot layout flags
38
                /// </summary>
39
                [DxfCodeValue(70)]
40
                public PlotFlags Flags { get; set; } = PlotFlags.DrawViewportsFirst | PlotFlags.PrintLineweights | PlotFlags.PlotPlotStyles | PlotFlags.UseStandardScale;
5,187✔
41

42
                /// <summary>
43
                /// Numerator of custom print scale: real world(paper) units
44
                /// </summary>
45
                [DxfCodeValue(142)]
46
                public double NumeratorScale
47
                {
48
                        get { return this._numeratorScale; }
5,994✔
49
                        set
50
                        {
1,534✔
51
                                if (value <= 0.0)
1,534!
NEW
52
                                {
×
NEW
53
                                        throw new ArgumentOutOfRangeException(nameof(this.NumeratorScale), value, "Value must be greater than zero");
×
54
                                }
55

56
                                this._numeratorScale = value;
1,534✔
57
                        }
1,534✔
58
                }
59

60
                /// <inheritdoc/>
61
                public override string ObjectName => DxfFileToken.ObjectPlotSettings;
×
62

63
                /// <inheritdoc/>
NEW
64
                public override ObjectType ObjectType => ObjectType.UNLISTED;
×
65

66
                /// <summary>
67
                /// Page Setup name
68
                /// </summary>
69
                [DxfCodeValue(1)]
70
                public string PageName { get; set; } = "none_device";
5,187✔
71

72
                /// <summary>
73
                /// Physical paper height in millimeters.
74
                /// </summary>
75
                [DxfCodeValue(45)]
76
                public double PaperHeight { get; set; }
2,882✔
77

78
                /// <summary>
79
                /// Paper image origin
80
                /// </summary>
81
                public XY PaperImageOrigin { get; set; }
2,583✔
82

83
                /// <summary>
84
                /// Paper image origin: X value
85
                /// </summary>
86
                [DxfCodeValue(148)]
87
                public double PaperImageOriginX { get; set; }
944✔
88

89
                /// <summary>
90
                /// Paper image origin: Y value
91
                /// </summary>
92
                [DxfCodeValue(149)]
93
                public double PaperImageOriginY { get; set; }
944✔
94

95
                /// <summary>
96
                /// Plot paper rotation.
97
                /// </summary>
98
                [DxfCodeValue(73)]
99
                public PlotRotation PaperRotation { get; set; }
2,875✔
100

101
                /// <summary>
102
                /// Paper size
103
                /// </summary>
104
                [DxfCodeValue(4)]
105
                public string PaperSize { get; set; } = "ISO_A4_(210.00_x_297.00_MM)";
6,129✔
106

107
                /// <summary>
108
                /// Plot paper units.
109
                /// </summary>
110
                [DxfCodeValue(72)]
111
                public PlotPaperUnits PaperUnits { get; set; } = PlotPaperUnits.Millimeters;
6,136✔
112

113
                /// <summary>
114
                /// Physical paper width in millimeters.
115
                /// </summary>
116
                [DxfCodeValue(44)]
117
                public double PaperWidth { get; set; }
2,882✔
118

119
                /// <summary>
120
                /// Plot origin: X value of origin offset in millimeters
121
                /// </summary>
122
                [DxfCodeValue(46)]
123
                public double PlotOriginX { get; set; }
2,870✔
124

125
                /// <summary>
126
                /// Plot origin: Y value of origin offset in millimeters
127
                /// </summary>
128
                [DxfCodeValue(47)]
129
                public double PlotOriginY { get; set; }
2,870✔
130

131
                /// <summary>
132
                /// Portion of paper space to output to the media
133
                /// </summary>
134
                [DxfCodeValue(74)]
135
                public PlotType PlotType { get; set; } = PlotType.DrawingExtents;
6,129✔
136

137
                /// <summary>
138
                /// Plot view name
139
                /// </summary>
140
                [DxfCodeValue(6)]
141
                public string PlotViewName { get; set; }
1,878✔
142

143
                /// <summary>
144
                /// Gets the scale factor.
145
                /// </summary>
146
                public double PrintScale
147
                {
148
                        get { return this.NumeratorScale / this.DenominatorScale; }
1,986✔
149
                }
150

151
                /// <summary>
152
                /// Standard scale type
153
                /// </summary>
154
                [DxfCodeValue(75)]
155
                public ScaledType ScaledFit { get; set; }
2,868✔
156

157
                /// <summary>
158
                /// Shade plot custom DPI.
159
                /// </summary>
160
                /// <remarks>
161
                /// Only applied when the ShadePlot resolution level is set to 5 (Custom)
162
                /// </remarks>
163
                /// <value>
164
                /// Valid shade plot DPI values range from 100 to 23767.
165
                /// </value>
166
                [DxfCodeValue(78)]
167
                public short ShadePlotDPI
168
                {
169
                        get { return this._shadePlotDPI; }
3,573✔
170
                        set
171
                        {
1,222✔
172
                                if (value < 100 || value > 32767)
1,222✔
173
                                        throw new ArgumentOutOfRangeException(nameof(value), value, "The valid shade plot DPI values range from 100 to 23767.");
2✔
174
                                this._shadePlotDPI = value;
1,220✔
175
                        }
1,220✔
176
                }
177

178
                /// <summary>
179
                ///ShadePlot ID/Handle(optional)
180
                /// </summary>
181
                [DxfCodeValue(DxfReferenceType.Ignored, 333)]
182
                public ulong ShadePlotIDHandle { get; set; }
2✔
183

184
                /// <summary>
185
                /// Plot shade mode.
186
                /// </summary>
187
                [DxfCodeValue(76)]
188
                public ShadePlotMode ShadePlotMode { get; set; } = ShadePlotMode.AsDisplayed;
4,882✔
189

190
                /// <summary>
191
                /// Plot resolution.
192
                /// </summary>
193
                [DxfCodeValue(77)]
194
                public ShadePlotResolutionMode ShadePlotResolutionMode { get; set; } = ShadePlotResolutionMode.Draft;
5,672✔
195

196
                /// <summary>
197
                /// A floating point scale factor that represents the standard scale value specified in code 75.
198
                /// </summary>
199
                [DxfCodeValue(147)]
200
                public double StandardScale { get; set; } = 1.0d;
5,476✔
201

202
                /// <summary>
203
                /// Current style sheet
204
                /// </summary>
205
                [DxfCodeValue(7)]
206
                public string StyleSheet { get; set; }
2,844✔
207

208
                /// <inheritdoc/>
NEW
209
                public override string SubclassMarker => DxfSubclassMarker.PlotSettings;
×
210

211
                /// <summary>
212
                /// Name of system printer or plot configuration file
213
                /// </summary>
214
                [DxfCodeValue(2)]
215
                public string SystemPrinterName { get; set; }
2,844✔
216

217
                /// <summary>
218
                /// Size, in millimeters, of unprintable margins of paper
219
                /// </summary>
220
                [DxfCodeValue(40, 41, 42, 43)]
221
                public PaperMargin UnprintableMargin { get; set; }
13,486✔
222

223
                /// <summary>
224
                /// Plot window area: X value of lower-left window corner
225
                /// </summary>
226
                [DxfCodeValue(48)]
227
                public double WindowLowerLeftX { get; set; }
2,870✔
228

229
                /// <summary>
230
                /// Plot window area: Y value of upper-right window corner
231
                /// </summary>
232
                [DxfCodeValue(49)]
233
                public double WindowLowerLeftY { get; set; }
2,870✔
234

235
                /// <summary>
236
                /// Plot window area: X value of lower-left window corner
237
                /// </summary>
238
                [DxfCodeValue(140)]
239
                public double WindowUpperLeftX { get; set; }
2,870✔
240

241
                /// <summary>
242
                /// Plot window area: Y value of upper-right window corner
243
                /// </summary>
244
                [DxfCodeValue(141)]
245
                public double WindowUpperLeftY { get; set; }
2,870✔
246

247
                private double _denominatorScale = 1.0d;
3,261✔
248

249
                private double _numeratorScale = 1.0d;
3,261✔
250

251
                private short _shadePlotDPI = 300;
3,261✔
252

253
                public PlotSettings() : base()
3,261✔
254
                {
3,261✔
255
                }
3,261✔
256

NEW
257
                public PlotSettings(string name) : base(name)
×
NEW
258
                {
×
NEW
259
                }
×
260
        }
261
}
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