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

DomCR / ACadSharp / 20244298837

15 Dec 2025 07:08PM UTC coverage: 77.69% (-0.2%) from 77.847%
20244298837

push

github

web-flow
Merge pull request #919 from DomCR/image-reactor-fix

Image reactors

7578 of 10571 branches covered (71.69%)

Branch coverage included in aggregate %.

50 of 53 new or added lines in 9 files covered. (94.34%)

131 existing lines in 33 files now uncovered.

28098 of 35350 relevant lines covered (79.49%)

161916.85 hits per line

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

65.71
/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;
110,259✔
24

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

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

36
                /// <summary>
37
                /// Block active flags.
38
                /// </summary>
39
                [DxfCodeValue(70)]
40
                public BlockTypeFlags Flags { get; set; }
51,582✔
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;
50,925✔
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; }
37,278✔
58
                        set { this.BlockOwner.Name = value; }
11,013✔
59
                }
60

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

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

67
                /// <inheritdoc/>
68
                public override string SubclassMarker => DxfSubclassMarker.BlockBegin;
1✔
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; }
22,946✔
75

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

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

86
                /// <inheritdoc/>
87
                /// <remarks>
88
                /// Block entities don't have any geometric properties.
89
                /// </remarks>
90
                public override void ApplyTransform(Transform transform)
91
                {
×
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
                {
855✔
100
                        Block clone = (Block)base.Clone();
855✔
101

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

104
                        return clone;
855✔
105
                }
855✔
106

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

UNCOV
116
                        return box;
×
UNCOV
117
                }
×
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