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

DomCR / ACadSharp / 21010648765

14 Jan 2026 09:33PM UTC coverage: 77.031% (+0.09%) from 76.943%
21010648765

push

github

web-flow
Merge pull request #949 from DomCR/issue-948_dynamic-blocks-refactor

issue-948 dynamic properties

8019 of 11259 branches covered (71.22%)

Branch coverage included in aggregate %.

301 of 324 new or added lines in 21 files covered. (92.9%)

19 existing lines in 6 files now uncovered.

29076 of 36897 relevant lines covered (78.8%)

149030.45 hits per line

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

96.94
/src/ACadSharp/IO/DWG/DwgStreamReaders/DwgObjectReader.Objects.cs
1
using ACadSharp.IO.Templates;
2
using ACadSharp.Objects;
3
using ACadSharp.Objects.Evaluations;
4

5
namespace ACadSharp.IO.DWG
6
{
7
        internal partial class DwgObjectReader : DwgSectionIO
8
        {
9
                private void readBlock1PtParameter(CadBlock1PtParameterTemplate template)
10
                {
134✔
11
                        this.readBlockParameter(template);
134✔
12

13
                        //1010 1020 1030
14
                        template.Block1PtParameter.Location = this._mergedReaders.Read3BitDouble();
134✔
15
                        //170
16
                        template.Block1PtParameter.Value170 = this._mergedReaders.ReadBitShort();
134✔
17
                        //171
18
                        template.Block1PtParameter.Value171 = this._mergedReaders.ReadBitShort();
134✔
19
                        //93
20
                        template.Block1PtParameter.Value93 = this._mergedReaders.ReadBitLong();
134✔
21
                }
134✔
22

23
                private void readBlockElement(CadBlockElementTemplate template)
24
                {
134✔
25
                        this.readEvaluationExpression(template);
134✔
26

27
                        //300 name
28
                        template.BlockElement.ElementName = this._mergedReaders.ReadVariableText();
134✔
29
                        //98
30
                        template.BlockElement.Value98 = this._mergedReaders.ReadBitLong();
134✔
31
                        //99
32
                        template.BlockElement.Value99 = this._mergedReaders.ReadBitLong();
134✔
33
                        //1071
34
                        template.BlockElement.Value1071 = this._mergedReaders.ReadBitLong();
134✔
35
                }
134✔
36

37
                private CadTemplate readBlockGripLocationComponent()
38
                {
800✔
39
                        BlockGripExpression gripExpression = new BlockGripExpression();
800✔
40
                        CadBlockGripExpressionTemplate template = new CadBlockGripExpressionTemplate(gripExpression);
800✔
41

42
                        this.readEvaluationExpression(template);
800✔
43

44
                        return template;
800✔
45
                }
800✔
46

47
                private void readBlockParameter(CadBlockParameterTemplate template)
48
                {
134✔
49
                        this.readBlockElement(template);
134✔
50

51
                        //280
52
                        template.BlockParameter.Value280 = this._mergedReaders.ReadBit();
134✔
53
                        //281
54
                        template.BlockParameter.Value281 = this._mergedReaders.ReadBit();
134✔
55
                }
134✔
56

57
                private CadTemplate readBlockRepresentationData()
58
                {
270✔
59
                        BlockRepresentationData representation = new BlockRepresentationData();
270✔
60
                        CadBlockRepresentationDataTemplate template = new CadBlockRepresentationDataTemplate(representation);
270✔
61

62
                        this.readCommonNonEntityData(template);
270✔
63

64
                        representation.Value70 = this._mergedReaders.ReadBitShort();
270✔
65
                        template.BlockHandle = this.handleReference();
270✔
66

67
                        return template;
270✔
68
                }
270✔
69

70
                private CadTemplate readBlockVisibilityParameter()
71
                {
134✔
72
                        BlockVisibilityParameter blockVisibilityParameter = new BlockVisibilityParameter();
134✔
73
                        CadBlockVisibilityParameterTemplate template = new CadBlockVisibilityParameterTemplate(blockVisibilityParameter);
134✔
74

75
                        this.readBlock1PtParameter(template);
134✔
76

77
                        //281
78
                        blockVisibilityParameter.Value281 = this._mergedReaders.ReadBit();
134✔
79
                        //301
80
                        blockVisibilityParameter.Name = this._mergedReaders.ReadVariableText();
134✔
81
                        //302
82
                        blockVisibilityParameter.Description = this._mergedReaders.ReadVariableText();
134✔
83
                        //missing bit??        91 should be an int
84
                        blockVisibilityParameter.Value91 = this._mergedReaders.ReadBit();
134✔
85

86
                        //DXF 93 Total entities count
87
                        var totalEntitiesCount = this._objectReader.ReadBitLong();
134✔
88
                        for (int i = 0; i < totalEntitiesCount; i++)
544✔
89
                        {
138✔
90
                                //331
91
                                template.EntityHandles.Add(this.handleReference());
138✔
92
                        }
138✔
93

94
                        //DXF 92 states count
95
                        var nstates = this._objectReader.ReadBitLong();
134✔
96
                        for (int j = 0; j < nstates; j++)
1,340✔
97
                        {
536✔
98
                                template.StateTemplates.Add(this.readState());
536✔
99
                        }
536✔
100

101
                        return template;
134✔
102
                }
134✔
103

104
                private void readEvaluationExpression(CadEvaluationExpressionTemplate template)
105
                {
934✔
106
                        this.readCommonNonEntityData(template);
934✔
107

108
                        //AcDbEvalExpr
109
                        var unknown = this._objectReader.ReadBitLong();
934✔
110

111
                        //98
112
                        template.CadObject.Value98 = this._objectReader.ReadBitLong();
934✔
113
                        //99
114
                        template.CadObject.Value99 = this._objectReader.ReadBitLong();
934✔
115

116
                        //Code value
117
                        short code = this._mergedReaders.ReadBitShort();
934✔
118
                        if (code > 0)
934✔
119
                        {
800✔
120
                                var groupValue = GroupCodeValue.TransformValue(code);
800✔
121
                                switch (groupValue)
800!
122
                                {
123
                                        case GroupCodeValueType.Double:
124
                                        case GroupCodeValueType.ExtendedDataDouble:
125
                                                this._mergedReaders.ReadBitDouble();
800✔
126
                                                break;
800✔
127
                                        default:
NEW
128
                                                throw new System.NotImplementedException($"[EvaluationExpression] Code not implemented {groupValue}");
×
129
                                }
130
                        }
800✔
131

132
                        //90
133
                        template.CadObject.Id = this._objectReader.ReadBitLong();
934✔
134
                }
934✔
135

136
                private CadBlockVisibilityParameterTemplate.StateTemplate readState()
137
                {
536✔
138
                        CadBlockVisibilityParameterTemplate.StateTemplate template = new CadBlockVisibilityParameterTemplate.StateTemplate();
536✔
139

140
                        template.State.Name = this._textReader.ReadVariableText();
536✔
141

142
                        //DXF 94 subset count 1
143
                        int n1 = this._objectReader.ReadBitLong();
536✔
144
                        for (int i = 0; i < n1; i++)
1,894✔
145
                        {
411✔
146
                                //332
147
                                template.EntityHandles.Add(this.handleReference());
411✔
148
                        }
411✔
149

150
                        //DXF 95 subset count 2
151
                        var n2 = this._objectReader.ReadBitLong();
536✔
152
                        for (int i = 0; i < n2; i++)
4,264✔
153
                        {
1,596✔
154
                                //333
155
                                template.ExpressionHandles.Add(this.handleReference());
1,596✔
156
                        }
1,596✔
157

158
                        return template;
536✔
159
                }
536✔
160
        }
161
}
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