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

DomCR / ACadSharp / 17737836230

15 Sep 2025 03:12PM UTC coverage: 2.092% (-76.2%) from 78.245%
17737836230

push

github

web-flow
Merge pull request #790 from DomCR/addflag-refactor

addflag refactor

141 of 9225 branches covered (1.53%)

Branch coverage included in aggregate %.

0 of 93 new or added lines in 10 files covered. (0.0%)

24910 existing lines in 372 files now uncovered.

724 of 32119 relevant lines covered (2.25%)

5.76 hits per line

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

0.0
/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)]
UNCOV
23
                public XYZ BasePoint { get; set; } = XYZ.Zero;
×
24

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

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

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

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

52
                /// <inheritdoc/>
UNCOV
53
                public override string ObjectName => DxfFileToken.Block;
×
54

55
                /// <inheritdoc/>
UNCOV
56
                public override ObjectType ObjectType => ObjectType.BLOCK;
×
57

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

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

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

UNCOV
73
                internal Block()
×
UNCOV
74
                {
×
UNCOV
75
                }
×
76

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

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

UNCOV
93
                        clone.Owner = new BlockRecord(this.Name);
×
94

UNCOV
95
                        return clone;
×
UNCOV
96
                }
×
97

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

UNCOV
107
                        return box;
×
UNCOV
108
                }
×
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