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

DomCR / ACadSharp / 14214082189

02 Apr 2025 07:34AM UTC coverage: 75.523% (-0.8%) from 76.343%
14214082189

Pull #457

github

web-flow
Merge b2c68aa3f into 04434c5d6
Pull Request #457: Geometric transform

5606 of 8150 branches covered (68.79%)

Branch coverage included in aggregate %.

282 of 716 new or added lines in 47 files covered. (39.39%)

318 existing lines in 23 files now uncovered.

22348 of 28864 relevant lines covered (77.43%)

72757.24 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
                /// <inheritdoc/>
20
                public override ObjectType ObjectType => ObjectType.BLOCK;
169✔
21

22
                /// <inheritdoc/>
23
                public override string ObjectName => DxfFileToken.Block;
531✔
24

25
                /// <inheritdoc/>
26
                public override string SubclassMarker => DxfSubclassMarker.BlockBegin;
2✔
27

28
                /// <summary>
29
                /// Block record that owns this entity
30
                /// </summary>
31
                public BlockRecord BlockOwner { get { return this.Owner as BlockRecord; } }
33,693✔
32

33
                /// <summary>
34
                /// Specifies the name of the object.
35
                /// </summary>
36
                [DxfCodeValue(2, 3)]
37
                public string Name
38
                {
39
                        get { return this.BlockOwner.Name; }
24,288✔
40
                        set { this.BlockOwner.Name = value; }
9,402✔
41
                }
42

43
                /// <summary>
44
                /// Block active flags.
45
                /// </summary>
46
                [DxfCodeValue(70)]
47
                public BlockTypeFlags Flags { get; set; }
24,664✔
48

49
                /// <summary>
50
                /// Specifies the insert point of the block.
51
                /// </summary>
52
                [DxfCodeValue(10, 20, 30)]
53
                public XYZ BasePoint { get; set; } = XYZ.Zero;
81,008✔
54

55
                /// <summary>
56
                /// Gets the path of the block, document, application, or external reference.
57
                /// </summary>
58
                [DxfCodeValue(1)]
59
                public string XrefPath { get; set; }
17,142✔
60

61
                /// <summary>
62
                /// Specifies the comments for the block or drawing.
63
                /// </summary>
64
                [DxfCodeValue(4)]
65
                public string Comments { get; set; }
9,693✔
66

67
                internal Block()
7,198✔
68
                {
7,198✔
69
                }
7,198✔
70

71
                /// <inheritdoc/>
72
                public Block(BlockRecord record) : base()
20,650✔
73
                {
20,650✔
74
                        this.Owner = record;
20,650✔
75
                }
20,650✔
76

77
                /// <inheritdoc/>
78
                /// <remarks>
79
                /// Cloning a block will also unattached it from the record.
80
                /// </remarks>
81
                public override CadObject Clone()
82
                {
120✔
83
                        Block clone = (Block)base.Clone();
120✔
84

85
                        clone.Owner = new BlockRecord(this.Name);
120✔
86

87
                        return clone;
120✔
88
                }
120✔
89

90
                /// <inheritdoc/>
91
                /// <remarks>
92
                /// Block entities don't have any geometric properties.
93
                /// </remarks>
94
                public override void ApplyTransform(Transform transform)
NEW
95
                {
×
NEW
96
                }
×
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