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

DomCR / ACadSharp / 17301097975

28 Aug 2025 03:51PM UTC coverage: 78.218% (+0.06%) from 78.163%
17301097975

push

github

web-flow
Merge pull request #753 from DomCR/CadDictionary-variables

AcDbVariableDictionary

6549 of 9101 branches covered (71.96%)

Branch coverage included in aggregate %.

169 of 187 new or added lines in 30 files covered. (90.37%)

10 existing lines in 3 files now uncovered.

25386 of 31727 relevant lines covered (80.01%)

104987.27 hits per line

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

86.61
/src/ACadSharp/IO/DWG/DwgHeaderHandlesCollection.cs
1
using ACadSharp.Header;
2
using ACadSharp.Objects;
3
using ACadSharp.Tables;
4
using System.Collections.Generic;
5
using System.Runtime.CompilerServices;
6

7
namespace ACadSharp.IO.DWG
8
{
9
        internal class DwgHeaderHandlesCollection
10
        {
11
                public ulong? CMATERIAL { get { return getHandle(); } set { setHandle(value: value); } }
288✔
12
                public ulong? CLAYER { get { return getHandle(); } set { setHandle(value: value); } }
975✔
13
                public ulong? TEXTSTYLE { get { return getHandle(); } set { setHandle(value: value); } }
975✔
14
                public ulong? CELTYPE { get { return getHandle(); } set { setHandle(value: value); } }
975✔
15
                public ulong? DIMSTYLE { get { return getHandle(); } set { setHandle(value: value); } }
975✔
16
                public ulong? CMLSTYLE { get { return getHandle(); } set { setHandle(value: value); } }
975✔
17
                public ulong? UCSNAME_PSPACE { get { return getHandle(); } set { setHandle(value: value); } }
507✔
18
                public ulong? UCSNAME_MSPACE { get { return getHandle(); } set { setHandle(value: value); } }
507✔
19
                public ulong? PUCSORTHOREF { get { return getHandle(); } set { setHandle(value: value); } }
432✔
20
                public ulong? PUCSBASE { get { return getHandle(); } set { setHandle(value: value); } }
432✔
21
                public ulong? UCSORTHOREF { get { return getHandle(); } set { setHandle(value: value); } }
432✔
22
                public ulong? DIMTXSTY { get { return getHandle(); } set { setHandle(value: value); } }
975✔
23
                public ulong? DIMLDRBLK { get { return getHandle(); } set { setHandle(value: value); } }
900✔
24
                public ulong? DIMBLK { get { return getHandle(); } set { setHandle(value: value); } }
900✔
25
                public ulong? DIMBLK1 { get { return getHandle(); } set { setHandle(value: value); } }
900✔
26
                public ulong? DIMBLK2 { get { return getHandle(); } set { setHandle(value: value); } }
900✔
27
                public ulong? DICTIONARY_LAYOUTS { get { return getHandle(); } set { setHandle(value: value); } }
480✔
28
                public ulong? DICTIONARY_PLOTSETTINGS { get { return getHandle(); } set { setHandle(value: value); } }
432✔
29
                public ulong? DICTIONARY_PLOTSTYLES { get { return getHandle(); } set { setHandle(value: value); } }
432✔
30
                public ulong? CPSNID { get { return getHandle(); } set { setHandle(value: value); } }
×
31
                public ulong? PAPER_SPACE { get { return getHandle(); } set { setHandle(value: value); } }
507✔
32
                public ulong? MODEL_SPACE { get { return getHandle(); } set { setHandle(value: value); } }
507✔
33
                public ulong? BYLAYER { get { return getHandle(); } set { setHandle(value: value); } }
507✔
34
                public ulong? BYBLOCK { get { return getHandle(); } set { setHandle(value: value); } }
507✔
35
                public ulong? CONTINUOUS { get { return getHandle(); } set { setHandle(value: value); } }
507✔
36
                public ulong? DIMLTYPE { get { return getHandle(); } set { setHandle(value: value); } }
288✔
37
                public ulong? DIMLTEX1 { get { return getHandle(); } set { setHandle(value: value); } }
288✔
38
                public ulong? DIMLTEX2 { get { return getHandle(); } set { setHandle(value: value); } }
288✔
39
                public ulong? VIEWPORT_ENTITY_HEADER_CONTROL_OBJECT { get { return getHandle(); } set { setHandle(value: value); } }
147✔
40
                public ulong? DICTIONARY_ACAD_GROUP { get { return getHandle(); } set { setHandle(value: value); } }
507✔
41
                public ulong? DICTIONARY_ACAD_MLINESTYLE { get { return getHandle(); } set { setHandle(value: value); } }
507✔
42
                public ulong? DICTIONARY_NAMED_OBJECTS { get { return getHandle(); } set { setHandle(value: value); } }
975✔
43
                public ulong? BLOCK_CONTROL_OBJECT { get { return getHandle(); } set { setHandle(value: value); } }
507✔
44
                public ulong? LAYER_CONTROL_OBJECT { get { return getHandle(); } set { setHandle(value: value); } }
507✔
45
                public ulong? STYLE_CONTROL_OBJECT { get { return getHandle(); } set { setHandle(value: value); } }
507✔
46
                public ulong? LINETYPE_CONTROL_OBJECT { get { return getHandle(); } set { setHandle(value: value); } }
507✔
47
                public ulong? VIEW_CONTROL_OBJECT { get { return getHandle(); } set { setHandle(value: value); } }
507✔
48
                public ulong? UCS_CONTROL_OBJECT { get { return getHandle(); } set { setHandle(value: value); } }
507✔
49
                public ulong? VPORT_CONTROL_OBJECT { get { return getHandle(); } set { setHandle(value: value); } }
507✔
50
                public ulong? APPID_CONTROL_OBJECT { get { return getHandle(); } set { setHandle(value: value); } }
507✔
51
                public ulong? DIMSTYLE_CONTROL_OBJECT { get { return getHandle(); } set { setHandle(value: value); } }
507✔
52
                public ulong? DICTIONARY_MATERIALS { get { return getHandle(); } set { setHandle(value: value); } }
360✔
53
                public ulong? DICTIONARY_COLORS { get { return getHandle(); } set { setHandle(value: value); } }
360✔
54
                public ulong? DICTIONARY_VISUALSTYLE { get { return getHandle(); } set { setHandle(value: value); } }
441✔
55
                public ulong? INTERFEREOBJVS { get { return getHandle(); } set { setHandle(value: value); } }
288✔
56
                public ulong? INTERFEREVPVS { get { return getHandle(); } set { setHandle(value: value); } }
288✔
57
                public ulong? DRAGVS { get { return getHandle(); } set { setHandle(value: value); } }
288✔
58
                public ulong? UCSBASE { get { return getHandle(); } set { setHandle(value: value); } }
432✔
59

60
                private Dictionary<string, ulong?> _handles = new Dictionary<string, ulong?>();
333✔
61

62
                public ulong? GetHandle(string name)
63
                {
1,716✔
64
                        this._handles.TryGetValue(name, out var handle);
1,716✔
65
                        return handle;
1,716✔
66
                }
1,716✔
67

68
                public void SetHandle(string name, ulong? value)
69
                {
6,933✔
70
                        _handles[name] = value;
6,933✔
71
                }
6,933✔
72

73
                public List<ulong?> GetHandles()
74
                {
148✔
75
                        return new List<ulong?>(_handles.Values);
148✔
76
                }
148✔
77

78
                public void UpdateHeader(CadHeader header, DwgDocumentBuilder builder)
79
                {
156✔
80
                        TableEntry entry;
81
                        if (builder.TryGetCadObject(this.CLAYER, out entry))
156✔
82
                        {
148✔
83
                                header.CurrentLayerName = entry.Name;
148✔
84
                        }
148✔
85

86
                        if (builder.TryGetCadObject(this.CELTYPE, out entry))
156✔
87
                        {
148✔
88
                                header.CurrentLineTypeName = entry.Name;
148✔
89
                        }
148✔
90

91
                        if (builder.TryGetCadObject(this.CMLSTYLE, out entry))
156!
92
                        {
×
NEW
93
                                header.CurrentMLineStyleName = entry.Name;
×
94
                        }
×
95

96
                        if (builder.TryGetCadObject(this.TEXTSTYLE, out entry))
156✔
97
                        {
148✔
98
                                header.CurrentTextStyleName = entry.Name;
148✔
99
                        }
148✔
100

101
                        if (builder.TryGetCadObject(this.DIMTXSTY, out entry))
156✔
102
                        {
148✔
103
                                header.DimensionTextStyleName = entry.Name;
148✔
104
                        }
148✔
105

106
                        if (builder.TryGetCadObject(this.DIMSTYLE, out entry))
156✔
107
                        {
148✔
108
                                header.CurrentDimensionStyleName = entry.Name;
148✔
109
                        }
148✔
110

111
                        BlockRecord record;
112
                        if (builder.TryGetCadObject(this.DIMBLK, out record))
156✔
113
                        {
114✔
114
                                header.DimensionBlockName = record.Name;
114✔
115
                        }
114✔
116

117
                        if (builder.TryGetCadObject(this.DIMLDRBLK, out record))
156!
118
                        {
×
119
                                header.DimensionBlockName = record.Name;
×
120
                        }
×
121

122
                        if (builder.TryGetCadObject(this.DIMBLK1, out record))
156!
123
                        {
×
124
                                header.DimensionBlockNameFirst = record.Name;
×
125
                        }
×
126

127
                        if (builder.TryGetCadObject(this.DIMBLK2, out record))
156!
128
                        {
×
129
                                header.DimensionBlockNameSecond = record.Name;
×
130
                        }
×
131
                }
156✔
132

133
                private ulong? getHandle([CallerMemberName] string name = null)
134
                {
1,716✔
135
                        return GetHandle(name);
1,716✔
136
                }
1,716✔
137

138
                private void setHandle([CallerMemberName] string name = null, ulong? value = 0)
139
                {
6,933✔
140
                        SetHandle(name, value);
6,933✔
141
                }
6,933✔
142
        }
143
}
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