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

DomCR / ACadSharp / 19747691062

27 Nov 2025 08:58PM UTC coverage: 77.833% (-0.2%) from 78.079%
19747691062

Pull #898

github

web-flow
Merge 7246c0e16 into b4f4477ec
Pull Request #898: DimensionStyle Overrides

7643 of 10693 branches covered (71.48%)

Branch coverage included in aggregate %.

481 of 674 new or added lines in 7 files covered. (71.36%)

54 existing lines in 7 files now uncovered.

28210 of 35371 relevant lines covered (79.75%)

134840.38 hits per line

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

82.86
/src/ACadSharp/Blocks/Block.cs
1
using ACadSharp.Attributes;
2
using ACadSharp.Entities;
3
using ACadSharp.Tables;
4
using CSMath;
5

6
namespace ACadSharp.Blocks
7
{
8
        /// <summary>
9
        /// Represents a <see cref="Block"/> entity
10
        /// </summary>
11
        /// <remarks>
12
        /// Object name <see cref="DxfFileToken.Block"/> <br/>
13
        /// Dxf class name <see cref="DxfSubclassMarker.BlockBegin"/>
14
        /// </remarks>
15
        [DxfName(DxfFileToken.Block)]
16
        [DxfSubClass(DxfSubclassMarker.BlockBegin)]
17
        public class Block : Entity
18
        {
19
                /// <summary>
20
                /// Specifies the insert point of the block.
21
                /// </summary>
22
                [DxfCodeValue(10, 20, 30)]
23
                public XYZ BasePoint { get; set; } = XYZ.Zero;
113,564✔
24

25
                /// <summary>
26
                /// Block record that owns this entity
27
                /// </summary>
28
                public BlockRecord BlockOwner { get { return this.Owner as BlockRecord; } }
55,689✔
29

30
                /// <summary>
31
                /// Specifies the comments for the block or drawing.
32
                /// </summary>
33
                [DxfCodeValue(4)]
34
                public string Comments { get; set; }
14,520✔
35

36
                /// <summary>
37
                /// Block active flags.
38
                /// </summary>
39
                [DxfCodeValue(70)]
40
                public BlockTypeFlags Flags { get; set; }
56,616✔
41

42
                /// <summary>
43
                /// Gets or sets a value indicating whether the XRef is unloaded.
44
                /// </summary>
45
                /// <remarks>
46
                /// This flag only takes effect if its an external reference.
47
                /// </remarks>
48
                [DxfCodeValue(71)]
49
                public bool IsUnloaded { get; set; } = false;
45,997✔
50

51
                /// <summary>
52
                /// Specifies the name of the object.
53
                /// </summary>
54
                [DxfCodeValue(2, 3)]
55
                public string Name
56
                {
57
                        get { return this.BlockOwner.Name; }
44,277✔
58
                        set { this.BlockOwner.Name = value; }
11,409✔
59
                }
60

61
                /// <inheritdoc/>
62
                public override string ObjectName => DxfFileToken.Block;
129,743✔
63

64
                /// <inheritdoc/>
65
                public override ObjectType ObjectType => ObjectType.BLOCK;
2,617✔
66

67
                /// <inheritdoc/>
68
                public override string SubclassMarker => DxfSubclassMarker.BlockBegin;
2✔
69

70
                /// <summary>
71
                /// Gets the path of the block, document, application, or external reference.
72
                /// </summary>
73
                [DxfCodeValue(1)]
74
                public string XRefPath { get; set; }
24,603✔
75

76
                /// <inheritdoc/>
77
                public Block(BlockRecord record) : base()
29,355✔
78
                {
29,355✔
79
                        this.Owner = record;
29,355✔
80
                }
29,355✔
81

82
                internal Block()
9,910✔
83
                {
9,910✔
84
                }
9,910✔
85

86
                /// <inheritdoc/>
87
                /// <remarks>
88
                /// Block entities don't have any geometric properties.
89
                /// </remarks>
90
                public override void ApplyTransform(Transform transform)
UNCOV
91
                {
×
UNCOV
92
                }
×
93

94
                /// <inheritdoc/>
95
                /// <remarks>
96
                /// Cloning a block will also unattached it from the record.
97
                /// </remarks>
98
                public override CadObject Clone()
99
                {
857✔
100
                        Block clone = (Block)base.Clone();
857✔
101

102
                        clone.Owner = new BlockRecord(this.Name);
857✔
103

104
                        return clone;
857✔
105
                }
857✔
106

107
                /// <inheritdoc/>
108
                public override BoundingBox GetBoundingBox()
109
                {
1✔
110
                        BoundingBox box = BoundingBox.Null;
1✔
111
                        foreach (var item in this.BlockOwner.Entities)
3!
UNCOV
112
                        {
×
UNCOV
113
                                box = box.Merge(item.GetBoundingBox());
×
UNCOV
114
                        }
×
115

116
                        return box;
1✔
117
                }
1✔
118
        }
119
}
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