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

DomCR / ACadSharp / 11662521122

04 Nov 2024 10:35AM UTC coverage: 75.654% (-0.5%) from 76.202%
11662521122

push

github

web-flow
Merge pull request #419 from nanoLogika/20240619_mme_#6-support-dynamic-blocks-read-evaluation-graphs-and-block-visibility-parameters

Sync Branch 20240619 mme #6 support dynamic blocks read evaluation graphs and block visibility parameters

4934 of 7213 branches covered (68.4%)

Branch coverage included in aggregate %.

0 of 185 new or added lines in 5 files covered. (0.0%)

13 existing lines in 3 files now uncovered.

19752 of 25417 relevant lines covered (77.71%)

36057.68 hits per line

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

0.0
/src/ACadSharp/Objects/BlockVisibilityParameter.cs
1
using System;
2
using System.Collections.Generic;
3

4
using ACadSharp.Attributes;
5
using ACadSharp.Entities;
6

7
using CSMath;
8

9

10
namespace ACadSharp.Objects
11
{
12

13
        /// <summary>
14
        /// Represents a BLOCKVISIBILITYPARAMETER object, in AutoCAD used to
15
        /// control the visibility state of entities in a dynamic block.
16
        /// </summary>
17
        public class BlockVisibilityParameter : CadObject
18
        {
19

20
                /// <inheritdoc/>
NEW
21
                public override ObjectType ObjectType => ObjectType.UNLISTED;
×
22

23
                /// <inheritdoc/>
NEW
24
                public override string ObjectName => DxfFileToken.ObjectBlockVisibilityParameter;
×
25

26
                /// <inheritdoc/>
NEW
27
                public override string SubclassMarker => DxfSubclassMarker.BlockVisibilityParameter;
×
28

29

30
                /// <summary>
31
                /// Gets the list of all <see cref="Entity"/> objects of the dynamic block
32
                /// this <see cref="BlockVisibilityParameter"/> is associated with.
33
                /// </summary>
34
                [DxfCodeValue(331)]
NEW
35
                public IList<Entity> Entities { get; private set; } = new List<Entity>();
×
36

37
                /// <summary>
38
                /// Gets the list of subblocks each containing a subset of the <see cref="Entity"/>
39
                /// objects of the dynamic block this <see cref="BlockVisibilityParameter"/>
40
                /// is associated with.
41
                /// </summary>
NEW
42
                public IList<SubBlock> SubBlocks { get; private set; } = new List<SubBlock>();
×
43

44
                /// <summary>
45
                /// Gets a position presumably used to display a triangle-button in AutoCAD open
46
                /// a dialog to select the subblock that is to be set visible.
47
                /// </summary>
48
                [DxfCodeValue(1010, 1020, 1030)]
NEW
49
                public XYZ BasePosition { get; internal set; }
×
50
                
51
                /// <summary>
52
                /// Gets a text presumably describing the purpose of this <see cref="BlockVisibilityParameter"/>.
53
                /// </summary>
54
                [DxfCodeValue(300)]
NEW
55
                public string ParameterType { get; internal set; }
×
56

57
                /// <summary>
58
                /// Gets a title for the dialog to select the subblock that is to be set visible.
59
                /// </summary>
60
                [DxfCodeValue(301)]
NEW
61
                public string Name { get; internal set; }
×
62

63
                /// <summary>
64
                /// Gets a description presumably for the dialog to select the subblock that is to be set visible.
65
                /// </summary>
66
                [DxfCodeValue(302)]
NEW
67
                public string Description { get; internal set; }
×
68

69
                /// <summary>
70
                /// Unknown
71
                /// </summary>
72
                [DxfCodeValue(91)]
NEW
73
                public int L91 { get; internal set; }
×
74

75
                /// <summary>
76
                /// Represents a named subblock containing <see cref="Entity"/> objects.
77
                /// The visibility of the entities of a subblock can be determined
78
                /// interactively in AutoCAD.
79
                /// </summary>
80
                public class SubBlock : ICloneable
81
                {
82

83
                        /// <summary>
84
                        /// Gets the name of the subblock.
85
                        /// </summary>
86
                        [DxfCodeValue(303)]
NEW
87
                        public string Name { get; set; }
×
88

89
                        /// <summary>
90
                        /// Get the list of <see cref="Entity"/> objects in this subblock.
91
                        /// </summary>
92
                        [DxfCodeValue(332)]
NEW
93
                        public IList<Entity> Entities { get; private set; } = new List<Entity>();
×
94

95

96
                        public object Clone()
NEW
97
                        {
×
NEW
98
                                SubBlock clone = (SubBlock)MemberwiseClone();
×
99

NEW
100
                                clone.Entities = new List<Entity>();
×
NEW
101
                                foreach (var item in this.Entities)
×
NEW
102
                                {
×
NEW
103
                                        clone.Entities.Add((Entity)item.Clone());
×
NEW
104
                                }
×
105

NEW
106
                                return clone;
×
NEW
107
                        }
×
108
                }
109

110

111
                /// <inheritdoc/>
112
                public override CadObject Clone()
NEW
113
                {
×
NEW
114
                        BlockVisibilityParameter clone = (BlockVisibilityParameter)base.Clone();
×
115

NEW
116
                        clone.Entities = new List<Entity>();
×
NEW
117
                        foreach (var item in this.Entities)
×
NEW
118
                        {
×
NEW
119
                                clone.Entities.Add((Entity)item.Clone());
×
NEW
120
                        }
×
121

NEW
122
                        clone.SubBlocks = new List<SubBlock>();
×
NEW
123
                        foreach (var item in this.SubBlocks)
×
NEW
124
                        {
×
NEW
125
                                clone.SubBlocks.Add((SubBlock)item.Clone());
×
NEW
126
                        }
×
127

NEW
128
                        return clone;
×
NEW
129
                }
×
130
        }
131
}
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