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

DomCR / ACadSharp / 19746807496

27 Nov 2025 08:04PM UTC coverage: 78.083% (+0.004%) from 78.079%
19746807496

Pull #889

github

web-flow
Merge d4c913b6d into b4f4477ec
Pull Request #889: LineType Segments.Text Reader/Writer

7507 of 10433 branches covered (71.95%)

Branch coverage included in aggregate %.

134 of 152 new or added lines in 2 files covered. (88.16%)

59 existing lines in 7 files now uncovered.

27823 of 34814 relevant lines covered (79.92%)

97895.59 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;
109,655✔
24

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

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

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

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

64
                /// <inheritdoc/>
65
                public override ObjectType ObjectType => ObjectType.BLOCK;
1,281✔
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; }
22,767✔
75

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

82
                internal Block()
9,758✔
83
                {
9,758✔
84
                }
9,758✔
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
                {
853✔
100
                        Block clone = (Block)base.Clone();
853✔
101

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

104
                        return clone;
853✔
105
                }
853✔
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