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

DomCR / ACadSharp / 13831678834

13 Mar 2025 09:49AM UTC coverage: 75.366% (-0.8%) from 76.2%
13831678834

Pull #457

github

web-flow
Merge 468aa5127 into e0bc2deb0
Pull Request #457: Geometric transform

5514 of 8039 branches covered (68.59%)

Branch coverage included in aggregate %.

259 of 660 new or added lines in 40 files covered. (39.24%)

295 existing lines in 15 files now uncovered.

21939 of 28387 relevant lines covered (77.29%)

73845.76 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,651✔
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,258✔
40
                        set { this.BlockOwner.Name = value; }
9,387✔
41
                }
42

43
                /// <summary>
44
                /// Block active flags.
45
                /// </summary>
46
                [DxfCodeValue(70)]
47
                public BlockTypeFlags Flags { get; set; }
24,644✔
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;
80,972✔
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,127✔
60

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

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

71
                public Block(BlockRecord record) : base()
20,629✔
72
                {
20,629✔
73
                        this.Owner = record;
20,629✔
74
                }
20,629✔
75

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

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

86
                        return clone;
120✔
87
                }
120✔
88

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

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

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