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

DomCR / ACadSharp / 17322384007

29 Aug 2025 11:17AM UTC coverage: 78.217% (-0.03%) from 78.245%
17322384007

Pull #758

github

web-flow
Merge 22680f4ef into b16e4689c
Pull Request #758: Issue 756 xref

6554 of 9107 branches covered (71.97%)

Branch coverage included in aggregate %.

35 of 39 new or added lines in 9 files covered. (89.74%)

13 existing lines in 3 files now uncovered.

25397 of 31742 relevant lines covered (80.01%)

105436.12 hits per line

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

82.35
/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;
104,424✔
24

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

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

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

42
                /// <summary>
43
                /// Specifies the name of the object.
44
                /// </summary>
45
                [DxfCodeValue(2, 3)]
46
                public string Name
47
                {
48
                        get { return this.BlockOwner.Name; }
36,393✔
49
                        set { this.BlockOwner.Name = value; }
11,004✔
50
                }
51

52
                /// <inheritdoc/>
53
                public override string ObjectName => DxfFileToken.Block;
68,867✔
54

55
                /// <inheritdoc/>
56
                public override ObjectType ObjectType => ObjectType.BLOCK;
1,209✔
57

58
                /// <inheritdoc/>
59
                public override string SubclassMarker => DxfSubclassMarker.BlockBegin;
2✔
60

61
                /// <summary>
62
                /// Gets the path of the block, document, application, or external reference.
63
                /// </summary>
64
                [DxfCodeValue(1)]
65
                public string XRefPath { get; set; }
22,043✔
66

67
                /// <inheritdoc/>
68
                public Block(BlockRecord record) : base()
27,543✔
69
                {
27,543✔
70
                        this.Owner = record;
27,543✔
71
                }
27,543✔
72

73
                internal Block()
9,138✔
74
                {
9,138✔
75
                }
9,138✔
76

77
                /// <inheritdoc/>
78
                /// <remarks>
79
                /// Block entities don't have any geometric properties.
80
                /// </remarks>
81
                public override void ApplyTransform(Transform transform)
UNCOV
82
                {
×
UNCOV
83
                }
×
84

85
                /// <inheritdoc/>
86
                /// <remarks>
87
                /// Cloning a block will also unattached it from the record.
88
                /// </remarks>
89
                public override CadObject Clone()
90
                {
839✔
91
                        Block clone = (Block)base.Clone();
839✔
92

93
                        clone.Owner = new BlockRecord(this.Name);
839✔
94

95
                        return clone;
839✔
96
                }
839✔
97

98
                /// <inheritdoc/>
99
                public override BoundingBox GetBoundingBox()
100
                {
1✔
101
                        BoundingBox box = BoundingBox.Null;
1✔
102
                        foreach (var item in this.BlockOwner.Entities)
3!
103
                        {
×
104
                                box = box.Merge(item.GetBoundingBox());
×
105
                        }
×
106

107
                        return box;
1✔
108
                }
1✔
109
        }
110
}
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