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

DomCR / ACadSharp / 24607235356

18 Apr 2026 02:54PM UTC coverage: 77.07% (+0.005%) from 77.065%
24607235356

push

github

web-flow
Merge pull request #1039 from DomCR/issue/1037_dxfClassCollection-fix

Issue-1037 dxf class collection fix

8440 of 11901 branches covered (70.92%)

Branch coverage included in aggregate %.

2996 of 3959 new or added lines in 14 files covered. (75.68%)

87 existing lines in 8 files now uncovered.

30361 of 38444 relevant lines covered (78.97%)

150926.95 hits per line

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

94.01
/src/ACadSharp/Classes/DxfClassCollection.cs
1
using System;
2
using System.Collections;
3
using System.Collections.Generic;
4
using System.Linq;
5

6
namespace ACadSharp.Classes;
7

8
public class DxfClassCollection : ICollection<DxfClass>
9
{
10
        /// <inheritdoc/>
11
        public int Count { get { return this._entries.Count; } }
259,914✔
12

13
        /// <inheritdoc/>
NEW
14
        public bool IsReadOnly => false;
×
15

16
        private readonly CadDocument _document;
17

18
        private readonly Dictionary<string, DxfClass> _entries = new Dictionary<string, DxfClass>(StringComparer.OrdinalIgnoreCase);
1,890✔
19

20
        public DxfClassCollection(CadDocument document)
1,890✔
21
        {
1,890✔
22
                this._document = document;
1,890✔
23
        }
1,890✔
24

25
        /// <summary>
26
        /// Add a dxf class to the collection if the <see cref="DxfClass.DxfName"/> is not present
27
        /// </summary>
28
        /// <param name="item"></param>
29
        public void Add(DxfClass item)
30
        {
61,223✔
31
                this._entries.Add(item.DxfName, item);
61,223✔
32
        }
61,223✔
33

34
        /// <summary>
35
        /// Add a dxf class to the collection or updates the existing one if the <see cref="DxfClass.DxfName"/> is already in the collection
36
        /// </summary>
37
        /// <param name="item"></param>
38
        public void AddOrUpdate(DxfClass item)
39
        {
103,799✔
40
                if (this._entries.TryGetValue(item.DxfName, out DxfClass result))
103,799✔
41
                {
42,576✔
42
                        result.InstanceCount = result.InstanceCount;
42,576✔
43
                }
42,576✔
44
                else
45
                {
61,223✔
46
                        this.Add(item);
61,223✔
47
                }
61,223✔
48
        }
103,799✔
49

50
        /// <inheritdoc/>
51
        public void Clear()
NEW
52
        {
×
NEW
53
                _entries.Clear();
×
NEW
54
        }
×
55

56
        /// <summary>
57
        /// Determines whether the Collection contains a specific <see cref="DxfClass.DxfName"/>.
58
        /// </summary>
59
        /// <param name="dxfname"></param>
60
        /// <returns></returns>
61
        public bool Contains(string dxfname)
NEW
62
        {
×
NEW
63
                return this._entries.ContainsKey(dxfname);
×
NEW
64
        }
×
65

66
        /// <inheritdoc/>
67
        public bool Contains(DxfClass item)
NEW
68
        {
×
NEW
69
                return _entries.Values.Contains(item);
×
NEW
70
        }
×
71

72
        /// <inheritdoc/>
73
        public void CopyTo(DxfClass[] array, int arrayIndex)
NEW
74
        {
×
NEW
75
                this._entries.Values.CopyTo(array, arrayIndex);
×
NEW
76
        }
×
77

78
        /// <summary>
79
        /// Gets the dxf class associated with <see cref="DxfClass.ClassNumber"/>.
80
        /// </summary>
81
        /// <param name="id"></param>
82
        /// <returns></returns>
83
        public DxfClass GetByClassNumber(short id)
NEW
84
        {
×
NEW
85
                return this._entries.Values.FirstOrDefault(c => c.ClassNumber == id);
×
NEW
86
        }
×
87

88
        /// <summary>
89
        /// Gets the dxf class associated with <see cref="DxfClass.DxfName"/>.
90
        /// </summary>
91
        /// <param name="dxfname"></param>
92
        /// <returns></returns>
93
        public DxfClass GetByName(string dxfname)
NEW
94
        {
×
NEW
95
                if (this._entries.TryGetValue(dxfname, out DxfClass result))
×
96
                {
×
NEW
97
                        return result;
×
98
                }
99
                else
UNCOV
100
                {
×
NEW
101
                        return null;
×
102
                }
NEW
103
        }
×
104

105
        /// <inheritdoc/>
106
        public IEnumerator<DxfClass> GetEnumerator()
107
        {
1,309✔
108
                return _entries.Values.GetEnumerator();
1,309✔
109
        }
1,309✔
110

111
        /// <inheritdoc/>
112
        IEnumerator IEnumerable.GetEnumerator()
NEW
113
        {
×
NEW
114
                return this._entries.Values.GetEnumerator();
×
NEW
115
        }
×
116

117
        /// <inheritdoc/>
118
        public bool Remove(DxfClass item)
NEW
119
        {
×
NEW
120
                return this._entries.Remove(item.DxfName);
×
NEW
121
        }
×
122

123
        /// <summary>
124
        /// Gets the dxf class associated with <see cref="DxfClass.ClassNumber"/>.
125
        /// </summary>
126
        /// <param name="id"></param>
127
        /// <param name="result"></param>
128
        /// <returns></returns>
129
        public bool TryGetByClassNumber(short id, out DxfClass result)
NEW
130
        {
×
NEW
131
                result = this._entries.Values.FirstOrDefault(c => c.ClassNumber == id);
×
NEW
132
                return result != null;
×
NEW
133
        }
×
134

135
        /// <summary>
136
        /// Gets the dxf class associated with <see cref="DxfClass.DxfName"/>.
137
        /// </summary>
138
        /// <param name="dxfname"></param>
139
        /// <param name="result"></param>
140
        /// <returns>true if the Collection contains an element with the specified key; otherwise, false.</returns>
141
        public bool TryGetByName(string dxfname, out DxfClass result)
142
        {
12,657✔
143
                return this._entries.TryGetValue(dxfname, out result);
12,657✔
144
        }
12,657✔
145

146
        /// <summary>
147
        /// Updates the DXF class collection in the document with a predefined set of class definitions and resets class
148
        /// numbers.
149
        /// </summary>
150
        public void UpdateDxfClasses()
151
        {
1,810✔
152
                this.resetClassNumbers();
1,810✔
153

154
                //AcDbDictionaryWithDefault
155
                this.AddOrUpdate(new DxfClass
1,810✔
156
                {
1,810✔
157
                        CppClassName = DxfSubclassMarker.DictionaryWithDefault,
1,810✔
158
                        ClassNumber = (short)(500 + this.Count),
1,810✔
159
                        DwgVersion = (ACadVersion)22,
1,810✔
160
                        DxfName = DxfFileToken.ObjectDictionaryWithDefault,
1,810✔
161
                        ItemClassId = 499,
1,810✔
162
                        MaintenanceVersion = 42,
1,810✔
163
                        ProxyFlags = ProxyFlags.R13FormatProxy,
1,810✔
164
                        WasZombie = false,
1,810✔
165
                        InstanceCount = this._document.GetInstanceCount(DxfFileToken.ObjectDictionaryWithDefault),
1,810✔
166
                });
1,810✔
167

168
                //AcDbPlaceHolder
169
                this.AddOrUpdate(new DxfClass
1,810✔
170
                {
1,810✔
171
                        CppClassName = DxfSubclassMarker.AcDbPlaceHolder,
1,810✔
172
                        ClassNumber = (short)(500 + this.Count),
1,810✔
173
                        DwgVersion = (ACadVersion)0,
1,810✔
174
                        DxfName = DxfFileToken.ObjectPlaceholder,
1,810✔
175
                        ItemClassId = 499,
1,810✔
176
                        MaintenanceVersion = 0,
1,810✔
177
                        ProxyFlags = ProxyFlags.None,
1,810✔
178
                        WasZombie = false,
1,810✔
179
                        InstanceCount = this._document.GetInstanceCount(DxfFileToken.ObjectPlaceholder),
1,810✔
180
                });
1,810✔
181

182
                //AcDbLayout
183
                this.AddOrUpdate(new DxfClass
1,810✔
184
                {
1,810✔
185
                        CppClassName = DxfSubclassMarker.Layout,
1,810✔
186
                        ClassNumber = (short)(500 + this.Count),
1,810✔
187
                        DwgVersion = (ACadVersion)0,
1,810✔
188
                        DxfName = DxfFileToken.ObjectLayout,
1,810✔
189
                        ItemClassId = 499,
1,810✔
190
                        MaintenanceVersion = 0,
1,810✔
191
                        ProxyFlags = ProxyFlags.None,
1,810✔
192
                        WasZombie = false,
1,810✔
193
                        InstanceCount = this._document.GetInstanceCount(DxfFileToken.ObjectLayout),
1,810✔
194
                });
1,810✔
195

196
                //AcDbDictionaryVar
197
                this.AddOrUpdate(new DxfClass
1,810✔
198
                {
1,810✔
199
                        CppClassName = DxfSubclassMarker.DictionaryVar,
1,810✔
200
                        ClassNumber = (short)(500 + this.Count),
1,810✔
201
                        DwgVersion = (ACadVersion)20,
1,810✔
202
                        DxfName = DxfFileToken.ObjectDictionaryVar,
1,810✔
203
                        ItemClassId = 499,
1,810✔
204
                        MaintenanceVersion = 0,
1,810✔
205
                        ProxyFlags = ProxyFlags.None,
1,810✔
206
                        WasZombie = false,
1,810✔
207
                        InstanceCount = this._document.GetInstanceCount(DxfFileToken.ObjectDictionaryVar),
1,810✔
208
                });
1,810✔
209

210
                //AcDbTableStyle
211
                this.AddOrUpdate(new DxfClass
1,810✔
212
                {
1,810✔
213
                        CppClassName = DxfSubclassMarker.TableStyle,
1,810✔
214
                        ClassNumber = (short)(500 + this.Count),
1,810✔
215
                        DwgVersion = ACadVersion.AC1018,
1,810✔
216
                        DxfName = DxfFileToken.ObjectTableStyle,
1,810✔
217
                        ItemClassId = 499,
1,810✔
218
                        MaintenanceVersion = 0,
1,810✔
219
                        ProxyFlags = (ProxyFlags)4095,
1,810✔
220
                        WasZombie = false,
1,810✔
221
                        InstanceCount = this._document.GetInstanceCount(DxfFileToken.ObjectTableStyle),
1,810✔
222
                });
1,810✔
223

224
                //AcDbMaterial
225
                this.AddOrUpdate(new DxfClass
1,810✔
226
                {
1,810✔
227
                        CppClassName = DxfSubclassMarker.Material,
1,810✔
228
                        ClassNumber = (short)(500 + this.Count),
1,810✔
229
                        DwgVersion = 0,
1,810✔
230
                        DxfName = DxfFileToken.ObjectMaterial,
1,810✔
231
                        ItemClassId = 499,
1,810✔
232
                        MaintenanceVersion = 0,
1,810✔
233
                        ProxyFlags = ProxyFlags.EraseAllowed | ProxyFlags.CloningAllowed | ProxyFlags.DisablesProxyWarningDialog,
1,810✔
234
                        WasZombie = false,
1,810✔
235
                        InstanceCount = this._document.GetInstanceCount(DxfFileToken.ObjectMaterial),
1,810✔
236
                });
1,810✔
237

238
                //AcDbVisualStyle
239
                this.AddOrUpdate(new DxfClass
1,810✔
240
                {
1,810✔
241
                        CppClassName = DxfSubclassMarker.VisualStyle,
1,810✔
242
                        ClassNumber = (short)(500 + this.Count),
1,810✔
243
                        DwgVersion = ACadVersion.AC1021,
1,810✔
244
                        DxfName = DxfFileToken.ObjectVisualStyle,
1,810✔
245
                        ItemClassId = 499,
1,810✔
246
                        MaintenanceVersion = 0,
1,810✔
247
                        ProxyFlags = (ProxyFlags)4095,
1,810✔
248
                        WasZombie = false,
1,810✔
249
                        InstanceCount = this._document.GetInstanceCount(DxfFileToken.ObjectVisualStyle),
1,810✔
250
                });
1,810✔
251

252
                //AcDbScale
253
                this.AddOrUpdate(new DxfClass
1,810✔
254
                {
1,810✔
255
                        CppClassName = DxfSubclassMarker.Scale,
1,810✔
256
                        ClassNumber = (short)(500 + this.Count),
1,810✔
257
                        DwgVersion = ACadVersion.AC1021,
1,810✔
258
                        DxfName = DxfFileToken.ObjectScale,
1,810✔
259
                        ItemClassId = 499,
1,810✔
260
                        MaintenanceVersion = 1,
1,810✔
261
                        ProxyFlags = ProxyFlags.EraseAllowed | ProxyFlags.CloningAllowed | ProxyFlags.DisablesProxyWarningDialog,
1,810✔
262
                        WasZombie = false,
1,810✔
263
                        InstanceCount = this._document.GetInstanceCount(DxfFileToken.ObjectScale),
1,810✔
264
                });
1,810✔
265

266
                //AcDbMLeaderStyle
267
                this.AddOrUpdate(new DxfClass
1,810✔
268
                {
1,810✔
269
                        CppClassName = DxfSubclassMarker.MLeaderStyle,
1,810✔
270
                        ClassNumber = (short)(500 + this.Count),
1,810✔
271
                        DwgVersion = ACadVersion.AC1021,
1,810✔
272
                        DxfName = DxfFileToken.ObjectMLeaderStyle,
1,810✔
273
                        ItemClassId = 499,
1,810✔
274
                        MaintenanceVersion = 25,
1,810✔
275
                        ProxyFlags = (ProxyFlags)4095,
1,810✔
276
                        WasZombie = false,
1,810✔
277
                        InstanceCount = this._document.GetInstanceCount(DxfFileToken.ObjectMLeaderStyle),
1,810✔
278
                });
1,810✔
279

280
                //AcDbCellStyleMap
281
                this.AddOrUpdate(new DxfClass
1,810✔
282
                {
1,810✔
283
                        CppClassName = DxfSubclassMarker.CellStyleMap,
1,810✔
284
                        ClassNumber = (short)(500 + this.Count),
1,810✔
285
                        DwgVersion = ACadVersion.AC1021,
1,810✔
286
                        DxfName = DxfFileToken.ObjectCellStyleMap,
1,810✔
287
                        ItemClassId = 499,
1,810✔
288
                        MaintenanceVersion = 25,
1,810✔
289
                        ProxyFlags = ProxyFlags.CloningAllowed | ProxyFlags.DisablesProxyWarningDialog,
1,810✔
290
                        WasZombie = false,
1,810✔
291
                        InstanceCount = this._document.GetInstanceCount(DxfFileToken.ObjectCellStyleMap),
1,810✔
292
                });
1,810✔
293

294
                //ExAcXREFPanelObject
295
                this.AddOrUpdate(new DxfClass
1,810✔
296
                {
1,810✔
297
                        CppClassName = "ExAcXREFPanelObject",
1,810✔
298
                        ClassNumber = (short)(500 + this.Count),
1,810✔
299
                        DwgVersion = 0,
1,810✔
300
                        DxfName = "EXACXREFPANELOBJECT",
1,810✔
301
                        ItemClassId = 499,
1,810✔
302
                        MaintenanceVersion = 0,
1,810✔
303
                        ProxyFlags = ProxyFlags.EraseAllowed | ProxyFlags.DisablesProxyWarningDialog,
1,810✔
304
                        WasZombie = false,
1,810✔
305
                        InstanceCount = this._document.GetInstanceCount("EXACXREFPANELOBJECT"),
1,810✔
306
                });
1,810✔
307

308
                //AcDbImpNonPersistentObjectsCollection
309
                this.AddOrUpdate(new DxfClass
1,810✔
310
                {
1,810✔
311
                        CppClassName = "AcDbImpNonPersistentObjectsCollection",
1,810✔
312
                        ClassNumber = (short)(500 + this.Count),
1,810✔
313
                        DwgVersion = 0,
1,810✔
314
                        DxfName = "NPOCOLLECTION",
1,810✔
315
                        ItemClassId = 499,
1,810✔
316
                        MaintenanceVersion = 0,
1,810✔
317
                        ProxyFlags = ProxyFlags.EraseAllowed | ProxyFlags.CloningAllowed | ProxyFlags.DisablesProxyWarningDialog,
1,810✔
318
                        WasZombie = false,
1,810✔
319
                        InstanceCount = this._document.GetInstanceCount("NPOCOLLECTION"),
1,810✔
320
                });
1,810✔
321

322
                //AcDbLayerIndex
323
                this.AddOrUpdate(new DxfClass
1,810✔
324
                {
1,810✔
325
                        CppClassName = "AcDbLayerIndex",
1,810✔
326
                        ClassNumber = (short)(500 + this.Count),
1,810✔
327
                        DwgVersion = 0,
1,810✔
328
                        DxfName = "LAYER_INDEX",
1,810✔
329
                        ItemClassId = 499,
1,810✔
330
                        MaintenanceVersion = 0,
1,810✔
331
                        ProxyFlags = ProxyFlags.None,
1,810✔
332
                        WasZombie = false,
1,810✔
333
                        InstanceCount = this._document.GetInstanceCount("LAYER_INDEX"),
1,810✔
334
                });
1,810✔
335

336
                //AcDbSpatialIndex
337
                this.AddOrUpdate(new DxfClass
1,810✔
338
                {
1,810✔
339
                        CppClassName = "AcDbSpatialIndex",
1,810✔
340
                        ClassNumber = (short)(500 + this.Count),
1,810✔
341
                        DwgVersion = 0,
1,810✔
342
                        DxfName = "SPATIAL_INDEX",
1,810✔
343
                        ItemClassId = 499,
1,810✔
344
                        MaintenanceVersion = 0,
1,810✔
345
                        ProxyFlags = ProxyFlags.None,
1,810✔
346
                        WasZombie = false,
1,810✔
347
                        InstanceCount = this._document.GetInstanceCount("SPATIAL_INDEX"),
1,810✔
348
                });
1,810✔
349

350
                //AcDbIdBuffer
351
                this.AddOrUpdate(new DxfClass
1,810✔
352
                {
1,810✔
353
                        CppClassName = "AcDbIdBuffer",
1,810✔
354
                        ClassNumber = (short)(500 + this.Count),
1,810✔
355
                        DwgVersion = ACadVersion.AC1014,
1,810✔
356
                        DxfName = "IDBUFFER",
1,810✔
357
                        ItemClassId = 499,
1,810✔
358
                        MaintenanceVersion = 0,
1,810✔
359
                        ProxyFlags = ProxyFlags.R13FormatProxy,
1,810✔
360
                        WasZombie = false,
1,810✔
361
                        InstanceCount = this._document.GetInstanceCount("IDBUFFER"),
1,810✔
362
                });
1,810✔
363

364
                //AcDbSectionViewStyle
365
                this.AddOrUpdate(new DxfClass
1,810✔
366
                {
1,810✔
367
                        CppClassName = "AcDbSectionViewStyle",
1,810✔
368
                        ClassNumber = (short)(500 + this.Count),
1,810✔
369
                        DwgVersion = 0,
1,810✔
370
                        DxfName = "ACDBSECTIONVIEWSTYLE",
1,810✔
371
                        ItemClassId = 499,
1,810✔
372
                        MaintenanceVersion = 0,
1,810✔
373
                        ProxyFlags = ProxyFlags.EraseAllowed | ProxyFlags.DisablesProxyWarningDialog,
1,810✔
374
                        WasZombie = false,
1,810✔
375
                        InstanceCount = this._document.GetInstanceCount("ACDBSECTIONVIEWSTYLE"),
1,810✔
376
                });
1,810✔
377

378
                //AcDbDetailViewStyle
379
                this.AddOrUpdate(new DxfClass
1,810✔
380
                {
1,810✔
381
                        CppClassName = "AcDbDetailViewStyle",
1,810✔
382
                        ClassNumber = (short)(500 + this.Count),
1,810✔
383
                        DwgVersion = 0,
1,810✔
384
                        DxfName = "ACDBDETAILVIEWSTYLE",
1,810✔
385
                        ItemClassId = 499,
1,810✔
386
                        MaintenanceVersion = 0,
1,810✔
387
                        ProxyFlags = ProxyFlags.EraseAllowed | ProxyFlags.DisablesProxyWarningDialog,
1,810✔
388
                        WasZombie = false,
1,810✔
389
                        InstanceCount = this._document.GetInstanceCount("ACDBDETAILVIEWSTYLE"),
1,810✔
390
                });
1,810✔
391

392
                //AcDbSubDMesh
393
                this.AddOrUpdate(new DxfClass
1,810✔
394
                {
1,810✔
395
                        CppClassName = DxfSubclassMarker.Mesh,
1,810✔
396
                        ClassNumber = (short)(500 + this.Count),
1,810✔
397
                        DwgVersion = 0,
1,810✔
398
                        DxfName = DxfFileToken.EntityMesh,
1,810✔
399
                        ItemClassId = 498,
1,810✔
400
                        MaintenanceVersion = 0,
1,810✔
401
                        ProxyFlags = ProxyFlags.None,
1,810✔
402
                        WasZombie = false,
1,810✔
403
                        InstanceCount = this._document.GetInstanceCount(DxfFileToken.EntityMesh),
1,810✔
404
                });
1,810✔
405

406
                //AcDbSortentsTable
407
                this.AddOrUpdate(new DxfClass
1,810✔
408
                {
1,810✔
409
                        CppClassName = DxfSubclassMarker.SortentsTable,
1,810✔
410
                        ClassNumber = (short)(500 + this.Count),
1,810✔
411
                        DwgVersion = ACadVersion.AC1014,
1,810✔
412
                        DxfName = DxfFileToken.ObjectSortEntsTable,
1,810✔
413
                        ItemClassId = 499,
1,810✔
414
                        MaintenanceVersion = 0,
1,810✔
415
                        ProxyFlags = ProxyFlags.None,
1,810✔
416
                        WasZombie = false,
1,810✔
417
                        InstanceCount = this._document.GetInstanceCount(DxfFileToken.ObjectSortEntsTable),
1,810✔
418
                });
1,810✔
419

420
                //AcDbTextObjectContextData
421
                this.AddOrUpdate(new DxfClass
1,810✔
422
                {
1,810✔
423
                        CppClassName = "AcDbTextObjectContextData",
1,810✔
424
                        ClassNumber = (short)(500 + this.Count),
1,810✔
425
                        DwgVersion = 0,
1,810✔
426
                        DxfName = "ACDB_TEXTOBJECTCONTEXTDATA_CLASS",
1,810✔
427
                        ItemClassId = 499,
1,810✔
428
                        MaintenanceVersion = 0,
1,810✔
429
                        ProxyFlags = ProxyFlags.EraseAllowed | ProxyFlags.CloningAllowed | ProxyFlags.DisablesProxyWarningDialog,
1,810✔
430
                        WasZombie = false,
1,810✔
431
                        InstanceCount = this._document.GetInstanceCount("ACDB_TEXTOBJECTCONTEXTDATA_CLASS"),
1,810✔
432
                });
1,810✔
433

434
                //AcDbWipeout
435
                this.AddOrUpdate(new DxfClass
1,810✔
436
                {
1,810✔
437
                        ApplicationName = "WipeOut",
1,810✔
438
                        CppClassName = DxfSubclassMarker.Wipeout,
1,810✔
439
                        ClassNumber = (short)(500 + this.Count),
1,810✔
440
                        DwgVersion = ACadVersion.AC1015,
1,810✔
441
                        DxfName = DxfFileToken.EntityWipeout,
1,810✔
442
                        ItemClassId = 498,
1,810✔
443
                        MaintenanceVersion = 0,
1,810✔
444
                        ProxyFlags = ProxyFlags.EraseAllowed | ProxyFlags.TransformAllowed | ProxyFlags.ColorChangeAllowed | ProxyFlags.LayerChangeAllowed | ProxyFlags.LinetypeChangeAllowed | ProxyFlags.LinetypeScaleChangeAllowed | ProxyFlags.VisibilityChangeAllowed | ProxyFlags.R13FormatProxy,
1,810✔
445
                        WasZombie = false,
1,810✔
446
                        InstanceCount = this._document.GetInstanceCount(DxfFileToken.EntityWipeout),
1,810✔
447
                });
1,810✔
448

449
                //AcDbWipeoutVariables
450
                this.AddOrUpdate(new DxfClass
1,810✔
451
                {
1,810✔
452
                        ApplicationName = "WipeOut",
1,810✔
453
                        CppClassName = "AcDbWipeoutVariables",
1,810✔
454
                        ClassNumber = (short)(500 + this.Count),
1,810✔
455
                        DwgVersion = ACadVersion.AC1015,
1,810✔
456
                        DxfName = "WIPEOUTVARIABLES",
1,810✔
457
                        ItemClassId = 499,
1,810✔
458
                        MaintenanceVersion = 0,
1,810✔
459
                        ProxyFlags = ProxyFlags.R13FormatProxy,
1,810✔
460
                        WasZombie = false,
1,810✔
461
                        InstanceCount = this._document.GetInstanceCount("WIPEOUTVARIABLES"),
1,810✔
462
                });
1,810✔
463

464
                //AcDbDimAssoc
465
                this.AddOrUpdate(new DxfClass
1,810✔
466
                {
1,810✔
467
                        ApplicationName = "AcDbDimAssoc",
1,810✔
468
                        CppClassName = "AcDbDimAssoc",
1,810✔
469
                        ClassNumber = (short)(500 + this.Count),
1,810✔
470
                        DwgVersion = 0,
1,810✔
471
                        DxfName = "DIMASSOC",
1,810✔
472
                        ItemClassId = 499,
1,810✔
473
                        MaintenanceVersion = 0,
1,810✔
474
                        ProxyFlags = ProxyFlags.None,
1,810✔
475
                        WasZombie = false,
1,810✔
476
                        InstanceCount = this._document.GetInstanceCount("DIMASSOC"),
1,810✔
477
                });
1,810✔
478

479
                //AcDbTable
480
                this.AddOrUpdate(new DxfClass
1,810✔
481
                {
1,810✔
482
                        CppClassName = DxfSubclassMarker.TableEntity,
1,810✔
483
                        ClassNumber = (short)(500 + this.Count),
1,810✔
484
                        DwgVersion = ACadVersion.AC1018,
1,810✔
485
                        DxfName = DxfFileToken.EntityTable,
1,810✔
486
                        ItemClassId = 498,
1,810✔
487
                        MaintenanceVersion = 0,
1,810✔
488
                        ProxyFlags = ProxyFlags.EraseAllowed | ProxyFlags.DisablesProxyWarningDialog,
1,810✔
489
                        WasZombie = false,
1,810✔
490
                        InstanceCount = this._document.GetInstanceCount(DxfFileToken.EntityTable),
1,810✔
491
                });
1,810✔
492

493
                //AcDbTableContent
494
                this.AddOrUpdate(new DxfClass
1,810✔
495
                {
1,810✔
496
                        CppClassName = DxfSubclassMarker.TableContent,
1,810✔
497
                        ClassNumber = (short)(500 + this.Count),
1,810✔
498
                        DwgVersion = ACadVersion.AC1018,
1,810✔
499
                        DxfName = DxfFileToken.ObjectTableContent,
1,810✔
500
                        ItemClassId = 499,
1,810✔
501
                        MaintenanceVersion = 21,
1,810✔
502
                        ProxyFlags = ProxyFlags.CloningAllowed | ProxyFlags.DisablesProxyWarningDialog,
1,810✔
503
                        WasZombie = false,
1,810✔
504
                        InstanceCount = this._document.GetInstanceCount(DxfFileToken.ObjectTableContent),
1,810✔
505
                });
1,810✔
506

507
                //AcDbTableGeometry
508
                this.AddOrUpdate(new DxfClass
1,810✔
509
                {
1,810✔
510
                        CppClassName = "AcDbTableGeometry",
1,810✔
511
                        ClassNumber = (short)(500 + this.Count),
1,810✔
512
                        DwgVersion = 0,
1,810✔
513
                        DxfName = "TABLEGEOMETRY",
1,810✔
514
                        ItemClassId = 499,
1,810✔
515
                        MaintenanceVersion = 0,
1,810✔
516
                        ProxyFlags = ProxyFlags.CloningAllowed | ProxyFlags.DisablesProxyWarningDialog,
1,810✔
517
                        WasZombie = false,
1,810✔
518
                        InstanceCount = this._document.GetInstanceCount("TABLEGEOMETRY"),
1,810✔
519
                });
1,810✔
520

521
                //AcDbRasterImage
522
                this.AddOrUpdate(new DxfClass
1,810✔
523
                {
1,810✔
524
                        ApplicationName = "ISM",
1,810✔
525
                        CppClassName = DxfSubclassMarker.RasterImage,
1,810✔
526
                        ClassNumber = (short)(500 + this.Count),
1,810✔
527
                        DwgVersion = (ACadVersion)20,
1,810✔
528
                        DxfName = DxfFileToken.EntityImage,
1,810✔
529
                        ItemClassId = 498,
1,810✔
530
                        MaintenanceVersion = 0,
1,810✔
531
                        ProxyFlags = ProxyFlags.EraseAllowed | ProxyFlags.TransformAllowed | ProxyFlags.ColorChangeAllowed | ProxyFlags.LayerChangeAllowed | ProxyFlags.LinetypeChangeAllowed | ProxyFlags.LinetypeScaleChangeAllowed | ProxyFlags.VisibilityChangeAllowed | ProxyFlags.R13FormatProxy,
1,810✔
532
                        WasZombie = false,
1,810✔
533
                        InstanceCount = this._document.GetInstanceCount(DxfFileToken.EntityImage),
1,810✔
534
                });
1,810✔
535

536
                //AcDbRasterImageDef
537
                this.AddOrUpdate(new DxfClass
1,810✔
538
                {
1,810✔
539
                        ApplicationName = "ISM",
1,810✔
540
                        CppClassName = DxfSubclassMarker.RasterImageDef,
1,810✔
541
                        ClassNumber = (short)(500 + this.Count),
1,810✔
542
                        DwgVersion = (ACadVersion)20,
1,810✔
543
                        DxfName = DxfFileToken.ObjectImageDefinition,
1,810✔
544
                        ItemClassId = 499,
1,810✔
545
                        MaintenanceVersion = 0,
1,810✔
546
                        ProxyFlags = ProxyFlags.None,
1,810✔
547
                        WasZombie = false,
1,810✔
548
                        InstanceCount = this._document.GetInstanceCount(DxfFileToken.ObjectImageDefinition),
1,810✔
549
                });
1,810✔
550

551
                ////AcDbRasterImageDefReactor
552
                this.AddOrUpdate(new DxfClass
1,810✔
553
                {
1,810✔
554
                        ApplicationName = "ISM",
1,810✔
555
                        CppClassName = DxfSubclassMarker.RasterImageDefReactor,
1,810✔
556
                        ClassNumber = (short)(500 + this.Count),
1,810✔
557
                        DwgVersion = (ACadVersion)20,
1,810✔
558
                        DxfName = DxfFileToken.ObjectImageDefinitionReactor,
1,810✔
559
                        ItemClassId = 499,
1,810✔
560
                        MaintenanceVersion = 0,
1,810✔
561
                        ProxyFlags = ProxyFlags.EraseAllowed,
1,810✔
562
                        WasZombie = false,
1,810✔
563
                        InstanceCount = this._document.GetInstanceCount(DxfFileToken.ObjectImageDefinitionReactor),
1,810✔
564
                });
1,810✔
565

566
                //AcDbColor
567
                this.AddOrUpdate(new DxfClass
1,810✔
568
                {
1,810✔
569
                        CppClassName = DxfSubclassMarker.DbColor,
1,810✔
570
                        ClassNumber = (short)(500 + this.Count),
1,810✔
571
                        DwgVersion = ACadVersion.AC1015,
1,810✔
572
                        DxfName = DxfFileToken.ObjectDBColor,
1,810✔
573
                        ItemClassId = 499,
1,810✔
574
                        MaintenanceVersion = 14,
1,810✔
575
                        ProxyFlags = ProxyFlags.None,
1,810✔
576
                        WasZombie = false,
1,810✔
577
                        InstanceCount = this._document.GetInstanceCount(DxfFileToken.ObjectDBColor),
1,810✔
578
                });
1,810✔
579

580
                //AcDbGeoData
581
                this.AddOrUpdate(new DxfClass
1,810✔
582
                {
1,810✔
583
                        CppClassName = DxfSubclassMarker.GeoData,
1,810✔
584
                        ClassNumber = (short)(500 + this.Count),
1,810✔
585
                        DwgVersion = ACadVersion.AC1021,
1,810✔
586
                        DxfName = DxfFileToken.ObjectGeoData,
1,810✔
587
                        ItemClassId = 499,
1,810✔
588
                        MaintenanceVersion = 45,
1,810✔
589
                        ProxyFlags = (ProxyFlags)4095,
1,810✔
590
                        WasZombie = false,
1,810✔
591
                        InstanceCount = this._document.GetInstanceCount(DxfFileToken.ObjectGeoData),
1,810✔
592
                });
1,810✔
593

594
                //AcDbMLeader
595
                this.AddOrUpdate(new DxfClass
1,810✔
596
                {
1,810✔
597
                        CppClassName = DxfSubclassMarker.MultiLeader,
1,810✔
598
                        ClassNumber = (short)(500 + this.Count),
1,810✔
599
                        DwgVersion = ACadVersion.MC0_0,
1,810✔
600
                        DxfName = DxfFileToken.EntityMultiLeader,
1,810✔
601
                        ItemClassId = 499,
1,810✔
602
                        MaintenanceVersion = 0,
1,810✔
603
                        ProxyFlags = ProxyFlags.EraseAllowed | ProxyFlags.DisablesProxyWarningDialog,
1,810✔
604
                        WasZombie = false,
1,810✔
605
                        InstanceCount = this._document.GetInstanceCount(DxfFileToken.EntityMultiLeader),
1,810✔
606
                });
1,810✔
607

608
                //AcDbPdfReference
609
                this.AddOrUpdate(new DxfClass
1,810✔
610
                {
1,810✔
611
                        CppClassName = DxfSubclassMarker.PdfReference,
1,810✔
612
                        ClassNumber = (short)(500 + this.Count),
1,810✔
613
                        DwgVersion = (ACadVersion)26,
1,810✔
614
                        DxfName = DxfFileToken.EntityPdfUnderlay,
1,810✔
615
                        ItemClassId = 498,
1,810✔
616
                        MaintenanceVersion = 0,
1,810✔
617
                        ProxyFlags = (ProxyFlags)4095,
1,810✔
618
                        WasZombie = false,
1,810✔
619
                        InstanceCount = this._document.GetInstanceCount(DxfFileToken.EntityPdfUnderlay),
1,810✔
620
                });
1,810✔
621

622
                //AcDbPdfDefinition
623
                this.AddOrUpdate(new DxfClass
1,810✔
624
                {
1,810✔
625
                        CppClassName = DxfSubclassMarker.PdfDefinition,
1,810✔
626
                        ClassNumber = (short)(500 + this.Count),
1,810✔
627
                        DwgVersion = (ACadVersion)26,
1,810✔
628
                        DxfName = DxfFileToken.ObjectPdfDefinition,
1,810✔
629
                        ItemClassId = 499,
1,810✔
630
                        MaintenanceVersion = 0,
1,810✔
631
                        ProxyFlags = ProxyFlags.EraseAllowed | ProxyFlags.CloningAllowed | ProxyFlags.DisablesProxyWarningDialog,
1,810✔
632
                        WasZombie = false,
1,810✔
633
                        InstanceCount = this._document.GetInstanceCount(DxfFileToken.ObjectPdfDefinition),
1,810✔
634
                });
1,810✔
635

636
                //AcDbRasterVariables
637
                this.AddOrUpdate(new DxfClass
1,810✔
638
                {
1,810✔
639
                        ApplicationName = "ISM",
1,810✔
640
                        CppClassName = DxfSubclassMarker.RasterVariables,
1,810✔
641
                        ClassNumber = (short)(500 + this.Count),
1,810✔
642
                        DwgVersion = (ACadVersion)20,
1,810✔
643
                        DxfName = DxfFileToken.ObjectRasterVariables,
1,810✔
644
                        ItemClassId = 499,
1,810✔
645
                        MaintenanceVersion = 0,
1,810✔
646
                        ProxyFlags = ProxyFlags.None,
1,810✔
647
                        WasZombie = false,
1,810✔
648
                        InstanceCount = this._document.GetInstanceCount(DxfFileToken.ObjectRasterVariables),
1,810✔
649
                });
1,810✔
650

651
                //AcDbSpatialFilter
652
                this.AddOrUpdate(new DxfClass
1,810✔
653
                {
1,810✔
654
                        CppClassName = DxfSubclassMarker.SpatialFilter,
1,810✔
655
                        ClassNumber = (short)(500 + this.Count),
1,810✔
656
                        DwgVersion = (ACadVersion)20,
1,810✔
657
                        DxfName = DxfFileToken.ObjectSpatialFilter,
1,810✔
658
                        ItemClassId = 499,
1,810✔
659
                        MaintenanceVersion = 0,
1,810✔
660
                        ProxyFlags = ProxyFlags.None,
1,810✔
661
                        WasZombie = false,
1,810✔
662
                        InstanceCount = this._document.GetInstanceCount(DxfFileToken.ObjectSpatialFilter),
1,810✔
663
                });
1,810✔
664

665
                //AcDbMLeaderObjectContextData
666
                this.AddOrUpdate(new DxfClass
1,810✔
667
                {
1,810✔
668
                        CppClassName = DxfSubclassMarker.MultiLeaderObjectContextData,
1,810✔
669
                        ClassNumber = (short)(500 + this.Count),
1,810✔
670
                        DwgVersion = ACadVersion.MC0_0,
1,810✔
671
                        DxfName = DxfFileToken.ObjectMLeaderContextData,
1,810✔
672
                        ItemClassId = 499,
1,810✔
673
                        MaintenanceVersion = 0,
1,810✔
674
                        ProxyFlags = ProxyFlags.EraseAllowed | ProxyFlags.DisablesProxyWarningDialog,
1,810✔
675
                        WasZombie = false,
1,810✔
676
                        InstanceCount = this._document.GetInstanceCount(DxfFileToken.ObjectMLeaderContextData),
1,810✔
677
                });
1,810✔
678

679
                //AcDbPlotSettings
680
                this.AddOrUpdate(new DxfClass
1,810✔
681
                {
1,810✔
682
                        CppClassName = DxfSubclassMarker.PlotSettings,
1,810✔
683
                        ClassNumber = (short)(500 + this.Count),
1,810✔
684
                        DwgVersion = ACadVersion.AC1015,
1,810✔
685
                        DxfName = DxfFileToken.ObjectPlotSettings,
1,810✔
686
                        ItemClassId = 499,
1,810✔
687
                        MaintenanceVersion = 42,
1,810✔
688
                        ProxyFlags = ProxyFlags.None,
1,810✔
689
                        WasZombie = false,
1,810✔
690
                        InstanceCount = this._document.GetInstanceCount(DxfFileToken.ObjectPlotSettings),
1,810✔
691
                });
1,810✔
692

693
                //AcDbField
694
                this.AddOrUpdate(new DxfClass
1,810✔
695
                {
1,810✔
696
                        CppClassName = DxfSubclassMarker.Field,
1,810✔
697
                        ClassNumber = (short)(500 + this.Count),
1,810✔
698
                        DwgVersion = ACadVersion.AC1018,
1,810✔
699
                        DxfName = DxfFileToken.ObjectField,
1,810✔
700
                        ItemClassId = 499,
1,810✔
701
                        MaintenanceVersion = 0,
1,810✔
702
                        ProxyFlags = ProxyFlags.CloningAllowed | ProxyFlags.DisablesProxyWarningDialog,
1,810✔
703
                        WasZombie = false,
1,810✔
704
                        InstanceCount = this._document.GetInstanceCount(DxfFileToken.ObjectField),
1,810✔
705
                });
1,810✔
706

707
                //AcDbFieldList
708
                this.AddOrUpdate(new DxfClass
1,810✔
709
                {
1,810✔
710
                        CppClassName = DxfSubclassMarker.FieldList,
1,810✔
711
                        ClassNumber = (short)(500 + this.Count),
1,810✔
712
                        DwgVersion = ACadVersion.AC1018,
1,810✔
713
                        DxfName = DxfFileToken.ObjectFieldList,
1,810✔
714
                        ItemClassId = 499,
1,810✔
715
                        MaintenanceVersion = 0,
1,810✔
716
                        ProxyFlags = ProxyFlags.CloningAllowed | ProxyFlags.DisablesProxyWarningDialog,
1,810✔
717
                        WasZombie = false,
1,810✔
718
                        InstanceCount = this._document.GetInstanceCount(DxfFileToken.ObjectFieldList),
1,810✔
719
                });
1,810✔
720

721
                //AcDbMTextAttributeObjectContextData
722
                this.AddOrUpdate(new DxfClass
1,810✔
723
                {
1,810✔
724
                        CppClassName = DxfSubclassMarker.MTextAttributeObjectContextData,
1,810✔
725
                        ClassNumber = (short)(500 + this.Count),
1,810✔
726
                        DwgVersion = ACadVersion.AC1021,
1,810✔
727
                        DxfName = DxfFileToken.MTextAttributeObjectContextData,
1,810✔
728
                        ItemClassId = 499,
1,810✔
729
                        MaintenanceVersion = 0,
1,810✔
730
                        ProxyFlags = ProxyFlags.EraseAllowed | ProxyFlags.CloningAllowed | ProxyFlags.DisablesProxyWarningDialog,
1,810✔
731
                        WasZombie = false,
1,810✔
732
                        InstanceCount = this._document.GetInstanceCount(DxfFileToken.MTextAttributeObjectContextData),
1,810✔
733
                });
1,810✔
734

735
                //AcDbBlkRefObjectContextData
736
                this.AddOrUpdate(new DxfClass
1,810✔
737
                {
1,810✔
738
                        CppClassName = DxfSubclassMarker.BlkRefObjectContextData,
1,810✔
739
                        ClassNumber = (short)(500 + this.Count),
1,810✔
740
                        DwgVersion = ACadVersion.AC1021,
1,810✔
741
                        DxfName = DxfFileToken.BlkRefObjectContextData,
1,810✔
742
                        ItemClassId = 499,
1,810✔
743
                        MaintenanceVersion = 0,
1,810✔
744
                        ProxyFlags = ProxyFlags.EraseAllowed | ProxyFlags.CloningAllowed | ProxyFlags.DisablesProxyWarningDialog,
1,810✔
745
                        WasZombie = false,
1,810✔
746
                        InstanceCount = this._document.GetInstanceCount(DxfFileToken.BlkRefObjectContextData),
1,810✔
747
                });
1,810✔
748
        }
1,810✔
749

750
        private void resetClassNumbers()
751
        {
1,810✔
752
                var arr = this._entries.Values.ToArray();
1,810✔
753
                for (int i = 0; i < arr.Length; i++)
71,486✔
754
                {
33,933✔
755
                        arr[i].ClassNumber = (short)(500 + i);
33,933✔
756
                }
33,933✔
757
        }
1,810✔
758
}
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