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

DomCR / ACadSharp / 12905761471

22 Jan 2025 10:03AM UTC coverage: 2.0% (-74.0%) from 75.963%
12905761471

push

github

DomCR
version 1.0.6

104 of 7676 branches covered (1.35%)

Branch coverage included in aggregate %.

590 of 27024 relevant lines covered (2.18%)

5.13 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
                /// <inheritdoc/>
20
                public override ObjectType ObjectType => ObjectType.BLOCK;
×
21

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

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

28
                /// <summary>
29
                /// Block record that owns this entity
30
                /// </summary>
31
                public BlockRecord BlockOwner { get { return this.Owner as BlockRecord; } }
×
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; }
×
40
                        set { this.BlockOwner.Name = value; }
×
41
                }
42

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

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

67
                internal Block()
×
68
                {
×
69
                }
×
70

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

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

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

86
                        return clone;
×
87
                }
×
88

89
                public override BoundingBox GetBoundingBox()
90
                {
×
91
                        BoundingBox box = BoundingBox.Null;
×
92
                        foreach (var item in this.BlockOwner.Entities)
×
93
                        {
×
94
                                box = box.Merge(item.GetBoundingBox());
×
95
                        }
×
96

97
                        return box;
×
98
                }
×
99
        }
100
}
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