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

DomCR / ACadSharp / 14305968221

07 Apr 2025 09:41AM UTC coverage: 75.187% (-1.0%) from 76.181%
14305968221

push

github

DomCR
badge fix

5615 of 8186 branches covered (68.59%)

Branch coverage included in aggregate %.

22386 of 29056 relevant lines covered (77.04%)

72281.98 hits per line

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

63.64
/src/ACadSharp/Entities/Tolerance.cs
1
using ACadSharp.Attributes;
2
using ACadSharp.Tables;
3
using CSMath;
4
using System;
5

6
namespace ACadSharp.Entities
7
{
8
        /// <summary>
9
        /// Represents a <see cref="Tolerance"/> entity.
10
        /// </summary>
11
        /// <remarks>
12
        /// Object name <see cref="DxfFileToken.EntityTolerance"/> <br/>
13
        /// Dxf class name <see cref="DxfSubclassMarker.Tolerance"/>
14
        /// </remarks>
15
        [DxfName(DxfFileToken.EntityTolerance)]
16
        [DxfSubClass(DxfSubclassMarker.Tolerance)]
17
        public class Tolerance : Entity
18
        {
19
                /// <summary>
20
                /// X-axis direction vector (in WCS)
21
                /// </summary>
22
                [DxfCodeValue(11, 21, 31)]
23
                public XYZ Direction { get; set; }
482✔
24

25
                /// <summary>
26
                /// Insertion point (in WCS)
27
                /// </summary>
28
                [DxfCodeValue(10, 20, 30)]
29
                public XYZ InsertionPoint { get; set; }
4,155✔
30

31
                /// <summary>
32
                /// Specifies the three-dimensional normal unit vector for the object.
33
                /// </summary>
34
                [DxfCodeValue(210, 220, 230)]
35
                public XYZ Normal { get; set; } = XYZ.AxisZ;
1,499✔
36

37
                /// <inheritdoc/>
38
                public override string ObjectName => DxfFileToken.EntityTolerance;
115✔
39

40
                /// <inheritdoc/>
41
                public override ObjectType ObjectType => ObjectType.TOLERANCE;
1✔
42

43
                /// <summary>
44
                /// Dimension style
45
                /// </summary>
46
                [DxfCodeValue(DxfReferenceType.Name, 3)]
47
                public DimensionStyle Style
48
                {
49
                        get { return this._style; }
234✔
50
                        set
51
                        {
975✔
52
                                if (value == null)
975!
53
                                {
×
54
                                        throw new ArgumentNullException(nameof(value));
×
55
                                }
56

57
                                if (this.Document != null)
975!
58
                                {
975✔
59
                                        this._style = this.updateTable(value, this.Document.DimensionStyles);
975✔
60
                                }
975✔
61
                                else
62
                                {
×
63
                                        this._style = value;
×
64
                                }
×
65
                        }
975✔
66
                }
67

68
                /// <inheritdoc/>
69
                public override string SubclassMarker => DxfSubclassMarker.Tolerance;
5,588✔
70

71
                /// <summary>
72
                /// Visual representation of the tolerance
73
                /// </summary>
74
                [DxfCodeValue(1)]
75
                public string Text { get; set; }
1,089✔
76

77
                private DimensionStyle _style = DimensionStyle.Default;
1,017✔
78

79
                /// <inheritdoc/>
80
                public override void ApplyTransform(Transform transform)
81
                {
×
82
                        this.Normal = this.transformNormal(transform, this.Normal);
×
83
                        this.Direction = transform.Rotate(this.Direction);
×
84
                        this.InsertionPoint = transform.ApplyTransform(this.InsertionPoint);
×
85
                }
×
86

87
                /// <inheritdoc/>
88
                public override BoundingBox GetBoundingBox()
89
                {
1✔
90
                        return new BoundingBox(this.InsertionPoint);
1✔
91
                }
1✔
92
        }
93
}
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