1
   2
   3
   4
   5
   6
   7
   8
   9
  10
  11
  12
  13
  14
  15
  16
  17
  18
  19
  20
  21
  22
  23
  24
  25
  26
  27
  28
  29
  30
  31
  32
  33
  34
  35
  36
  37
  38
  39
  40
  41
  42
  43
  44
  45
  46
  47
  48
  49
  50
  51
  52
  53
  54
  55
  56
  57
  58
  59
  60
  61
  62
  63
  64
  65
  66
  67
  68
  69
  70
  71
  72
  73
  74
  75
  76
  77
  78
  79
  80
  81
  82
  83
  84
  85
  86
  87
  88
  89
  90
  91
  92
  93
  94
  95
  96
  97
  98
  99
 100
 101
 102
 103
 104
 105
 106
 107
 108
 109
 110
 111
 112
 113
 114
 115
 116
 117
 118
 119
 120
 121
 122
 123
 124
 125
 126
 127
 128
 129
 130
 131
 132
 133
 134
 135
 136
 137
 138
 139
 140
 141
 142
 143
 144
 145
 146
 147
 148
 149
 150
 151
 152
 153
 154
 155
 156
 157
 158
 159
 160
 161
 162
 163
 164
 165
 166
 167
 168
 169
 170
 171
 172
 173
 174
 175
 176
 177
 178
 179
 180
 181
 182
 183
 184
 185
 186
 187
 188
 189
 190
 191
 192
 193
 194
 195
 196
 197
 198
 199
 200
 201
 202
 203
 204
 205
 206
 207
 208
 209
 210
 211
 212
 213
 214
 215
 216
 217
 218
 219
 220
 221
 222
 223
 224
 225
 226
 227
 228
 229
 230
 231
 232
 233
 234
 235
 236
 237
 238
 239
 240
 241
 242
 243
 244
 245
 246
 247
 248
 249
 250
 251
 252
 253
 254
 255
 256
 257
 258
 259
 260
 261
 262
 263
 264
 265
 266
 267
 268
 269
 270
 271
 272
 273
 274
 275
 276
 277
 278
 279
 280
 281
 282
 283
 284
 285
 286
 287
 288
 289
 290
 291
 292
 293
 294
 295
 296
 297
 298
 299
 300
 301
 302
 303
 304
 305
 306
 307
 308
 309
 310
 311
 312
 313
 314
 315
 316
 317
 318
 319
 320
 321
 322
 323
 324
 325
 326
 327
 328
 329
 330
 331
 332
 333
 334
 335
 336
 337
 338
 339
 340
 341
 342
 343
 344
 345
 346
 347
 348
 349
 350
 351
 352
 353
 354
 355
 356
 357
 358
 359
 360
 361
 362
 363
 364
 365
 366
 367
 368
 369
 370
 371
 372
 373
 374
 375
 376
 377
 378
 379
 380
 381
 382
 383
 384
 385
 386
 387
 388
 389
 390
 391
 392
 393
 394
 395
 396
 397
 398
 399
 400
 401
 402
 403
 404
 405
 406
 407
 408
 409
 410
 411
 412
 413
 414
 415
 416
 417
 418
 419
 420
 421
 422
 423
 424
 425
 426
 427
 428
 429
 430
 431
 432
 433
 434
 435
 436
 437
 438
 439
 440
 441
 442
 443
 444
 445
 446
 447
 448
 449
 450
 451
 452
 453
 454
 455
 456
 457
 458
 459
 460
 461
 462
 463
 464
 465
 466
 467
 468
 469
 470
 471
 472
 473
 474
 475
 476
 477
 478
 479
 480
 481
 482
 483
 484
 485
 486
 487
 488
 489
 490
 491
 492
 493
 494
 495
 496
 497
 498
 499
 500
 501
 502
 503
 504
 505
 506
 507
 508
 509
 510
 511
 512
 513
 514
 515
 516
 517
 518
 519
 520
 521
 522
 523
 524
 525
 526
 527
 528
 529
 530
 531
 532
 533
 534
 535
 536
 537
 538
 539
 540
 541
 542
 543
 544
 545
 546
 547
 548
 549
 550
 551
 552
 553
 554
 555
 556
 557
 558
 559
 560
 561
 562
 563
 564
 565
 566
 567
 568
 569
 570
 571
 572
 573
 574
 575
 576
 577
 578
 579
 580
 581
 582
 583
 584
 585
 586
 587
 588
 589
 590
 591
 592
 593
 594
 595
 596
 597
 598
 599
 600
 601
 602
 603
 604
 605
 606
 607
 608
 609
 610
 611
 612
 613
 614
 615
 616
 617
 618
 619
 620
 621
 622
 623
 624
 625
 626
 627
 628
 629
 630
 631
 632
 633
 634
 635
 636
 637
 638
 639
 640
 641
 642
 643
 644
 645
 646
 647
 648
 649
 650
 651
 652
 653
 654
 655
 656
 657
 658
 659
 660
 661
 662
 663
 664
 665
 666
 667
 668
 669
 670
 671
 672
 673
 674
 675
 676
 677
 678
 679
 680
 681
 682
 683
 684
 685
 686
 687
 688
 689
 690
 691
 692
 693
 694
 695
 696
 697
 698
 699
 700
 701
 702
 703
 704
 705
 706
 707
 708
 709
 710
 711
 712
 713
 714
 715
 716
 717
 718
 719
 720
 721
 722
 723
 724
 725
 726
 727
 728
 729
 730
 731
 732
 733
 734
 735
 736
 737
 738
 739
 740
 741
 742
 743
 744
 745
 746
 747
 748
 749
 750
 751
 752
 753
 754
 755
 756
 757
 758
 759
 760
 761
 762
 763
 764
 765
 766
 767
 768
 769
 770
 771
 772
 773
 774
 775
 776
 777
 778
 779
 780
 781
 782
 783
 784
 785
 786
 787
 788
 789
 790
 791
 792
 793
 794
 795
 796
 797
 798
 799
 800
 801
 802
 803
 804
 805
 806
 807
 808
 809
 810
 811
 812
 813
 814
 815
 816
 817
 818
 819
 820
 821
 822
 823
 824
 825
 826
 827
 828
 829
 830
 831
 832
 833
 834
 835
 836
 837
 838
 839
 840
 841
 842
 843
 844
 845
 846
 847
 848
 849
 850
 851
 852
 853
 854
 855
 856
 857
 858
 859
 860
 861
 862
 863
 864
 865
 866
 867
 868
 869
 870
 871
 872
 873
 874
 875
 876
 877
 878
 879
 880
 881
 882
 883
 884
 885
 886
 887
 888
 889
 890
 891
 892
 893
 894
 895
 896
 897
 898
 899
 900
 901
 902
 903
 904
 905
 906
 907
 908
 909
 910
 911
 912
 913
 914
 915
 916
 917
 918
 919
 920
 921
 922
 923
 924
 925
 926
 927
 928
 929
 930
 931
 932
 933
 934
 935
 936
 937
 938
 939
 940
 941
 942
 943
 944
 945
 946
 947
 948
 949
 950
 951
 952
 953
 954
 955
 956
 957
 958
 959
 960
 961
 962
 963
 964
 965
 966
 967
 968
 969
 970
 971
 972
 973
 974
 975
 976
 977
 978
 979
 980
 981
 982
 983
 984
 985
 986
 987
 988
 989
 990
 991
 992
 993
 994
 995
 996
 997
 998
 999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
3205
3206
3207
3208
3209
3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
3266
3267
3268
3269
3270
3271
3272
3273
3274
3275
3276
3277
3278
3279
3280
3281
3282
3283
3284
3285
3286
3287
3288
3289
3290
3291
3292
3293
3294
3295
3296
3297
3298
3299
3300
3301
3302
3303
3304
3305
3306
3307
3308
3309
3310
3311
3312
3313
3314
3315
3316
3317
3318
3319
3320
3321
3322
3323
3324
3325
3326
3327
3328
3329
3330
3331
3332
3333
// The contents of this file are automatically generated and should not be modified directly.  See the `build` directory.

// types from `lib.rs`.
use crate::{
    CodePair,
    Color,
    DxfError,
    DxfResult,
    Handle,
    LineWeight,
    Point,
    Vector,
};
use crate::code_pair_writer::CodePairWriter;
use crate::helper_functions::*;

use crate::enums::*;
use crate::enum_primitive::FromPrimitive;

use std::io::Write;
use std::time::Duration;

extern crate chrono;
use self::chrono::{DateTime, Local, Utc};

extern crate uuid;
use self::uuid::Uuid;
/// Contains common properties for the DXF file.
#[cfg_attr(feature = "serialize", derive(Serialize, Deserialize))]
pub struct Header {
    /// The $ACADVER header variable.  The AutoCAD drawing database version number.
    pub version: AcadVersion,
    /// The $ACADMAINTVER header variable.  Maintenance version number (should be ignored).  Minimum AutoCAD version: R14.
    pub maintenance_version: i16,
    /// The $DWGCODEPAGE header variable.  Drawing code page; set to the system code page when a new drawing is created, but not otherwise maintained by AutoCAD.  Minimum AutoCAD version: R13.
    pub drawing_code_page: String,
    /// The $LASTSAVEDBY header variable.  Name of the last user to modify the file.  Minimum AutoCAD version: R2004.
    pub last_saved_by: String,
    /// The $REQUIREDVERSIONS header variable.  Unknown.  Minimum AutoCAD version: R2013.
    pub required_versions: i64,
    /// The $INSBASE header variable.  Insertion base set by BASE command (in WCS).
    pub insertion_base: Point,
    /// The $EXTMIN header variable.  X, Y, and Z drawing extents lower-left corner (in WCS).
    pub minimum_drawing_extents: Point,
    /// The $EXTMAX header variable.  X, Y, and Z drawing extents upper-right corner (in WCS).
    pub maximum_drawing_extents: Point,
    /// The $LIMMIN header variable.  XY drawing limits lower-left corner (in WCS).
    pub minimum_drawing_limits: Point,
    /// The $LIMMAX header variable.  XY drawing limits upper-right corner (in WCS).
    pub maximum_drawing_limits: Point,
    /// The $ORTHOMODE header variable.  Ortho mode on.
    pub draw_orthogonal_lines: bool,
    /// The $REGENMODE header variable.  REGENAUTO mode on.
    pub use_regen_mode: bool,
    /// The $FILLMODE header variable.  Fill mode on.
    pub fill_mode_on: bool,
    /// The $QTEXTMODE header variable.  Quick text mode on.
    pub use_quick_text_mode: bool,
    /// The $MIRRTEXT header variable.  Mirror text.
    pub mirror_text: bool,
    /// The $DRAGMODE header variable.  Controls the way dragged objects are displayed.  Maximum AutoCAD version: R14.
    pub drag_mode: DragMode,
    /// The $LTSCALE header variable.  Global line type scale.
    pub line_type_scale: f64,
    /// The $OSMODE header variable.  Running object snap modes.  Maximum AutoCAD version: R14.
    pub object_snap_flags: i32,
    /// The $ATTMODE header variable.  Attribute visibility.
    pub attribute_visibility: AttributeVisibility,
    /// The $TEXTSIZE header variable.  Default text height.
    pub default_text_height: f64,
    /// The $TRACEWID header variable.  Default trace width.
    pub trace_width: f64,
    /// The $TEXTSTYLE header variable.  Current text style name.
    pub text_style: String,
    /// The $CLAYER header variable.  Current layer name.
    pub current_layer: String,
    /// The $CELTYPE header variable.  Entity line type name, or BYBLOCK or BYLAYER.
    pub current_entity_line_type: String,
    /// The $CECOLOR header variable.  Current entity color.
    pub current_entity_color: Color,
    /// The $CELTSCALE header variable.  Current entity line type scale.  Minimum AutoCAD version: R13.
    pub current_entity_line_type_scale: f64,
    /// The $DELOBJ header variable.  Controls object deletion.  Minimum AutoCAD version: R13.  Maximum AutoCAD version: R14.
    pub retain_deleted_objects: bool,
    /// The $DISPSILH header variable.  Controls the display of silhouette curves of body objects in wireframe mode.  Minimum AutoCAD version: R13.
    pub display_silhouette_curves_in_wireframe_mode: bool,
    /// The $DRAGVS header variable.  Hard-pointer to visual style when creating 3D solid primitives.  Minimum AutoCAD version: R2007.
    pub solid_visual_style_pointer: Handle,
    /// The $DIMSCALE header variable.  Overall dimensioning scale factor.
    pub dimensioning_scale_factor: f64,
    /// The $DIMASZ header variable.  Dimensioning arrow size.
    pub dimensioning_arrow_size: f64,
    /// The $DIMEXO header variable.  Extension line offset.
    pub dimension_extension_line_offset: f64,
    /// The $DIMDLI header variable.  Dimension line increment.
    pub dimension_line_increment: f64,
    /// The $DIMRND header variable.  Rounding value for dimension distances.
    pub dimension_distance_rounding_value: f64,
    /// The $DIMDLE header variable.  Dimension line extension.
    pub dimension_line_extension: f64,
    /// The $DIMEXE header variable.  Extension line extension.
    pub dimension_extension_line_extension: f64,
    /// The $DIMTP header variable.  Plus tolerance.
    pub dimension_plus_tolerance: f64,
    /// The $DIMTM header variable.  Minus tolerance.
    pub dimension_minus_tolerance: f64,
    /// The $DIMTXT header variable.  Dimensioning text height.
    pub dimensioning_text_height: f64,
    /// The $DIMCEN header variable.  Size of center mark/lines.
    pub center_mark_size: f64,
    /// The $DIMTSZ header variable.  Dimensioning tick size.
    pub dimensioning_tick_size: f64,
    /// The $DIMTOL header variable.  Dimension tolerances generated.
    pub generate_dimension_tolerances: bool,
    /// The $DIMLIM header variable.  Dimension limits generated.
    pub generate_dimension_limits: bool,
    /// The $DIMTIH header variable.  Text inside horizontal.
    pub dimension_text_inside_horizontal: bool,
    /// The $DIMTOH header variable.  Text outside horizontal.
    pub dimension_text_outside_horizontal: bool,
    /// The $DIMSE1 header variable.  Suppression of first extension line.  Minimum AutoCAD version: R12.
    pub suppress_first_dimension_extension_line: bool,
    /// The $DIMSE2 header variable.  Suppression of second extension line.  Minimum AutoCAD version: R12.
    pub suppress_second_dimension_extension_line: bool,
    /// The $DIMTAD header variable.  Text above dimension line.
    pub text_above_dimension_line: bool,
    /// The $DIMZIN header variable.  Controls suppression of zeros for primary unit values.
    pub dimension_unit_zero_suppression: UnitZeroSuppression,
    /// The $DIMBLK header variable.  Arrow block name.
    pub arrow_block_name: String,
    /// The $DIMASO header variable.  Controls associative dimensioning.
    pub create_associative_dimensioning: bool,
    /// The $DIMSHO header variable.  Recompute dimensions while dragging.
    pub recompute_dimensions_while_dragging: bool,
    /// The $DIMPOST header variable.  General dimensioning suffix.
    pub dimensioning_suffix: String,
    /// The $DIMAPOST header variable.  Alternate dimensioning suffix.
    pub alternate_dimensioning_suffix: String,
    /// The $DIMALT header variable.  Alternate unit dimensioning performed.
    pub use_alternate_dimensioning: bool,
    /// The $DIMALTD header variable.  Alternate unit decimal places.
    pub alternate_dimensioning_decimal_places: i16,
    /// The $DIMALTF header variable.  Alternate unit scale factor.
    pub alternate_dimensioning_scale_factor: f64,
    /// The $DIMLFAC header variable.  Linear measurements scale factor.
    pub dimension_linear_measurements_scale_factor: f64,
    /// The $DIMTOFL header variable.  If text is outside extensions, force line extensions between extensions.
    pub force_dimension_line_extensions_outside_if_text_is: bool,
    /// The $DIMTVP header variable.  Text vertical position.
    pub dimension_vertical_text_position: f64,
    /// The $DIMTIX header variable.  Force text inside extensions.
    pub force_dimension_text_inside_extensions: bool,
    /// The $DIMSOXD header variable.  Suppress outside-extensions dimension lines.
    pub suppress_outside_extension_dimension_lines: bool,
    /// The $DIMSAH header variable.  Use separate arrow blocks.
    pub use_separate_arrow_blocks_for_dimensions: bool,
    /// The $DIMBLK1 header variable.  First arrow block name.
    pub first_arrow_block_name: String,
    /// The $DIMBLK2 header variable.  Second arrow block name.
    pub second_arrow_block_name: String,
    /// The $DIMSTYLE header variable.  Dimension style name.
    pub dimension_style_name: String,
    /// The $DIMCLRD header variable.  Dimension line color.  Minimum AutoCAD version: R11.
    pub dimension_line_color: Color,
    /// The $DIMCLRE header variable.  Dimension extension line color.  Minimum AutoCAD version: R11.
    pub dimension_extension_line_color: Color,
    /// The $DIMCLRT header variable.  Dimension text color.  Minimum AutoCAD version: R11.
    pub dimension_text_color: Color,
    /// The $DIMTFAC header variable.  Dimension tolerance display factor.  Minimum AutoCAD version: R12.
    pub dimension_tolerance_display_scale_factor: f64,
    /// The $DIMGAP header variable.  Dimension line gap.  Minimum AutoCAD version: R11.
    pub dimension_line_gap: f64,
    /// The $DIMJUST header variable.  Horizontal dimension text position.  Minimum AutoCAD version: R13.
    pub dimension_text_justification: DimensionTextJustification,
    /// The $DIMTOLJ header variable.  Vertical justification for tolerance values.  Minimum AutoCAD version: R13.
    pub dimension_tolerance_vertical_justification: Justification,
    /// The $DIMTZIN header variable.  Controls suppression of zeros for tolerance values.  Minimum AutoCAD version: R13.
    pub dimension_tolerance_zero_suppression: UnitZeroSuppression,
    /// The $DIMALTZ header variable.  Controls suppression of zeros for alternate unit dimension values.  Minimum AutoCAD version: R13.
    pub alternate_dimensioning_zero_supression: UnitZeroSuppression,
    /// The $DIMALTTZ header variable.  Controls suppression of zeros for alternate tolerance values.  Minimum AutoCAD version: R13.
    pub alternate_dimensioning_tolerance_zero_supression: UnitZeroSuppression,
    /// The $DIMFIT header variable.  Placement of text and arrowheads.  Minimum AutoCAD version: R13.  Maximum AutoCAD version: R14.
    pub dimension_text_and_arrow_placement: DimensionFit,
    /// The $DIMUPT header variable.  Cursor functionality for user-positioned text.  Minimum AutoCAD version: R13.
    pub dimension_cursor_controls_text_position: bool,
    /// The $DIMUNIT header variable.  Units format for all dimension style family members except angular.  Minimum AutoCAD version: R13.  Maximum AutoCAD version: R14.
    pub dimension_unit_format: UnitFormat,
    /// The $DIMDEC header variable.  Number of decimal places for the tolerance values of a primary units dimension.  Minimum AutoCAD version: R13.
    pub dimension_unit_tolerance_decimal_places: i16,
    /// The $DIMTDEC header variable.  Number of decimal places to display the tolerance values.  Minimum AutoCAD version: R13.
    pub dimension_tolerance_decimal_places: i16,
    /// The $DIMALTU header variable.  Units format for alternate units of all dimension style family members except angular.  Minimum AutoCAD version: R13.
    pub alternate_dimensioning_units: UnitFormat,
    /// The $DIMALTTD header variable.  Number of decimal places for tolerance values of an alternate units dimension.  Minimum AutoCAD version: R13.
    pub alternate_dimensioning_tolerance_decimal_places: i16,
    /// The $DIMTXSTY header variable.  Dimension text style.  Minimum AutoCAD version: R13.
    pub dimension_text_style: String,
    /// The $DIMAUNIT header variable.  Angle format for angular dimensions.  Minimum AutoCAD version: R13.
    pub dimensioning_angle_format: AngleFormat,
    /// The $DIMADEC header variable.  Number of precision places displayed in angular dimensions.  Minimum AutoCAD version: R2000.
    pub angular_dimension_precision: i16,
    /// The $DIMALTRND header variable.  Determines rounding of alternate units.  Minimum AutoCAD version: R2000.
    pub alternate_dimensioning_unit_rounding: f64,
    /// The $DIMAZIN header variable.  Controls suppression of zeros for angular dimensions.  Minimum AutoCAD version: R2000.
    pub dimension_angle_zero_suppression: UnitZeroSuppression,
    /// The $DIMDSEP header variable.  Single-character decimal separator used when creating dimensions whose unit format is decimal.  Minimum AutoCAD version: R2000.
    pub dimension_decimal_separator_char: char,
    /// The $DIMFRAC header variable.  Sets the fraction format when DIMLUNIT is set to Architectural or Fractional.  Minimum AutoCAD version: R2000.
    pub dimension_text_height_scale_factor: DimensionFractionFormat,
    /// The $DIMLDRBLK header variable.  Arrow block name for leaders.  Minimum AutoCAD version: R2000.
    pub dimension_leader_block_name: String,
    /// The $DIMLUNIT header variable.  Sets units for all dimension types except angular.  Minimum AutoCAD version: R2000.
    pub dimension_non_angular_units: NonAngularUnits,
    /// The $DIMLWD header variable.  Dimension line lineweight.  Minimum AutoCAD version: R2000.
    pub dimension_line_weight: LineWeight,
    /// The $DIMLWE header variable.  Extension line lineweight.  Minimum AutoCAD version: R2000.
    pub dimension_extension_line_weight: LineWeight,
    /// The $DIMTMOVE header variable.  Dimension text movement rules.  Minimum AutoCAD version: R2000.
    pub dimension_text_movement_rule: DimensionTextMovementRule,
    /// The $DIMFXL header variable.  Sets the total length of the extension lines starting from the dimension line toward the dimension origin.  Minimum AutoCAD version: R2007.
    pub dimension_line_fixed_length: f64,
    /// The $DIMFXLON header variable.  Controls whether extension lines are set to a fixed length.  Minimum AutoCAD version: R2007.
    pub dimension_line_fixed_length_on: bool,
    /// The $DIMJOGANG header variable.  Determines the angle of the transverse segment of the dimension line in a jogged radius dimension.  Minimum AutoCAD version: R2007.
    pub dimension_transverse_segment_angle_in_jogged_radius: f64,
    /// The $DIMTFILL header variable.  Controls the background of dimension text.  Minimum AutoCAD version: R2007.
    pub dimension_text_background_color_mode: DimensionTextBackgroundColorMode,
    /// The $DIMTFILLCLR header variable.  Sets the color for the text background in dimensions.  Minimum AutoCAD version: R2007.
    pub dxf_dimension_text_background_custom_color: Color,
    /// The $DIMARCSYM header variable.  Controls the display of the arc symbol in an arc length dimension.  Minimum AutoCAD version: R2007.
    pub dimension_arc_symbol_display_mode: DimensionArcSymbolDisplayMode,
    /// The $DIMLTYPE header variable.  Sets the line type of the dimension line.  Minimum AutoCAD version: R2007.
    pub dimension_line_type: String,
    /// The $DIMLTEX1 header variable.  Sets the line type of the first extension line.  Minimum AutoCAD version: R2007.
    pub dimension_first_extension_line_type: String,
    /// The $DIMLTEX2 header variable.  Sets the line type of the second extension line.  Minimum AutoCAD version: R2007.
    pub dimension_second_extension_line_type: String,
    /// The $DIMTXTDIRECTION header variable.  Specifies the reading direction of the dimension text.  Minimum AutoCAD version: R2010.
    pub dimension_text_direction: TextDirection,
    /// The $LUNITS header variable.  Units format for coordinates and distances.
    pub unit_format: UnitFormat,
    /// The $LUPREC header variable.  Units precision for coordinates and distances.
    pub unit_precision: i16,
    /// The $SKETCHINC header variable.  Sketch record increment.
    pub sketch_record_increment: f64,
    /// The $FILLETRAD header variable.  Fillet radius.
    pub fillet_radius: f64,
    /// The $AUNITS header variable.  Units format for angles.
    pub angle_unit_format: AngleFormat,
    /// The $AUPREC header variable.  Units precision for angles.
    pub angle_unit_precision: i16,
    /// The $MENU header variable.  Name of menu file.
    pub file_name: String,
    /// The $ELEVATION header variable.  Current elevation set by ELEV command.
    pub elevation: f64,
    /// The $PELEVATION header variable.  Current paper space elevation.  Minimum AutoCAD version: R11.
    pub paperspace_elevation: f64,
    /// The $THICKNESS header variable.  Current thickness set by ELEV command.
    pub thickness: f64,
    /// The $LIMCHECK header variable.  Limits checking.
    pub use_limits_checking: bool,
    /// The $BLIPMODE header variable.  Display blips for click locations.  Maximum AutoCAD version: R14.
    pub blip_mode: bool,
    /// The $CHAMFERA header variable.  First chamfer distance.
    pub first_chamfer_distance: f64,
    /// The $CHAMFERB header variable.  Second chamfer distance.
    pub second_chamfer_distance: f64,
    /// The $CHAMFERC header variable.  Chamfer length.  Minimum AutoCAD version: R14.
    pub chamfer_length: f64,
    /// The $CHAMFERD header variable.  Chamfer angle.  Minimum AutoCAD version: R14.
    pub chamfer_angle: f64,
    /// The $SKPOLY header variable.  Controls polyline sketch mode.
    pub polyline_sketch_mode: PolySketchMode,
    /// The $TDCREATE header variable.  Local date/time of drawing creation.
    pub creation_date: DateTime<Local>,
    /// The $TDUCREATE header variable.  Universal date/time the drawing was created.  Minimum AutoCAD version: R2000.
    pub creation_date_universal: DateTime<Utc>,
    /// The $TDUPDATE header variable.  Local date/time of last drawing update.
    pub update_date: DateTime<Local>,
    /// The $TDUUPDATE header variable.  Universal date/time of the last update/save.  Minimum AutoCAD version: R2000.
    pub update_date_universal: DateTime<Utc>,
    /// The $TDINDWG header variable.  Cumulative editing time for this drawing.
    pub time_in_drawing: Duration,
    /// The $TDUSRTIMER header variable.  User-elapsed timer.
    pub user_elapsed_timer: Duration,
    /// The $USRTIMER header variable.  User timer on.
    pub user_timer_on: bool,
    /// The $ANGBASE header variable.  Angle 0 direction.
    pub angle_zero_direction: f64,
    /// The $ANGDIR header variable.  Angle directions.
    pub angle_direction: AngleDirection,
    /// The $PDMODE header variable.  Point display mode.
    pub point_display_mode: i32,
    /// The $PDSIZE header variable.  Point display size.
    pub point_display_size: f64,
    /// The $PLINEWID header variable.  Default polyline width.
    pub default_polyline_width: f64,
    /// The $COORDS header variable.  Controls the display of coordinates.  Maximum AutoCAD version: R14.
    pub coordinate_display: CoordinateDisplay,
    /// The $SPLFRAME header variable.  Controls the display of helixes and smoothed mesh objects.  Maximum AutoCAD version: R2013.
    pub display_spline_polygon_control: bool,
    /// The $SPLINETYPE header variable.  Spline curve type for PEDIT Spline.
    pub pedit_spline_curve_type: PolylineCurvedAndSmoothSurfaceType,
    /// The $SPLINESEGS header variable.  Number of line segments per spline hatch.
    pub line_segments_per_spline_patch: i16,
    /// The $ATTDIA header variable.  Controls whether the INSERT command uses a dialog box for attribute value entry.  Maximum AutoCAD version: R14.
    pub show_attribute_entry_dialogs: bool,
    /// The $ATTREQ header variable.  Controls whether INSERT uses default attribute settings during insertion of blocks.  Maximum AutoCAD version: R14.
    pub prompt_for_attribute_on_insert: bool,
    /// The $HANDLING header variable.  Handles available.  Maximum AutoCAD version: R12.
    pub handles_enabled: bool,
    /// The $HANDSEED header variable.  Next available handle.
    pub next_available_handle: Handle,
    /// The $SURFTAB1 header variable.  Number of mesh tabulations in first direction.
    pub mesh_tabulations_in_first_direction: i16,
    /// The $SURFTAB2 header variable.  Number of mesh tabulations in second direction.
    pub mesh_tabulations_in_second_direction: i16,
    /// The $SURFTYPE header variable.  Surface type for PEDIT Smooth.
    pub pedit_smooth_surface_type: PolylineCurvedAndSmoothSurfaceType,
    /// The $SURFU header variable.  Surface density (for PEDIT Smooth) in M direction.
    pub pedit_smooth_m_densith: i16,
    /// The $SURFV header variable.  Surface density (for PEDIT Smooth) in N direction.
    pub pedit_smooth_n_densith: i16,
    /// The $UCSBASE header variable.  Name of the UCS that defines the origin and orientation of orthographic UCS settings.  Minimum AutoCAD version: R2000.
    pub ucs_definition_name: String,
    /// The $UCSNAME header variable.  Name of current UCS.
    pub ucs_name: String,
    /// The $UCSORG header variable.  Origin of current UCS (in WCS).
    pub ucs_origin: Point,
    /// The $UCSXDIR header variable.  Direction of the current UCS X axis (in WCS).
    pub ucs_x_axis: Vector,
    /// The $UCSYDIR header variable.  Direction of the current UCS Y axis (in WCS).
    pub ucs_y_axis: Vector,
    /// The $UCSORTHOREF header variable.  If model space UCS is orthographic (UCSORTHOVIEW not equal to 0), this is the name of the UCS that the orthographic UCS is relative to. If blank, UCS is relative to WORLD.  Minimum AutoCAD version: R2000.
    pub ortho_ucs_reference: String,
    /// The $UCSORTHOVIEW header variable.  Orthographic view type of model space UCS.  Minimum AutoCAD version: R2000.
    pub orthgraphic_view_type: OrthographicViewType,
    /// The $UCSORGTOP header variable.  Point which becomes the new UCS origin after changing model space UCS to TOP when UCSBASE is set to WORLD.  Minimum AutoCAD version: R2000.
    pub ucs_origin_top: Point,
    /// The $UCSORGBOTTOM header variable.  Point which becomes the new UCS origin after changing model space UCS to BOTTOM when UCSBASE is set to WORLD.  Minimum AutoCAD version: R2000.
    pub ucs_origin_bottom: Point,
    /// The $UCSORGLEFT header variable.  Point which becomes the new UCS origin after changing model space UCS to LEFT when UCSBASE is set to WORLD.  Minimum AutoCAD version: R2000.
    pub ucs_origin_left: Point,
    /// The $UCSORGRIGHT header variable.  Point which becomes the new UCS origin after changing model space UCS to RIGHT when UCSBASE is set to WORLD.  Minimum AutoCAD version: R2000.
    pub ucs_origin_right: Point,
    /// The $UCSORGFRONT header variable.  Point which becomes the new UCS origin after changing model space UCS to FRONT when UCSBASE is set to WORLD.  Minimum AutoCAD version: R2000.
    pub ucs_origin_front: Point,
    /// The $UCSORGBACK header variable.  Point which becomes the new UCS origin after changing model space UCS to BACK when UCSBASE is set to WORLD.  Minimum AutoCAD version: R2000.
    pub ucs_origin_back: Point,
    /// The $PUCSBASE header variable.  Name of the UCS that defines the origin and orientation of orthographics UCS settings (paper space only).  Minimum AutoCAD version: R2000.
    pub paperspace_ucs_definition_name: String,
    /// The $PUCSNAME header variable.  Current paper space UCS name.  Minimum AutoCAD version: R11.
    pub paperspace_ucs_name: String,
    /// The $PUCSORG header variable.  Current paper space UCS origin.  Minimum AutoCAD version: R11.
    pub paperspace_ucs_origin: Point,
    /// The $PUCSXDIR header variable.  Current paper space UCS X axis.  Minimum AutoCAD version: R11.
    pub paperspace_x_axis: Vector,
    /// The $PUCSYDIR header variable.  Current paper space UCS Y axis.  Minimum AutoCAD version: R11.
    pub paperspace_y_axis: Vector,
    /// The $PUCSORTHOREF header variable.  If paper space UCS is orthographic (PUCSORTHOVIEW not equal to 0), this is the name of the UCS that the orthographic UCS is relative to. If blank, UCS is relative to WORLD.  Minimum AutoCAD version: R2000.
    pub paperspace_ortho_ucs_reference: String,
    /// The $PUCSORTHOVIEW header variable.  Orthographic view type of paper space UCS.  Minimum AutoCAD version: R2000.
    pub paperspace_orthographic_view_type: OrthographicViewType,
    /// The $PUCSORGTOP header variable.  Point which becomes the new UCS origin after changing paper space UCS to TOP when PUCSBASE is set to WORLD.  Minimum AutoCAD version: R2000.
    pub paperspace_ucs_origin_top: Point,
    /// The $PUCSORGBOTTOM header variable.  Point which becomes the new UCS origin after changing paper space UCS to BOTTOM when PUCSBASE is set to WORLD.  Minimum AutoCAD version: R2000.
    pub paperspace_ucs_origin_bottom: Point,
    /// The $PUCSORGLEFT header variable.  Point which becomes the new UCS origin after changing paper space UCS to LEFT when PUCSBASE is set to WORLD.  Minimum AutoCAD version: R2000.
    pub paperspace_ucs_origin_left: Point,
    /// The $PUCSORGRIGHT header variable.  Point which becomes the new UCS origin after changing paper space UCS to RIGHT when PUCSBASE is set to WORLD.  Minimum AutoCAD version: R2000.
    pub paperspace_ucs_origin_right: Point,
    /// The $PUCSORGFRONT header variable.  Point which becomes the new UCS origin after changing paper space UCS to FRONT when PUCSBASE is set to WORLD.  Minimum AutoCAD version: R2000.
    pub paperspace_ucs_origin_front: Point,
    /// The $PUCSORGBACK header variable.  Point which becomes the new UCS origin after changing paper space UCS to BACK when PUCSBASE is set to WORLD.  Minimum AutoCAD version: R2000.
    pub paperspace_ucs_origin_back: Point,
    /// The $USERI1 header variable.  Integer variable intended for use by third-party developers.
    pub user_int1: i16,
    /// The $USERI2 header variable.  Integer variable intended for use by third-party developers.
    pub user_int2: i16,
    /// The $USERI3 header variable.  Integer variable intended for use by third-party developers.
    pub user_int3: i16,
    /// The $USERI4 header variable.  Integer variable intended for use by third-party developers.
    pub user_int4: i16,
    /// The $USERI5 header variable.  Integer variable intended for use by third-party developers.
    pub user_int5: i16,
    /// The $USERR1 header variable.  Real variable indented for use by third-party developers.
    pub user_real1: f64,
    /// The $USERR2 header variable.  Real variable indented for use by third-party developers.
    pub user_real2: f64,
    /// The $USERR3 header variable.  Real variable indented for use by third-party developers.
    pub user_real3: f64,
    /// The $USERR4 header variable.  Real variable indented for use by third-party developers.
    pub user_real4: f64,
    /// The $USERR5 header variable.  Real variable indented for use by third-party developers.
    pub user_real5: f64,
    /// The $WORLDVIEW header variable.  Set UCS to WCS during DVIEW/VPOINT.
    pub set_ucs_to_wcs_in_d_view_or_v_point: bool,
    /// The $SHADEDGE header variable.  Controls shading of faces.  Minimum AutoCAD version: R11.
    pub edge_shading: ShadeEdgeMode,
    /// The $SHADEDIF header variable.  Percent ambient/diffuse light; range 1-100.  Minimum AutoCAD version: R11.
    pub percent_ambient_to_diffuse: i16,
    /// The $TILEMODE header variable.  Use previous release compatibility mode.  Minimum AutoCAD version: R11.
    pub previous_release_tile_compatability: bool,
    /// The $MAXACTVP header variable.  Sets the maximum number of viewports to be regenerated.  Minimum AutoCAD version: R11.
    pub maximum_active_viewports: i16,
    /// The $PINSBASE header variable.  Paper space insertion base point.  Minimum AutoCAD version: R14.
    pub paperspace_insertion_base: Point,
    /// The $PLIMCHECK header variable.  Limits checking in paper space.  Minimum AutoCAD version: R11.
    pub limit_checking_in_paperspace: bool,
    /// The $PEXTMIN header variable.  Minimum X, Y, and Z extents for paper space.  Minimum AutoCAD version: R11.
    pub paperspace_minimum_drawing_extents: Point,
    /// The $PEXTMAX header variable.  Maximum X, Y, and Z extents for paper space.  Minimum AutoCAD version: R11.
    pub paperspace_maximum_drawing_extents: Point,
    /// The $PLIMMIN header variable.  Minimum X and Y limits in paper space.  Minimum AutoCAD version: R11.
    pub paperspace_minimum_drawing_limits: Point,
    /// The $PLIMMAX header variable.  Maximum X and Y limits in paper space.  Minimum AutoCAD version: R11.
    pub paperspace_maximum_drawing_limits: Point,
    /// The $UNITMODE header variable.  Display fractions, feet-and-inches, and surveyor's angles in input format.  Minimum AutoCAD version: R11.
    pub display_fractions_in_input: bool,
    /// The $VISRETAIN header variable.  Retain xref-dependent visibility settings.  Minimum AutoCAD version: R12.
    pub retain_x_ref_dependent_visibility_settings: bool,
    /// The $PLINEGEN header variable.  Governs the generation of line type patterns around the vertices of a 2D polyline.  Minimum AutoCAD version: R11.
    pub is_polyline_continuous_around_verticies: bool,
    /// The $PSLTSCALE header variable.  Controls paper space line type scaling.  Minimum AutoCAD version: R11.
    pub scale_line_types_in_paperspace: bool,
    /// The $TREEDEPTH header variable.  Specifies the maximum depth of the spatial index.  Minimum AutoCAD version: R14.
    pub spacial_index_max_depth: i16,
    /// The $PICKSTYLE header variable.  Controls the group selection and associative hatch selection.  Minimum AutoCAD version: R13.  Maximum AutoCAD version: R14.
    pub pick_style: PickStyle,
    /// The $CMLSTYLE header variable.  Current multiline style name.  Minimum AutoCAD version: R13.  Maximum AutoCAD version: R13.
    pub current_multiline_style: String,
    /// The $CMLJUST header variable.  Current multiline justification.  Minimum AutoCAD version: R13.
    pub current_multiline_justification: Justification,
    /// The $CMLSCALE header variable.  Current multiline scale.  Minimum AutoCAD version: R13.
    pub current_multiline_scale: f64,
    /// The $PROXYGRAPHICS header variable.  Controls the saving of proxy object images.  Minimum AutoCAD version: R14.
    pub save_proxy_graphics: bool,
    /// The $MEASUREMENT header variable.  Sets drawing units.  Minimum AutoCAD version: R14.
    pub drawing_units: DrawingUnits,
    /// The $CELWEIGHT header variable.  Lineweight of new objects.  Minimum AutoCAD version: R2000.
    pub new_object_line_weight: LineWeight,
    /// The $ENDCAPS header variable.  Lineweight endcaps setting for new objects.  Minimum AutoCAD version: R2000.
    pub end_cap_setting: EndCapSetting,
    /// The $JOINSTYLE header variable.  Lineweight join setting for new objects.  Minimum AutoCAD version: R2000.
    pub lineweight_joint_setting: JoinStyle,
    /// The $LWDISPLAY header variable.  Controls the display of lineweights on the Model or Layout tab.  Minimum AutoCAD version: R2000.
    pub display_linewieght_in_model_and_layout_tab: bool,
    /// The $INSUNITS header variable.  Default drawing units for AutoCAD DesignCenter blocks.  Minimum AutoCAD version: R2000.
    pub default_drawing_units: Units,
    /// The $HYPERLINKBASE header variable.  Path for all relative hyperlinks in the drawing.  If null, the drawing path is used.  Minimum AutoCAD version: R2000.
    pub hyperlink_base: String,
    /// The $STYLESHEET header variable.  Path to the stylesheet for the drawing.  Minimum AutoCAD version: R2000.
    pub stylesheet: String,
    /// The $XEDIT header variable.  Controls whether the current drawing can be edited in-place when being referenced by another drawing.  Minimum AutoCAD version: R2000.
    pub can_use_in_place_reference_editing: bool,
    /// The $CEPSNID header variable.  PlotStyle handle of new objects.  Minimum AutoCAD version: R2000.
    pub new_object_plot_style_handle: Handle,
    /// The $CEPSNTYPE header variable.  Plot style of new objects.  Minimum AutoCAD version: R2000.
    pub new_object_plot_style: PlotStyle,
    /// The $PSTYLEMODE header variable.  Indicates whether the current drawing is in a Color-Dependent or Named Plot Style mode.  Minimum AutoCAD version: R2000.
    pub uses_color_dependent_plot_style_tables: bool,
    /// The $FINGERPRINTGUID header variable.  Set at creation time, uniquely identifies a particular drawing.  Minimum AutoCAD version: R2000.
    pub fingerprint_guid: Uuid,
    /// The $VERSIONGUID header variable.  Uniquely identifies a particular version of a drawing.  Updated when the drawing is modified.  Minimum AutoCAD version: R2000.
    pub version_guid: Uuid,
    /// The $EXTNAMES header variable.  Controls symbol table naming.  Minimum AutoCAD version: R2000.
    pub use_acad2000_symbol_table_naming: bool,
    /// The $PSVPSCALE header variable.  View scale factor for new viewports.  Minimum AutoCAD version: R2000.
    pub viewport_view_scale_factor: f64,
    /// The $OLESTARTUP header variable.  Controls whether the source application of an embedded OLE object loads when plotting.  Minimum AutoCAD version: R2000.
    pub ole_startup: bool,
    /// The $SORTENTS header variable.  Controls the object sorting methods; accessible from the Options dialog box User Preferences tab.  Minimum AutoCAD version: R2004.
    pub object_sorting_methods_flags: i32,
    /// The $INDEXCTL header variable.  Controls whether layer and spatial indexes are created and saved in drawing files.  Minimum AutoCAD version: R2004.
    pub layer_and_spatial_index_save_mode: LayerAndSpatialIndexSaveMode,
    /// The $HIDETEXT header variable.  Ignore text objects.  Minimum AutoCAD version: R2004.
    pub hide_text_objects_when_producint_hidden_view: bool,
    /// The $XCLIPFRAME header variable.  Controls the visibility of xref clipping boundaries.  Minimum AutoCAD version: R2004.  Maximum AutoCAD version: R2007.
    pub is_x_ref_clipping_boundary_visible: XrefClippingBoundaryVisibility,
    /// The $HALOGAP header variable.  Specifies a gap to be displayed where an object is hidden by another object; the value is specified as a percent of one unit and is independent of the zoom level.  A haloed line is shortened at the point where it is hidden when HIDE or the Hidden option of SHADEMODE is used.  Minimum AutoCAD version: R2004.
    pub halo_gap_percent: f64,
    /// The $OBSCOLOR header variable.  Specifies the color of obscured lines.  An obscured line is a hidden line made visible by changing its color and line type and is visible only when the HIDE or SHADEMODE command is used.  The OBSCUREDCOLOR setting is visible only if the OBSCUREDLTYPE is turned ON by setting it to a value other than 0.  Minimum AutoCAD version: R2004.
    pub obscured_line_color: Color,
    /// The $OBSLTYPE header variable.  Specifies the line type of obscured lines.  Obscured line types are independent of zoom level, unlike regular AutoCAD line types.  Value 0 turns off display of obscured lines and is the default.  Minimum AutoCAD version: R2004.
    pub obscured_line_type_style: LineTypeStyle,
    /// The $INTERSECTIONDISPLAY header variable.  Specifies the display of intersection polylines.  Minimum AutoCAD version: R2004.
    pub display_intersection_polylines: bool,
    /// The $INTERSECTIONCOLOR header variable.  Specifies the entity color of intersection polylines.  Minimum AutoCAD version: R2004.
    pub intersection_polyline_color: Color,
    /// The $DIMASSOC header variable.  Controls the associativity of dimension objects.  Minimum AutoCAD version: R2004.
    pub dimension_object_associativity: DimensionAssociativity,
    /// The $PROJECTNAME header variable.  Assigns a project name to the current drawing.  Used when an external reference or image is not found on its original path.  The project name points to a section in the registry that can contain one or more search paths for each project name defined.  Project names and their search directories are created from the Files tab of the Options dialog box.  Minimum AutoCAD version: R2004.
    pub project_name: String,
    /// The $CAMERADISPLAY header variable.  Turns the display of camera objects on or off.  Minimum AutoCAD version: R2007.
    pub use_camera_display: bool,
    /// The $LENSLENGTH header variable.  Stores the length of the lens in millimeters used in perspective viewing.  Minimum AutoCAD version: R2007.
    pub lens_length: f64,
    /// The $CAMERAHEIGHT header variable.  Specifies the default height for new camera objects.  Minimum AutoCAD version: R2007.
    pub camera_height: f64,
    /// The $STEPSPERSEC header variable.  Specifies the number of steps taken per second when you are in walk or fly mode.  Minimum AutoCAD version: R2007.
    pub steps_per_second_in_walk_or_fly_mode: f64,
    /// The $STEPSIZE header variable.  Specifies the size of each step when in walk or fly mode, in drawing units.  Minimum AutoCAD version: R2007.
    pub step_size_in_walk_or_fly_mode: f64,
    /// The $3DDWFPREC header variable.  Controls the precision of 3D DWF or 3D DWFx publishing.  Minimum AutoCAD version: R2007.
    pub dwf_3d_precision: Dwf3DPrecision,
    /// The $PSOLWIDTH header variable.  Controls the default width for a swept solid object created with the POLYSOLID command.  Minimum AutoCAD version: R2007.
    pub last_poly_solid_width: f64,
    /// The $PSOLHEIGHT header variable.  Controls the default height for a swept solid object created with the POLYSOLID command.  Minimum AutoCAD version: R2007.
    pub last_poly_solid_height: f64,
    /// The $LOFTANG1 header variable.  Sets the draft angle through the first cross section in a loft operation.  Minimum AutoCAD version: R2007.
    pub loft_operation_first_draft_angle: f64,
    /// The $LOFTANG2 header variable.  Sets the draft angle through the second cross section in a loft operation.  Minimum AutoCAD version: R2007.
    pub loft_operation_second_draft_angle: f64,
    /// The $LOFTMAG1 header variable.  Sets the magnitude of the draft angle through the first cross section in a loft operation.  Minimum AutoCAD version: R2007.
    pub loft_operation_first_magnitude: f64,
    /// The $LOFTMAG2 header variable.  Sets the magnitude of the draft angle through the second cross section in a loft operation.  Minimum AutoCAD version: R2007.
    pub loft_operation_second_magnitude: f64,
    /// The $LOFTPARAM header variable.  Controls the shape of lofted solids and surfaces.  Minimum AutoCAD version: R2007.
    pub loft_flags: i32,
    /// The $LOFTNORMALS header variable.  Controls the normals of a lofted object where it passes through cross sections.  Minimum AutoCAD version: R2007.
    pub lofted_object_normal_mode: LoftedObjectNormalMode,
    /// The $LATITUDE header variable.  The latitude of the geographic location assigned to the drawing.  Minimum AutoCAD version: R2007.
    pub latitude: f64,
    /// The $LONGITUDE header variable.  The longitude of the geographic location assigned to the drawing.  Minimum AutoCAD version: R2007.
    pub longitude: f64,
    /// The $NORTHDIRECTION header variable.  Specifies the angle between the Y axis of WCS and the grid north.  Minimum AutoCAD version: R2007.
    pub angle_between_y_axis_and_north: f64,
    /// The $TIMEZONE header variable.  Sets the time zone for the sun in the drawing.  Minimum AutoCAD version: R2007.
    pub time_zone: DrawingTimeZone,
    /// The $LIGHTGLYPHDISPLAY header variable.  Turns on and off the display of light glyphs.  Minimum AutoCAD version: R2007.
    pub use_light_glyph_display: bool,
    /// The $TILEMODELIGHTSYNCH header variable.  Unknown.  Minimum AutoCAD version: R2007.
    pub use_tile_mode_light_sync: bool,
    /// The $CMATERIAL header variable.  Sets the material of new objects.  Minimum AutoCAD version: R2007.
    pub current_material_handle: Handle,
    /// The $SOLIDHIST header variable.  Controls whether new composite solids retain a history of their original components.  Minimum AutoCAD version: R2007.
    pub new_solids_contain_history: bool,
    /// The $SHOWHIST header variable.  Controls the Show History property for solids in a drawing.  Minimum AutoCAD version: R2007.
    pub solid_history_mode: SolidHistoryMode,
    /// The $DWFFRAME header variable.  Determines whether DWF or DWFx underlay frames are visible or plotted in the current drawing.  Minimum AutoCAD version: R2007.
    pub dwf_underlay_frame_mode: UnderlayFrameMode,
    /// The $DGNFRAME header variable.  Determines whether DGN underlay frames are visible or plotted in the current drawing.  Minimum AutoCAD version: R2007.
    pub dgn_underlay_frame_mode: UnderlayFrameMode,
    /// The $REALWORLDSCALE header variable.  Drawing is scaled to the real world.  Minimum AutoCAD version: R2007.
    pub use_real_world_scale: bool,
    /// The $INTERFERECOLOR header variable.  Represents the ACI color index of the "interference objects" created during the interfere command.  Minimum AutoCAD version: R2007.
    pub interference_object_color: Color,
    /// The $INTERFEREOBJVS header variable.  Hard-pointer ID to the visual stype for interference objects.  Minimum AutoCAD version: R2007.
    pub interference_object_visual_style_pointer: Handle,
    /// The $INTERFEREVPVS header variable.  Hard-pointer ID to the visual styoe for the viewport during interference checking.  Minimum AutoCAD version: R2007.
    pub interference_view_port_visual_style_pointer: Handle,
    /// The $CSHADOW header variable.  Shadow mode for a 3D object.  Minimum AutoCAD version: R2007.
    pub shadow_mode: ShadowMode,
    /// The $SHADOWPLANELOCATION header variable.  Location of the ground shadow plane.  This is a Z axis ordinate.  Minimum AutoCAD version: R2007.
    pub shadow_plane_z_offset: f64,
    /// The $AXISMODE header variable.  Axis on.  Maximum AutoCAD version: R10.
    pub axis_on: bool,
    /// The $AXISUNIT header variable.  Axis X and Y tick spacing.  Maximum AutoCAD version: R10.
    pub axis_tick_spacing: Vector,
    /// The $FASTZOOM header variable.  Fast zoom enabled.  Maximum AutoCAD version: R10.
    pub fast_zoom: bool,
    /// The $GRIDMODE header variable.  Grid mode on.  Maximum AutoCAD version: R10.
    pub grid_on: bool,
    /// The $GRIDUNIT header variable.  Grid X and Y spacing.  Maximum AutoCAD version: R10.
    pub grid_spacing: Vector,
    /// The $SNAPANG header variable.  Snap grid rotation angle.  Maximum AutoCAD version: R10.
    pub snap_rotation_angle: f64,
    /// The $SNAPBASE header variable.  Snap/grid/base point (in UCS).  Maximum AutoCAD version: R10.
    pub snap_base_point: Point,
    /// The $SNAPISOPAIR header variable.  Isometric plane.  Maximum AutoCAD version: R10.
    pub snap_isometric_plane: SnapIsometricPlane,
    /// The $SNAPMODE header variable.  Snap mode on.  Maximum AutoCAD version: R10.
    pub snap_on: bool,
    /// The $SNAPSTYLE header variable.  Snap style.  Maximum AutoCAD version: R10.
    pub snap_style: SnapStyle,
    /// The $SNAPUNIT header variable.  Snap grid X and Y spacing.  Maximum AutoCAD version: R10.
    pub snap_spacing: Vector,
    /// The $VIEWCTR header variable.  XY center of current view on screen.  Maximum AutoCAD version: R10.
    pub view_center: Point,
    /// The $VIEWDIR header variable.  Viewing direction (direction from target in WCS).  Maximum AutoCAD version: R10.
    pub view_direction: Vector,
    /// The $VIEWSIZE header variable.  Height of view.  Maximum AutoCAD version: R10.
    pub view_height: f64,
}

impl Default for Header {
    fn default() -> Self {
        Header {
            version: AcadVersion::R12, // $ACADVER
            maintenance_version: 0, // $ACADMAINTVER
            drawing_code_page: String::from("ANSI_1252"), // $DWGCODEPAGE
            last_saved_by: String::new(), // $LASTSAVEDBY
            required_versions: 0, // $REQUIREDVERSIONS
            insertion_base: Point::origin(), // $INSBASE
            minimum_drawing_extents: Point::origin(), // $EXTMIN
            maximum_drawing_extents: Point::origin(), // $EXTMAX
            minimum_drawing_limits: Point::origin(), // $LIMMIN
            maximum_drawing_limits: Point::new(12.0, 9.0, 0.0), // $LIMMAX
            draw_orthogonal_lines: false, // $ORTHOMODE
            use_regen_mode: true, // $REGENMODE
            fill_mode_on: true, // $FILLMODE
            use_quick_text_mode: false, // $QTEXTMODE
            mirror_text: false, // $MIRRTEXT
            drag_mode: DragMode::Auto, // $DRAGMODE
            line_type_scale: 1.0, // $LTSCALE
            object_snap_flags: 37, // $OSMODE
            attribute_visibility: AttributeVisibility::Normal, // $ATTMODE
            default_text_height: 0.2, // $TEXTSIZE
            trace_width: 0.05, // $TRACEWID
            text_style: String::from("STANDARD"), // $TEXTSTYLE
            current_layer: String::from("0"), // $CLAYER
            current_entity_line_type: String::from("BYLAYER"), // $CELTYPE
            current_entity_color: Color::by_layer(), // $CECOLOR
            current_entity_line_type_scale: 1.0, // $CELTSCALE
            retain_deleted_objects: true, // $DELOBJ
            display_silhouette_curves_in_wireframe_mode: false, // $DISPSILH
            solid_visual_style_pointer: Handle::empty(), // $DRAGVS
            dimensioning_scale_factor: 1.0, // $DIMSCALE
            dimensioning_arrow_size: 0.18, // $DIMASZ
            dimension_extension_line_offset: 0.0625, // $DIMEXO
            dimension_line_increment: 0.38, // $DIMDLI
            dimension_distance_rounding_value: 0.0, // $DIMRND
            dimension_line_extension: 0.0, // $DIMDLE
            dimension_extension_line_extension: 0.18, // $DIMEXE
            dimension_plus_tolerance: 0.0, // $DIMTP
            dimension_minus_tolerance: 0.0, // $DIMTM
            dimensioning_text_height: 0.18, // $DIMTXT
            center_mark_size: 0.09, // $DIMCEN
            dimensioning_tick_size: 0.0, // $DIMTSZ
            generate_dimension_tolerances: false, // $DIMTOL
            generate_dimension_limits: false, // $DIMLIM
            dimension_text_inside_horizontal: true, // $DIMTIH
            dimension_text_outside_horizontal: true, // $DIMTOH
            suppress_first_dimension_extension_line: false, // $DIMSE1
            suppress_second_dimension_extension_line: false, // $DIMSE2
            text_above_dimension_line: false, // $DIMTAD
            dimension_unit_zero_suppression: UnitZeroSuppression::SuppressZeroFeetAndZeroInches, // $DIMZIN
            arrow_block_name: String::new(), // $DIMBLK
            create_associative_dimensioning: true, // $DIMASO
            recompute_dimensions_while_dragging: true, // $DIMSHO
            dimensioning_suffix: String::new(), // $DIMPOST
            alternate_dimensioning_suffix: String::new(), // $DIMAPOST
            use_alternate_dimensioning: false, // $DIMALT
            alternate_dimensioning_decimal_places: 2, // $DIMALTD
            alternate_dimensioning_scale_factor: 25.4, // $DIMALTF
            dimension_linear_measurements_scale_factor: 1.0, // $DIMLFAC
            force_dimension_line_extensions_outside_if_text_is: false, // $DIMTOFL
            dimension_vertical_text_position: 0.0, // $DIMTVP
            force_dimension_text_inside_extensions: false, // $DIMTIX
            suppress_outside_extension_dimension_lines: false, // $DIMSOXD
            use_separate_arrow_blocks_for_dimensions: false, // $DIMSAH
            first_arrow_block_name: String::new(), // $DIMBLK1
            second_arrow_block_name: String::new(), // $DIMBLK2
            dimension_style_name: String::from("STANDARD"), // $DIMSTYLE
            dimension_line_color: Color::by_block(), // $DIMCLRD
            dimension_extension_line_color: Color::by_block(), // $DIMCLRE
            dimension_text_color: Color::by_block(), // $DIMCLRT
            dimension_tolerance_display_scale_factor: 1.0, // $DIMTFAC
            dimension_line_gap: 0.09, // $DIMGAP
            dimension_text_justification: DimensionTextJustification::AboveLineCenter, // $DIMJUST
            dimension_tolerance_vertical_justification: Justification::Middle, // $DIMTOLJ
            dimension_tolerance_zero_suppression: UnitZeroSuppression::SuppressZeroFeetAndZeroInches, // $DIMTZIN
            alternate_dimensioning_zero_supression: UnitZeroSuppression::SuppressZeroFeetAndZeroInches, // $DIMALTZ
            alternate_dimensioning_tolerance_zero_supression: UnitZeroSuppression::SuppressZeroFeetAndZeroInches, // $DIMALTTZ
            dimension_text_and_arrow_placement: DimensionFit::TextAndArrowsOutsideLines, // $DIMFIT
            dimension_cursor_controls_text_position: false, // $DIMUPT
            dimension_unit_format: UnitFormat::Decimal, // $DIMUNIT
            dimension_unit_tolerance_decimal_places: 4, // $DIMDEC
            dimension_tolerance_decimal_places: 4, // $DIMTDEC
            alternate_dimensioning_units: UnitFormat::Decimal, // $DIMALTU
            alternate_dimensioning_tolerance_decimal_places: 2, // $DIMALTTD
            dimension_text_style: String::from("STANDARD"), // $DIMTXSTY
            dimensioning_angle_format: AngleFormat::DecimalDegrees, // $DIMAUNIT
            angular_dimension_precision: 0, // $DIMADEC
            alternate_dimensioning_unit_rounding: 0.0, // $DIMALTRND
            dimension_angle_zero_suppression: UnitZeroSuppression::SuppressZeroFeetAndZeroInches, // $DIMAZIN
            dimension_decimal_separator_char: '.', // $DIMDSEP
            dimension_text_height_scale_factor: DimensionFractionFormat::HorizontalStacking, // $DIMFRAC
            dimension_leader_block_name: String::new(), // $DIMLDRBLK
            dimension_non_angular_units: NonAngularUnits::Decimal, // $DIMLUNIT
            dimension_line_weight: LineWeight::by_layer(), // $DIMLWD
            dimension_extension_line_weight: LineWeight::by_layer(), // $DIMLWE
            dimension_text_movement_rule: DimensionTextMovementRule::MoveLineWithText, // $DIMTMOVE
            dimension_line_fixed_length: 1.0, // $DIMFXL
            dimension_line_fixed_length_on: false, // $DIMFXLON
            dimension_transverse_segment_angle_in_jogged_radius: ::std::f64::consts::PI / 4.0, // $DIMJOGANG
            dimension_text_background_color_mode: DimensionTextBackgroundColorMode::None, // $DIMTFILL
            dxf_dimension_text_background_custom_color: Color::by_block(), // $DIMTFILLCLR
            dimension_arc_symbol_display_mode: DimensionArcSymbolDisplayMode::SymbolBeforeText, // $DIMARCSYM
            dimension_line_type: String::from("BYLAYER"), // $DIMLTYPE
            dimension_first_extension_line_type: String::new(), // $DIMLTEX1
            dimension_second_extension_line_type: String::new(), // $DIMLTEX2
            dimension_text_direction: TextDirection::LeftToRight, // $DIMTXTDIRECTION
            unit_format: UnitFormat::Decimal, // $LUNITS
            unit_precision: 4, // $LUPREC
            sketch_record_increment: 0.1, // $SKETCHINC
            fillet_radius: 0.0, // $FILLETRAD
            angle_unit_format: AngleFormat::DecimalDegrees, // $AUNITS
            angle_unit_precision: 0, // $AUPREC
            file_name: String::from("."), // $MENU
            elevation: 0.0, // $ELEVATION
            paperspace_elevation: 0.0, // $PELEVATION
            thickness: 0.0, // $THICKNESS
            use_limits_checking: false, // $LIMCHECK
            blip_mode: false, // $BLIPMODE
            first_chamfer_distance: 0.0, // $CHAMFERA
            second_chamfer_distance: 0.0, // $CHAMFERB
            chamfer_length: 0.0, // $CHAMFERC
            chamfer_angle: 0.0, // $CHAMFERD
            polyline_sketch_mode: PolySketchMode::SketchLines, // $SKPOLY
            creation_date: Local::now(), // $TDCREATE
            creation_date_universal: Utc::now(), // $TDUCREATE
            update_date: Local::now(), // $TDUPDATE
            update_date_universal: Utc::now(), // $TDUUPDATE
            time_in_drawing: Duration::default(), // $TDINDWG
            user_elapsed_timer: Duration::default(), // $TDUSRTIMER
            user_timer_on: true, // $USRTIMER
            angle_zero_direction: 0.0, // $ANGBASE
            angle_direction: AngleDirection::CounterClockwise, // $ANGDIR
            point_display_mode: 0, // $PDMODE
            point_display_size: 0.0, // $PDSIZE
            default_polyline_width: 0.0, // $PLINEWID
            coordinate_display: CoordinateDisplay::ContinuousUpdate, // $COORDS
            display_spline_polygon_control: false, // $SPLFRAME
            pedit_spline_curve_type: PolylineCurvedAndSmoothSurfaceType::CubicBSpline, // $SPLINETYPE
            line_segments_per_spline_patch: 8, // $SPLINESEGS
            show_attribute_entry_dialogs: true, // $ATTDIA
            prompt_for_attribute_on_insert: true, // $ATTREQ
            handles_enabled: true, // $HANDLING
            next_available_handle: Handle(1), // $HANDSEED
            mesh_tabulations_in_first_direction: 6, // $SURFTAB1
            mesh_tabulations_in_second_direction: 6, // $SURFTAB2
            pedit_smooth_surface_type: PolylineCurvedAndSmoothSurfaceType::CubicBSpline, // $SURFTYPE
            pedit_smooth_m_densith: 6, // $SURFU
            pedit_smooth_n_densith: 6, // $SURFV
            ucs_definition_name: String::new(), // $UCSBASE
            ucs_name: String::new(), // $UCSNAME
            ucs_origin: Point::origin(), // $UCSORG
            ucs_x_axis: Vector::x_axis(), // $UCSXDIR
            ucs_y_axis: Vector::y_axis(), // $UCSYDIR
            ortho_ucs_reference: String::new(), // $UCSORTHOREF
            orthgraphic_view_type: OrthographicViewType::None, // $UCSORTHOVIEW
            ucs_origin_top: Point::origin(), // $UCSORGTOP
            ucs_origin_bottom: Point::origin(), // $UCSORGBOTTOM
            ucs_origin_left: Point::origin(), // $UCSORGLEFT
            ucs_origin_right: Point::origin(), // $UCSORGRIGHT
            ucs_origin_front: Point::origin(), // $UCSORGFRONT
            ucs_origin_back: Point::origin(), // $UCSORGBACK
            paperspace_ucs_definition_name: String::new(), // $PUCSBASE
            paperspace_ucs_name: String::new(), // $PUCSNAME
            paperspace_ucs_origin: Point::origin(), // $PUCSORG
            paperspace_x_axis: Vector::x_axis(), // $PUCSXDIR
            paperspace_y_axis: Vector::y_axis(), // $PUCSYDIR
            paperspace_ortho_ucs_reference: String::new(), // $PUCSORTHOREF
            paperspace_orthographic_view_type: OrthographicViewType::None, // $PUCSORTHOVIEW
            paperspace_ucs_origin_top: Point::origin(), // $PUCSORGTOP
            paperspace_ucs_origin_bottom: Point::origin(), // $PUCSORGBOTTOM
            paperspace_ucs_origin_left: Point::origin(), // $PUCSORGLEFT
            paperspace_ucs_origin_right: Point::origin(), // $PUCSORGRIGHT
            paperspace_ucs_origin_front: Point::origin(), // $PUCSORGFRONT
            paperspace_ucs_origin_back: Point::origin(), // $PUCSORGBACK
            user_int1: 0, // $USERI1
            user_int2: 0, // $USERI2
            user_int3: 0, // $USERI3
            user_int4: 0, // $USERI4
            user_int5: 0, // $USERI5
            user_real1: 0.0, // $USERR1
            user_real2: 0.0, // $USERR2
            user_real3: 0.0, // $USERR3
            user_real4: 0.0, // $USERR4
            user_real5: 0.0, // $USERR5
            set_ucs_to_wcs_in_d_view_or_v_point: true, // $WORLDVIEW
            edge_shading: ShadeEdgeMode::FacesInEntityColorEdgesInBlack, // $SHADEDGE
            percent_ambient_to_diffuse: 70, // $SHADEDIF
            previous_release_tile_compatability: true, // $TILEMODE
            maximum_active_viewports: 64, // $MAXACTVP
            paperspace_insertion_base: Point::origin(), // $PINSBASE
            limit_checking_in_paperspace: false, // $PLIMCHECK
            paperspace_minimum_drawing_extents: Point::new(1.0e20, 1.0e20, 1.0e20), // $PEXTMIN
            paperspace_maximum_drawing_extents: Point::new(-1.0e20, -1.0e20, -1.0e20), // $PEXTMAX
            paperspace_minimum_drawing_limits: Point::origin(), // $PLIMMIN
            paperspace_maximum_drawing_limits: Point::new(12.0, 9.0, 0.0), // $PLIMMAX
            display_fractions_in_input: false, // $UNITMODE
            retain_x_ref_dependent_visibility_settings: true, // $VISRETAIN
            is_polyline_continuous_around_verticies: false, // $PLINEGEN
            scale_line_types_in_paperspace: true, // $PSLTSCALE
            spacial_index_max_depth: 3020, // $TREEDEPTH
            pick_style: PickStyle::Group, // $PICKSTYLE
            current_multiline_style: String::from("STANDARD"), // $CMLSTYLE
            current_multiline_justification: Justification::Top, // $CMLJUST
            current_multiline_scale: 1.0, // $CMLSCALE
            save_proxy_graphics: true, // $PROXYGRAPHICS
            drawing_units: DrawingUnits::English, // $MEASUREMENT
            new_object_line_weight: LineWeight::by_block(), // $CELWEIGHT
            end_cap_setting: EndCapSetting::None, // $ENDCAPS
            lineweight_joint_setting: JoinStyle::None, // $JOINSTYLE
            display_linewieght_in_model_and_layout_tab: false, // $LWDISPLAY
            default_drawing_units: Units::Unitless, // $INSUNITS
            hyperlink_base: String::new(), // $HYPERLINKBASE
            stylesheet: String::new(), // $STYLESHEET
            can_use_in_place_reference_editing: true, // $XEDIT
            new_object_plot_style_handle: Handle::empty(), // $CEPSNID
            new_object_plot_style: PlotStyle::ByLayer, // $CEPSNTYPE
            uses_color_dependent_plot_style_tables: true, // $PSTYLEMODE
            fingerprint_guid: Uuid::new_v4(), // $FINGERPRINTGUID
            version_guid: Uuid::new_v4(), // $VERSIONGUID
            use_acad2000_symbol_table_naming: true, // $EXTNAMES
            viewport_view_scale_factor: 0.0, // $PSVPSCALE
            ole_startup: false, // $OLESTARTUP
            object_sorting_methods_flags: 127, // $SORTENTS
            layer_and_spatial_index_save_mode: LayerAndSpatialIndexSaveMode::None, // $INDEXCTL
            hide_text_objects_when_producint_hidden_view: false, // $HIDETEXT
            is_x_ref_clipping_boundary_visible: XrefClippingBoundaryVisibility::DisplayedNotPlotted, // $XCLIPFRAME
            halo_gap_percent: 0.0, // $HALOGAP
            obscured_line_color: Color::by_entity(), // $OBSCOLOR
            obscured_line_type_style: LineTypeStyle::Off, // $OBSLTYPE
            display_intersection_polylines: false, // $INTERSECTIONDISPLAY
            intersection_polyline_color: Color::by_entity(), // $INTERSECTIONCOLOR
            dimension_object_associativity: DimensionAssociativity::NonAssociativeObjects, // $DIMASSOC
            project_name: String::new(), // $PROJECTNAME
            use_camera_display: false, // $CAMERADISPLAY
            lens_length: 50.0, // $LENSLENGTH
            camera_height: 0.0, // $CAMERAHEIGHT
            steps_per_second_in_walk_or_fly_mode: 2.0, // $STEPSPERSEC
            step_size_in_walk_or_fly_mode: 6.0, // $STEPSIZE
            dwf_3d_precision: Dwf3DPrecision::Deviation_0_5, // $3DDWFPREC
            last_poly_solid_width: 0.25, // $PSOLWIDTH
            last_poly_solid_height: 4.0, // $PSOLHEIGHT
            loft_operation_first_draft_angle: ::std::f64::consts::PI / 2.0, // $LOFTANG1
            loft_operation_second_draft_angle: ::std::f64::consts::PI / 2.0, // $LOFTANG2
            loft_operation_first_magnitude: 0.0, // $LOFTMAG1
            loft_operation_second_magnitude: 0.0, // $LOFTMAG2
            loft_flags: 7, // $LOFTPARAM
            lofted_object_normal_mode: LoftedObjectNormalMode::SmoothFit, // $LOFTNORMALS
            latitude: 37.7950, // $LATITUDE
            longitude: -122.3940, // $LONGITUDE
            angle_between_y_axis_and_north: 0.0, // $NORTHDIRECTION
            time_zone: DrawingTimeZone::PacificTime_US_Canada_SanFrancisco_Vancouver, // $TIMEZONE
            use_light_glyph_display: true, // $LIGHTGLYPHDISPLAY
            use_tile_mode_light_sync: true, // $TILEMODELIGHTSYNCH
            current_material_handle: Handle::empty(), // $CMATERIAL
            new_solids_contain_history: false, // $SOLIDHIST
            solid_history_mode: SolidHistoryMode::DoesNotOverride, // $SHOWHIST
            dwf_underlay_frame_mode: UnderlayFrameMode::DisplayNoPlot, // $DWFFRAME
            dgn_underlay_frame_mode: UnderlayFrameMode::None, // $DGNFRAME
            use_real_world_scale: true, // $REALWORLDSCALE
            interference_object_color: Color::from_index(1), // $INTERFERECOLOR
            interference_object_visual_style_pointer: Handle::empty(), // $INTERFEREOBJVS
            interference_view_port_visual_style_pointer: Handle::empty(), // $INTERFEREVPVS
            shadow_mode: ShadowMode::CastsAndReceivesShadows, // $CSHADOW
            shadow_plane_z_offset: 0.0, // $SHADOWPLANELOCATION
            axis_on: false, // $AXISMODE
            axis_tick_spacing: Vector::zero(), // $AXISUNIT
            fast_zoom: true, // $FASTZOOM
            grid_on: false, // $GRIDMODE
            grid_spacing: Vector::new(1.0, 1.0, 0.0), // $GRIDUNIT
            snap_rotation_angle: 0.0, // $SNAPANG
            snap_base_point: Point::origin(), // $SNAPBASE
            snap_isometric_plane: SnapIsometricPlane::Left, // $SNAPISOPAIR
            snap_on: false, // $SNAPMODE
            snap_style: SnapStyle::Standard, // $SNAPSTYLE
            snap_spacing: Vector::new(1.0, 1.0, 0.0), // $SNAPUNIT
            view_center: Point::origin(), // $VIEWCTR
            view_direction: Vector::z_axis(), // $VIEWDIR
            view_height: 1.0, // $VIEWSIZE
        }
    }
}

impl Header {
    // object_snap_flags flags
    /// Snap to line segment endpoints.  Maximum AutoCAD version: R14.
    pub fn get_end_point_snap(&self) -> bool {
        self.object_snap_flags & 1 != 0
    }
    /// Snap to line segment endpoints.  Maximum AutoCAD version: R14.
    pub fn set_end_point_snap(&mut self, val: bool) {
        if val {
            self.object_snap_flags |= 1;
        }
        else {
            self.object_snap_flags &= !1;
        }
    }
    /// Snap to line segment midpoints.  Maximum AutoCAD version: R14.
    pub fn get_mid_point_snap(&self) -> bool {
        self.object_snap_flags & 2 != 0
    }
    /// Snap to line segment midpoints.  Maximum AutoCAD version: R14.
    pub fn set_mid_point_snap(&mut self, val: bool) {
        if val {
            self.object_snap_flags |= 2;
        }
        else {
            self.object_snap_flags &= !2;
        }
    }
    /// Snap to circle and arc center points.  Maximum AutoCAD version: R14.
    pub fn get_center_snap(&self) -> bool {
        self.object_snap_flags & 4 != 0
    }
    /// Snap to circle and arc center points.  Maximum AutoCAD version: R14.
    pub fn set_center_snap(&mut self, val: bool) {
        if val {
            self.object_snap_flags |= 4;
        }
        else {
            self.object_snap_flags &= !4;
        }
    }
    /// Snap to nodes.  Maximum AutoCAD version: R14.
    pub fn get_node_snap(&self) -> bool {
        self.object_snap_flags & 8 != 0
    }
    /// Snap to nodes.  Maximum AutoCAD version: R14.
    pub fn set_node_snap(&mut self, val: bool) {
        if val {
            self.object_snap_flags |= 8;
        }
        else {
            self.object_snap_flags &= !8;
        }
    }
    /// Snap to circle quadrants.  Maximum AutoCAD version: R14.
    pub fn get_quadrant_snap(&self) -> bool {
        self.object_snap_flags & 16 != 0
    }
    /// Snap to circle quadrants.  Maximum AutoCAD version: R14.
    pub fn set_quadrant_snap(&mut self, val: bool) {
        if val {
            self.object_snap_flags |= 16;
        }
        else {
            self.object_snap_flags &= !16;
        }
    }
    /// Snap to segment intersections.  Maximum AutoCAD version: R14.
    pub fn get_intersection_snap(&self) -> bool {
        self.object_snap_flags & 32 != 0
    }
    /// Snap to segment intersections.  Maximum AutoCAD version: R14.
    pub fn set_intersection_snap(&mut self, val: bool) {
        if val {
            self.object_snap_flags |= 32;
        }
        else {
            self.object_snap_flags &= !32;
        }
    }
    /// Snap to block insertion points.  Maximum AutoCAD version: R14.
    pub fn get_insertion_snap(&self) -> bool {
        self.object_snap_flags & 64 != 0
    }
    /// Snap to block insertion points.  Maximum AutoCAD version: R14.
    pub fn set_insertion_snap(&mut self, val: bool) {
        if val {
            self.object_snap_flags |= 64;
        }
        else {
            self.object_snap_flags &= !64;
        }
    }
    /// Snap to perpendicular points.  Maximum AutoCAD version: R14.
    pub fn get_perpendicular_snap(&self) -> bool {
        self.object_snap_flags & 128 != 0
    }
    /// Snap to perpendicular points.  Maximum AutoCAD version: R14.
    pub fn set_perpendicular_snap(&mut self, val: bool) {
        if val {
            self.object_snap_flags |= 128;
        }
        else {
            self.object_snap_flags &= !128;
        }
    }
    /// Snap to tangent points.  Maximum AutoCAD version: R14.
    pub fn get_tangent_snap(&self) -> bool {
        self.object_snap_flags & 256 != 0
    }
    /// Snap to tangent points.  Maximum AutoCAD version: R14.
    pub fn set_tangent_snap(&mut self, val: bool) {
        if val {
            self.object_snap_flags |= 256;
        }
        else {
            self.object_snap_flags &= !256;
        }
    }
    /// Snap to nearest object points.  Maximum AutoCAD version: R14.
    pub fn get_nearest_snap(&self) -> bool {
        self.object_snap_flags & 512 != 0
    }
    /// Snap to nearest object points.  Maximum AutoCAD version: R14.
    pub fn set_nearest_snap(&mut self, val: bool) {
        if val {
            self.object_snap_flags |= 512;
        }
        else {
            self.object_snap_flags &= !512;
        }
    }
    /// Snap to apparent intersection points.  Maximum AutoCAD version: R14.
    pub fn get_apparent_intersection_snap(&self) -> bool {
        self.object_snap_flags & 2048 != 0
    }
    /// Snap to apparent intersection points.  Maximum AutoCAD version: R14.
    pub fn set_apparent_intersection_snap(&mut self, val: bool) {
        if val {
            self.object_snap_flags |= 2048;
        }
        else {
            self.object_snap_flags &= !2048;
        }
    }
    /// Snap to extension points.  Maximum AutoCAD version: R14.
    pub fn get_extension_snap(&self) -> bool {
        self.object_snap_flags & 4096 != 0
    }
    /// Snap to extension points.  Maximum AutoCAD version: R14.
    pub fn set_extension_snap(&mut self, val: bool) {
        if val {
            self.object_snap_flags |= 4096;
        }
        else {
            self.object_snap_flags &= !4096;
        }
    }
    /// Snap to parallel points.  Maximum AutoCAD version: R14.
    pub fn get_parallel_snap(&self) -> bool {
        self.object_snap_flags & 8192 != 0
    }
    /// Snap to parallel points.  Maximum AutoCAD version: R14.
    pub fn set_parallel_snap(&mut self, val: bool) {
        if val {
            self.object_snap_flags |= 8192;
        }
        else {
            self.object_snap_flags &= !8192;
        }
    }
    // object_sorting_methods_flags flags
    /// Sorts for object selection.  Minimum AutoCAD version: R2004.
    pub fn get_sort_objects_for_object_selection(&self) -> bool {
        self.object_sorting_methods_flags & 1 != 0
    }
    /// Sorts for object selection.  Minimum AutoCAD version: R2004.
    pub fn set_sort_objects_for_object_selection(&mut self, val: bool) {
        if val {
            self.object_sorting_methods_flags |= 1;
        }
        else {
            self.object_sorting_methods_flags &= !1;
        }
    }
    /// Sorts for object snap.  Minimum AutoCAD version: R2004.
    pub fn get_sort_objects_for_object_snap(&self) -> bool {
        self.object_sorting_methods_flags & 2 != 0
    }
    /// Sorts for object snap.  Minimum AutoCAD version: R2004.
    pub fn set_sort_objects_for_object_snap(&mut self, val: bool) {
        if val {
            self.object_sorting_methods_flags |= 2;
        }
        else {
            self.object_sorting_methods_flags &= !2;
        }
    }
    /// Sorts for redraws.  Minimum AutoCAD version: R2004.
    pub fn get_sort_objects_for_redraw(&self) -> bool {
        self.object_sorting_methods_flags & 4 != 0
    }
    /// Sorts for redraws.  Minimum AutoCAD version: R2004.
    pub fn set_sort_objects_for_redraw(&mut self, val: bool) {
        if val {
            self.object_sorting_methods_flags |= 4;
        }
        else {
            self.object_sorting_methods_flags &= !4;
        }
    }
    /// Sorts for MSLIDE command slide creation.  Minimum AutoCAD version: R2004.
    pub fn get_sort_objects_for_mslide(&self) -> bool {
        self.object_sorting_methods_flags & 8 != 0
    }
    /// Sorts for MSLIDE command slide creation.  Minimum AutoCAD version: R2004.
    pub fn set_sort_objects_for_mslide(&mut self, val: bool) {
        if val {
            self.object_sorting_methods_flags |= 8;
        }
        else {
            self.object_sorting_methods_flags &= !8;
        }
    }
    /// Sorts for REGEN commands.  Minimum AutoCAD version: R2004.
    pub fn get_sort_objects_for_regen(&self) -> bool {
        self.object_sorting_methods_flags & 16 != 0
    }
    /// Sorts for REGEN commands.  Minimum AutoCAD version: R2004.
    pub fn set_sort_objects_for_regen(&mut self, val: bool) {
        if val {
            self.object_sorting_methods_flags |= 16;
        }
        else {
            self.object_sorting_methods_flags &= !16;
        }
    }
    /// Sorts for plotting.  Minimum AutoCAD version: R2004.
    pub fn get_sort_objects_for_plotting(&self) -> bool {
        self.object_sorting_methods_flags & 32 != 0
    }
    /// Sorts for plotting.  Minimum AutoCAD version: R2004.
    pub fn set_sort_objects_for_plotting(&mut self, val: bool) {
        if val {
            self.object_sorting_methods_flags |= 32;
        }
        else {
            self.object_sorting_methods_flags &= !32;
        }
    }
    /// Sorts for PostScript output.  Minimum AutoCAD version: R2004.
    pub fn get_sort_objects_for_post_script_output(&self) -> bool {
        self.object_sorting_methods_flags & 64 != 0
    }
    /// Sorts for PostScript output.  Minimum AutoCAD version: R2004.
    pub fn set_sort_objects_for_post_script_output(&mut self, val: bool) {
        if val {
            self.object_sorting_methods_flags |= 64;
        }
        else {
            self.object_sorting_methods_flags &= !64;
        }
    }
    // loft_flags flags
    /// No twist (minimizes the twist between cross sections).  Minimum AutoCAD version: R2007.
    pub fn get_no_twist(&self) -> bool {
        self.loft_flags & 1 != 0
    }
    /// No twist (minimizes the twist between cross sections).  Minimum AutoCAD version: R2007.
    pub fn set_no_twist(&mut self, val: bool) {
        if val {
            self.loft_flags |= 1;
        }
        else {
            self.loft_flags &= !1;
        }
    }
    /// Align direction (aligns the start to end direction of each cross section curve).  Minimum AutoCAD version: R2007.
    pub fn get_align_direction(&self) -> bool {
        self.loft_flags & 2 != 0
    }
    /// Align direction (aligns the start to end direction of each cross section curve).  Minimum AutoCAD version: R2007.
    pub fn set_align_direction(&mut self, val: bool) {
        if val {
            self.loft_flags |= 2;
        }
        else {
            self.loft_flags &= !2;
        }
    }
    /// Simplify (produces simple solids and surfaces, such as a cylinder or plane, instead of spline solids and surfaces).  Minimum AutoCAD version: R2007.
    pub fn get_simplify(&self) -> bool {
        self.loft_flags & 4 != 0
    }
    /// Simplify (produces simple solids and surfaces, such as a cylinder or plane, instead of spline solids and surfaces).  Minimum AutoCAD version: R2007.
    pub fn set_simplify(&mut self, val: bool) {
        if val {
            self.loft_flags |= 4;
        }
        else {
            self.loft_flags &= !4;
        }
    }
    /// Close (closes the surface or solid between the first and the last cross sections).  Minimum AutoCAD version: R2007.
    pub fn get_close(&self) -> bool {
        self.loft_flags & 8 != 0
    }
    /// Close (closes the surface or solid between the first and the last cross sections).  Minimum AutoCAD version: R2007.
    pub fn set_close(&mut self, val: bool) {
        if val {
            self.loft_flags |= 8;
        }
        else {
            self.loft_flags &= !8;
        }
    }
    /// Sets the default values on the header.
    pub fn set_defaults(&mut self) {
        self.version = AcadVersion::R12; // $ACADVER
        self.maintenance_version = 0; // $ACADMAINTVER
        self.drawing_code_page = String::from("ANSI_1252"); // $DWGCODEPAGE
        self.last_saved_by = String::new(); // $LASTSAVEDBY
        self.required_versions = 0; // $REQUIREDVERSIONS
        self.insertion_base = Point::origin(); // $INSBASE
        self.minimum_drawing_extents = Point::origin(); // $EXTMIN
        self.maximum_drawing_extents = Point::origin(); // $EXTMAX
        self.minimum_drawing_limits = Point::origin(); // $LIMMIN
        self.maximum_drawing_limits = Point::new(12.0, 9.0, 0.0); // $LIMMAX
        self.draw_orthogonal_lines = false; // $ORTHOMODE
        self.use_regen_mode = true; // $REGENMODE
        self.fill_mode_on = true; // $FILLMODE
        self.use_quick_text_mode = false; // $QTEXTMODE
        self.mirror_text = false; // $MIRRTEXT
        self.drag_mode = DragMode::Auto; // $DRAGMODE
        self.line_type_scale = 1.0; // $LTSCALE
        self.object_snap_flags = 37; // $OSMODE
        self.attribute_visibility = AttributeVisibility::Normal; // $ATTMODE
        self.default_text_height = 0.2; // $TEXTSIZE
        self.trace_width = 0.05; // $TRACEWID
        self.text_style = String::from("STANDARD"); // $TEXTSTYLE
        self.current_layer = String::from("0"); // $CLAYER
        self.current_entity_line_type = String::from("BYLAYER"); // $CELTYPE
        self.current_entity_color = Color::by_layer(); // $CECOLOR
        self.current_entity_line_type_scale = 1.0; // $CELTSCALE
        self.retain_deleted_objects = true; // $DELOBJ
        self.display_silhouette_curves_in_wireframe_mode = false; // $DISPSILH
        self.solid_visual_style_pointer = Handle::empty(); // $DRAGVS
        self.dimensioning_scale_factor = 1.0; // $DIMSCALE
        self.dimensioning_arrow_size = 0.18; // $DIMASZ
        self.dimension_extension_line_offset = 0.0625; // $DIMEXO
        self.dimension_line_increment = 0.38; // $DIMDLI
        self.dimension_distance_rounding_value = 0.0; // $DIMRND
        self.dimension_line_extension = 0.0; // $DIMDLE
        self.dimension_extension_line_extension = 0.18; // $DIMEXE
        self.dimension_plus_tolerance = 0.0; // $DIMTP
        self.dimension_minus_tolerance = 0.0; // $DIMTM
        self.dimensioning_text_height = 0.18; // $DIMTXT
        self.center_mark_size = 0.09; // $DIMCEN
        self.dimensioning_tick_size = 0.0; // $DIMTSZ
        self.generate_dimension_tolerances = false; // $DIMTOL
        self.generate_dimension_limits = false; // $DIMLIM
        self.dimension_text_inside_horizontal = true; // $DIMTIH
        self.dimension_text_outside_horizontal = true; // $DIMTOH
        self.suppress_first_dimension_extension_line = false; // $DIMSE1
        self.suppress_second_dimension_extension_line = false; // $DIMSE2
        self.text_above_dimension_line = false; // $DIMTAD
        self.dimension_unit_zero_suppression = UnitZeroSuppression::SuppressZeroFeetAndZeroInches; // $DIMZIN
        self.arrow_block_name = String::new(); // $DIMBLK
        self.create_associative_dimensioning = true; // $DIMASO
        self.recompute_dimensions_while_dragging = true; // $DIMSHO
        self.dimensioning_suffix = String::new(); // $DIMPOST
        self.alternate_dimensioning_suffix = String::new(); // $DIMAPOST
        self.use_alternate_dimensioning = false; // $DIMALT
        self.alternate_dimensioning_decimal_places = 2; // $DIMALTD
        self.alternate_dimensioning_scale_factor = 25.4; // $DIMALTF
        self.dimension_linear_measurements_scale_factor = 1.0; // $DIMLFAC
        self.force_dimension_line_extensions_outside_if_text_is = false; // $DIMTOFL
        self.dimension_vertical_text_position = 0.0; // $DIMTVP
        self.force_dimension_text_inside_extensions = false; // $DIMTIX
        self.suppress_outside_extension_dimension_lines = false; // $DIMSOXD
        self.use_separate_arrow_blocks_for_dimensions = false; // $DIMSAH
        self.first_arrow_block_name = String::new(); // $DIMBLK1
        self.second_arrow_block_name = String::new(); // $DIMBLK2
        self.dimension_style_name = String::from("STANDARD"); // $DIMSTYLE
        self.dimension_line_color = Color::by_block(); // $DIMCLRD
        self.dimension_extension_line_color = Color::by_block(); // $DIMCLRE
        self.dimension_text_color = Color::by_block(); // $DIMCLRT
        self.dimension_tolerance_display_scale_factor = 1.0; // $DIMTFAC
        self.dimension_line_gap = 0.09; // $DIMGAP
        self.dimension_text_justification = DimensionTextJustification::AboveLineCenter; // $DIMJUST
        self.dimension_tolerance_vertical_justification = Justification::Middle; // $DIMTOLJ
        self.dimension_tolerance_zero_suppression = UnitZeroSuppression::SuppressZeroFeetAndZeroInches; // $DIMTZIN
        self.alternate_dimensioning_zero_supression = UnitZeroSuppression::SuppressZeroFeetAndZeroInches; // $DIMALTZ
        self.alternate_dimensioning_tolerance_zero_supression = UnitZeroSuppression::SuppressZeroFeetAndZeroInches; // $DIMALTTZ
        self.dimension_text_and_arrow_placement = DimensionFit::TextAndArrowsOutsideLines; // $DIMFIT
        self.dimension_cursor_controls_text_position = false; // $DIMUPT
        self.dimension_unit_format = UnitFormat::Decimal; // $DIMUNIT
        self.dimension_unit_tolerance_decimal_places = 4; // $DIMDEC
        self.dimension_tolerance_decimal_places = 4; // $DIMTDEC
        self.alternate_dimensioning_units = UnitFormat::Decimal; // $DIMALTU
        self.alternate_dimensioning_tolerance_decimal_places = 2; // $DIMALTTD
        self.dimension_text_style = String::from("STANDARD"); // $DIMTXSTY
        self.dimensioning_angle_format = AngleFormat::DecimalDegrees; // $DIMAUNIT
        self.angular_dimension_precision = 0; // $DIMADEC
        self.alternate_dimensioning_unit_rounding = 0.0; // $DIMALTRND
        self.dimension_angle_zero_suppression = UnitZeroSuppression::SuppressZeroFeetAndZeroInches; // $DIMAZIN
        self.dimension_decimal_separator_char = '.'; // $DIMDSEP
        self.dimension_text_height_scale_factor = DimensionFractionFormat::HorizontalStacking; // $DIMFRAC
        self.dimension_leader_block_name = String::new(); // $DIMLDRBLK
        self.dimension_non_angular_units = NonAngularUnits::Decimal; // $DIMLUNIT
        self.dimension_line_weight = LineWeight::by_layer(); // $DIMLWD
        self.dimension_extension_line_weight = LineWeight::by_layer(); // $DIMLWE
        self.dimension_text_movement_rule = DimensionTextMovementRule::MoveLineWithText; // $DIMTMOVE
        self.dimension_line_fixed_length = 1.0; // $DIMFXL
        self.dimension_line_fixed_length_on = false; // $DIMFXLON
        self.dimension_transverse_segment_angle_in_jogged_radius = ::std::f64::consts::PI / 4.0; // $DIMJOGANG
        self.dimension_text_background_color_mode = DimensionTextBackgroundColorMode::None; // $DIMTFILL
        self.dxf_dimension_text_background_custom_color = Color::by_block(); // $DIMTFILLCLR
        self.dimension_arc_symbol_display_mode = DimensionArcSymbolDisplayMode::SymbolBeforeText; // $DIMARCSYM
        self.dimension_line_type = String::from("BYLAYER"); // $DIMLTYPE
        self.dimension_first_extension_line_type = String::new(); // $DIMLTEX1
        self.dimension_second_extension_line_type = String::new(); // $DIMLTEX2
        self.dimension_text_direction = TextDirection::LeftToRight; // $DIMTXTDIRECTION
        self.unit_format = UnitFormat::Decimal; // $LUNITS
        self.unit_precision = 4; // $LUPREC
        self.sketch_record_increment = 0.1; // $SKETCHINC
        self.fillet_radius = 0.0; // $FILLETRAD
        self.angle_unit_format = AngleFormat::DecimalDegrees; // $AUNITS
        self.angle_unit_precision = 0; // $AUPREC
        self.file_name = String::from("."); // $MENU
        self.elevation = 0.0; // $ELEVATION
        self.paperspace_elevation = 0.0; // $PELEVATION
        self.thickness = 0.0; // $THICKNESS
        self.use_limits_checking = false; // $LIMCHECK
        self.blip_mode = false; // $BLIPMODE
        self.first_chamfer_distance = 0.0; // $CHAMFERA
        self.second_chamfer_distance = 0.0; // $CHAMFERB
        self.chamfer_length = 0.0; // $CHAMFERC
        self.chamfer_angle = 0.0; // $CHAMFERD
        self.polyline_sketch_mode = PolySketchMode::SketchLines; // $SKPOLY
        self.creation_date = Local::now(); // $TDCREATE
        self.creation_date_universal = Utc::now(); // $TDUCREATE
        self.update_date = Local::now(); // $TDUPDATE
        self.update_date_universal = Utc::now(); // $TDUUPDATE
        self.time_in_drawing = Duration::default(); // $TDINDWG
        self.user_elapsed_timer = Duration::default(); // $TDUSRTIMER
        self.user_timer_on = true; // $USRTIMER
        self.angle_zero_direction = 0.0; // $ANGBASE
        self.angle_direction = AngleDirection::CounterClockwise; // $ANGDIR
        self.point_display_mode = 0; // $PDMODE
        self.point_display_size = 0.0; // $PDSIZE
        self.default_polyline_width = 0.0; // $PLINEWID
        self.coordinate_display = CoordinateDisplay::ContinuousUpdate; // $COORDS
        self.display_spline_polygon_control = false; // $SPLFRAME
        self.pedit_spline_curve_type = PolylineCurvedAndSmoothSurfaceType::CubicBSpline; // $SPLINETYPE
        self.line_segments_per_spline_patch = 8; // $SPLINESEGS
        self.show_attribute_entry_dialogs = true; // $ATTDIA
        self.prompt_for_attribute_on_insert = true; // $ATTREQ
        self.handles_enabled = true; // $HANDLING
        self.next_available_handle = Handle(1); // $HANDSEED
        self.mesh_tabulations_in_first_direction = 6; // $SURFTAB1
        self.mesh_tabulations_in_second_direction = 6; // $SURFTAB2
        self.pedit_smooth_surface_type = PolylineCurvedAndSmoothSurfaceType::CubicBSpline; // $SURFTYPE
        self.pedit_smooth_m_densith = 6; // $SURFU
        self.pedit_smooth_n_densith = 6; // $SURFV
        self.ucs_definition_name = String::new(); // $UCSBASE
        self.ucs_name = String::new(); // $UCSNAME
        self.ucs_origin = Point::origin(); // $UCSORG
        self.ucs_x_axis = Vector::x_axis(); // $UCSXDIR
        self.ucs_y_axis = Vector::y_axis(); // $UCSYDIR
        self.ortho_ucs_reference = String::new(); // $UCSORTHOREF
        self.orthgraphic_view_type = OrthographicViewType::None; // $UCSORTHOVIEW
        self.ucs_origin_top = Point::origin(); // $UCSORGTOP
        self.ucs_origin_bottom = Point::origin(); // $UCSORGBOTTOM
        self.ucs_origin_left = Point::origin(); // $UCSORGLEFT
        self.ucs_origin_right = Point::origin(); // $UCSORGRIGHT
        self.ucs_origin_front = Point::origin(); // $UCSORGFRONT
        self.ucs_origin_back = Point::origin(); // $UCSORGBACK
        self.paperspace_ucs_definition_name = String::new(); // $PUCSBASE
        self.paperspace_ucs_name = String::new(); // $PUCSNAME
        self.paperspace_ucs_origin = Point::origin(); // $PUCSORG
        self.paperspace_x_axis = Vector::x_axis(); // $PUCSXDIR
        self.paperspace_y_axis = Vector::y_axis(); // $PUCSYDIR
        self.paperspace_ortho_ucs_reference = String::new(); // $PUCSORTHOREF
        self.paperspace_orthographic_view_type = OrthographicViewType::None; // $PUCSORTHOVIEW
        self.paperspace_ucs_origin_top = Point::origin(); // $PUCSORGTOP
        self.paperspace_ucs_origin_bottom = Point::origin(); // $PUCSORGBOTTOM
        self.paperspace_ucs_origin_left = Point::origin(); // $PUCSORGLEFT
        self.paperspace_ucs_origin_right = Point::origin(); // $PUCSORGRIGHT
        self.paperspace_ucs_origin_front = Point::origin(); // $PUCSORGFRONT
        self.paperspace_ucs_origin_back = Point::origin(); // $PUCSORGBACK
        self.user_int1 = 0; // $USERI1
        self.user_int2 = 0; // $USERI2
        self.user_int3 = 0; // $USERI3
        self.user_int4 = 0; // $USERI4
        self.user_int5 = 0; // $USERI5
        self.user_real1 = 0.0; // $USERR1
        self.user_real2 = 0.0; // $USERR2
        self.user_real3 = 0.0; // $USERR3
        self.user_real4 = 0.0; // $USERR4
        self.user_real5 = 0.0; // $USERR5
        self.set_ucs_to_wcs_in_d_view_or_v_point = true; // $WORLDVIEW
        self.edge_shading = ShadeEdgeMode::FacesInEntityColorEdgesInBlack; // $SHADEDGE
        self.percent_ambient_to_diffuse = 70; // $SHADEDIF
        self.previous_release_tile_compatability = true; // $TILEMODE
        self.maximum_active_viewports = 64; // $MAXACTVP
        self.paperspace_insertion_base = Point::origin(); // $PINSBASE
        self.limit_checking_in_paperspace = false; // $PLIMCHECK
        self.paperspace_minimum_drawing_extents = Point::new(1.0e20, 1.0e20, 1.0e20); // $PEXTMIN
        self.paperspace_maximum_drawing_extents = Point::new(-1.0e20, -1.0e20, -1.0e20); // $PEXTMAX
        self.paperspace_minimum_drawing_limits = Point::origin(); // $PLIMMIN
        self.paperspace_maximum_drawing_limits = Point::new(12.0, 9.0, 0.0); // $PLIMMAX
        self.display_fractions_in_input = false; // $UNITMODE
        self.retain_x_ref_dependent_visibility_settings = true; // $VISRETAIN
        self.is_polyline_continuous_around_verticies = false; // $PLINEGEN
        self.scale_line_types_in_paperspace = true; // $PSLTSCALE
        self.spacial_index_max_depth = 3020; // $TREEDEPTH
        self.pick_style = PickStyle::Group; // $PICKSTYLE
        self.current_multiline_style = String::from("STANDARD"); // $CMLSTYLE
        self.current_multiline_justification = Justification::Top; // $CMLJUST
        self.current_multiline_scale = 1.0; // $CMLSCALE
        self.save_proxy_graphics = true; // $PROXYGRAPHICS
        self.drawing_units = DrawingUnits::English; // $MEASUREMENT
        self.new_object_line_weight = LineWeight::by_block(); // $CELWEIGHT
        self.end_cap_setting = EndCapSetting::None; // $ENDCAPS
        self.lineweight_joint_setting = JoinStyle::None; // $JOINSTYLE
        self.display_linewieght_in_model_and_layout_tab = false; // $LWDISPLAY
        self.default_drawing_units = Units::Unitless; // $INSUNITS
        self.hyperlink_base = String::new(); // $HYPERLINKBASE
        self.stylesheet = String::new(); // $STYLESHEET
        self.can_use_in_place_reference_editing = true; // $XEDIT
        self.new_object_plot_style_handle = Handle::empty(); // $CEPSNID
        self.new_object_plot_style = PlotStyle::ByLayer; // $CEPSNTYPE
        self.uses_color_dependent_plot_style_tables = true; // $PSTYLEMODE
        self.fingerprint_guid = Uuid::new_v4(); // $FINGERPRINTGUID
        self.version_guid = Uuid::new_v4(); // $VERSIONGUID
        self.use_acad2000_symbol_table_naming = true; // $EXTNAMES
        self.viewport_view_scale_factor = 0.0; // $PSVPSCALE
        self.ole_startup = false; // $OLESTARTUP
        self.object_sorting_methods_flags = 127; // $SORTENTS
        self.layer_and_spatial_index_save_mode = LayerAndSpatialIndexSaveMode::None; // $INDEXCTL
        self.hide_text_objects_when_producint_hidden_view = false; // $HIDETEXT
        self.is_x_ref_clipping_boundary_visible = XrefClippingBoundaryVisibility::DisplayedNotPlotted; // $XCLIPFRAME
        self.halo_gap_percent = 0.0; // $HALOGAP
        self.obscured_line_color = Color::by_entity(); // $OBSCOLOR
        self.obscured_line_type_style = LineTypeStyle::Off; // $OBSLTYPE
        self.display_intersection_polylines = false; // $INTERSECTIONDISPLAY
        self.intersection_polyline_color = Color::by_entity(); // $INTERSECTIONCOLOR
        self.dimension_object_associativity = DimensionAssociativity::NonAssociativeObjects; // $DIMASSOC
        self.project_name = String::new(); // $PROJECTNAME
        self.use_camera_display = false; // $CAMERADISPLAY
        self.lens_length = 50.0; // $LENSLENGTH
        self.camera_height = 0.0; // $CAMERAHEIGHT
        self.steps_per_second_in_walk_or_fly_mode = 2.0; // $STEPSPERSEC
        self.step_size_in_walk_or_fly_mode = 6.0; // $STEPSIZE
        self.dwf_3d_precision = Dwf3DPrecision::Deviation_0_5; // $3DDWFPREC
        self.last_poly_solid_width = 0.25; // $PSOLWIDTH
        self.last_poly_solid_height = 4.0; // $PSOLHEIGHT
        self.loft_operation_first_draft_angle = ::std::f64::consts::PI / 2.0; // $LOFTANG1
        self.loft_operation_second_draft_angle = ::std::f64::consts::PI / 2.0; // $LOFTANG2
        self.loft_operation_first_magnitude = 0.0; // $LOFTMAG1
        self.loft_operation_second_magnitude = 0.0; // $LOFTMAG2
        self.loft_flags = 7; // $LOFTPARAM
        self.lofted_object_normal_mode = LoftedObjectNormalMode::SmoothFit; // $LOFTNORMALS
        self.latitude = 37.7950; // $LATITUDE
        self.longitude = -122.3940; // $LONGITUDE
        self.angle_between_y_axis_and_north = 0.0; // $NORTHDIRECTION
        self.time_zone = DrawingTimeZone::PacificTime_US_Canada_SanFrancisco_Vancouver; // $TIMEZONE
        self.use_light_glyph_display = true; // $LIGHTGLYPHDISPLAY
        self.use_tile_mode_light_sync = true; // $TILEMODELIGHTSYNCH
        self.current_material_handle = Handle::empty(); // $CMATERIAL
        self.new_solids_contain_history = false; // $SOLIDHIST
        self.solid_history_mode = SolidHistoryMode::DoesNotOverride; // $SHOWHIST
        self.dwf_underlay_frame_mode = UnderlayFrameMode::DisplayNoPlot; // $DWFFRAME
        self.dgn_underlay_frame_mode = UnderlayFrameMode::None; // $DGNFRAME
        self.use_real_world_scale = true; // $REALWORLDSCALE
        self.interference_object_color = Color::from_index(1); // $INTERFERECOLOR
        self.interference_object_visual_style_pointer = Handle::empty(); // $INTERFEREOBJVS
        self.interference_view_port_visual_style_pointer = Handle::empty(); // $INTERFEREVPVS
        self.shadow_mode = ShadowMode::CastsAndReceivesShadows; // $CSHADOW
        self.shadow_plane_z_offset = 0.0; // $SHADOWPLANELOCATION
        self.axis_on = false; // $AXISMODE
        self.axis_tick_spacing = Vector::zero(); // $AXISUNIT
        self.fast_zoom = true; // $FASTZOOM
        self.grid_on = false; // $GRIDMODE
        self.grid_spacing = Vector::new(1.0, 1.0, 0.0); // $GRIDUNIT
        self.snap_rotation_angle = 0.0; // $SNAPANG
        self.snap_base_point = Point::origin(); // $SNAPBASE
        self.snap_isometric_plane = SnapIsometricPlane::Left; // $SNAPISOPAIR
        self.snap_on = false; // $SNAPMODE
        self.snap_style = SnapStyle::Standard; // $SNAPSTYLE
        self.snap_spacing = Vector::new(1.0, 1.0, 0.0); // $SNAPUNIT
        self.view_center = Point::origin(); // $VIEWCTR
        self.view_direction = Vector::z_axis(); // $VIEWDIR
        self.view_height = 1.0; // $VIEWSIZE
    }
    #[allow(clippy::cognitive_complexity)] // generated method
    pub(crate) fn set_header_value(&mut self, variable: &str, pair: &CodePair) -> DxfResult<()> {
        match variable {
            "$ACADVER" => { verify_code(&pair, 1)?; self.version = AcadVersion::from_safe(pair.assert_string()?); },
            "$ACADMAINTVER" => { verify_code(&pair, 70)?; self.maintenance_version = pair.assert_i16()?; },
            "$DWGCODEPAGE" => { verify_code(&pair, 3)?; self.drawing_code_page = pair.assert_string()?; },
            "$LASTSAVEDBY" => { verify_code(&pair, 1)?; self.last_saved_by = pair.assert_string()?; },
            "$REQUIREDVERSIONS" => { verify_code(&pair, 160)?; self.required_versions = pair.assert_i64()?; },
            "$INSBASE" => { self.insertion_base.set(&pair)?; },
            "$EXTMIN" => { self.minimum_drawing_extents.set(&pair)?; },
            "$EXTMAX" => { self.maximum_drawing_extents.set(&pair)?; },
            "$LIMMIN" => { self.minimum_drawing_limits.set(&pair)?; },
            "$LIMMAX" => { self.maximum_drawing_limits.set(&pair)?; },
            "$ORTHOMODE" => { verify_code(&pair, 70)?; self.draw_orthogonal_lines = as_bool(pair.assert_i16()?); },
            "$REGENMODE" => { verify_code(&pair, 70)?; self.use_regen_mode = as_bool(pair.assert_i16()?); },
            "$FILLMODE" => { verify_code(&pair, 70)?; self.fill_mode_on = as_bool(pair.assert_i16()?); },
            "$QTEXTMODE" => { verify_code(&pair, 70)?; self.use_quick_text_mode = as_bool(pair.assert_i16()?); },
            "$MIRRTEXT" => { verify_code(&pair, 70)?; self.mirror_text = as_bool(pair.assert_i16()?); },
            "$DRAGMODE" => { verify_code(&pair, 70)?; self.drag_mode = enum_from_number!(DragMode, Auto, from_i16, pair.assert_i16()?); },
            "$LTSCALE" => { verify_code(&pair, 40)?; self.line_type_scale = pair.assert_f64()?; },
            "$OSMODE" => { verify_code(&pair, 70)?; self.object_snap_flags = i32::from(pair.assert_i16()?); },
            "$ATTMODE" => { verify_code(&pair, 70)?; self.attribute_visibility = enum_from_number!(AttributeVisibility, Normal, from_i16, pair.assert_i16()?); },
            "$TEXTSIZE" => { verify_code(&pair, 40)?; self.default_text_height = pair.assert_f64()?; },
            "$TRACEWID" => { verify_code(&pair, 40)?; self.trace_width = pair.assert_f64()?; },
            "$TEXTSTYLE" => { verify_code(&pair, 7)?; self.text_style = pair.assert_string()?; },
            "$CLAYER" => { verify_code(&pair, 8)?; self.current_layer = pair.assert_string()?; },
            "$CELTYPE" => { verify_code(&pair, 6)?; self.current_entity_line_type = pair.assert_string()?; },
            "$CECOLOR" => { verify_code(&pair, 62)?; self.current_entity_color = Color::from_raw_value(pair.assert_i16()?); },
            "$CELTSCALE" => { verify_code(&pair, 40)?; self.current_entity_line_type_scale = pair.assert_f64()?; },
            "$DELOBJ" => { verify_code(&pair, 70)?; self.retain_deleted_objects = as_bool(pair.assert_i16()?); },
            "$DISPSILH" => { verify_code(&pair, 70)?; self.display_silhouette_curves_in_wireframe_mode = as_bool(pair.assert_i16()?); },
            "$DRAGVS" => { verify_code(&pair, 349)?; self.solid_visual_style_pointer = pair.as_handle()?; },
            "$DIMSCALE" => { verify_code(&pair, 40)?; self.dimensioning_scale_factor = pair.assert_f64()?; },
            "$DIMASZ" => { verify_code(&pair, 40)?; self.dimensioning_arrow_size = pair.assert_f64()?; },
            "$DIMEXO" => { verify_code(&pair, 40)?; self.dimension_extension_line_offset = pair.assert_f64()?; },
            "$DIMDLI" => { verify_code(&pair, 40)?; self.dimension_line_increment = pair.assert_f64()?; },
            "$DIMRND" => { verify_code(&pair, 40)?; self.dimension_distance_rounding_value = pair.assert_f64()?; },
            "$DIMDLE" => { verify_code(&pair, 40)?; self.dimension_line_extension = pair.assert_f64()?; },
            "$DIMEXE" => { verify_code(&pair, 40)?; self.dimension_extension_line_extension = pair.assert_f64()?; },
            "$DIMTP" => { verify_code(&pair, 40)?; self.dimension_plus_tolerance = pair.assert_f64()?; },
            "$DIMTM" => { verify_code(&pair, 40)?; self.dimension_minus_tolerance = pair.assert_f64()?; },
            "$DIMTXT" => { verify_code(&pair, 40)?; self.dimensioning_text_height = pair.assert_f64()?; },
            "$DIMCEN" => { verify_code(&pair, 40)?; self.center_mark_size = pair.assert_f64()?; },
            "$DIMTSZ" => { verify_code(&pair, 40)?; self.dimensioning_tick_size = pair.assert_f64()?; },
            "$DIMTOL" => { verify_code(&pair, 70)?; self.generate_dimension_tolerances = as_bool(pair.assert_i16()?); },
            "$DIMLIM" => { verify_code(&pair, 70)?; self.generate_dimension_limits = as_bool(pair.assert_i16()?); },
            "$DIMTIH" => { verify_code(&pair, 70)?; self.dimension_text_inside_horizontal = as_bool(pair.assert_i16()?); },
            "$DIMTOH" => { verify_code(&pair, 70)?; self.dimension_text_outside_horizontal = as_bool(pair.assert_i16()?); },
            "$DIMSE1" => { verify_code(&pair, 70)?; self.suppress_first_dimension_extension_line = as_bool(pair.assert_i16()?); },
            "$DIMSE2" => { verify_code(&pair, 70)?; self.suppress_second_dimension_extension_line = as_bool(pair.assert_i16()?); },
            "$DIMTAD" => { verify_code(&pair, 70)?; self.text_above_dimension_line = as_bool(pair.assert_i16()?); },
            "$DIMZIN" => { verify_code(&pair, 70)?; self.dimension_unit_zero_suppression = enum_from_number!(UnitZeroSuppression, SuppressZeroFeetAndZeroInches, from_i16, pair.assert_i16()?); },
            "$DIMBLK" => { verify_code(&pair, 1)?; self.arrow_block_name = pair.assert_string()?; },
            "$DIMASO" => { verify_code(&pair, 70)?; self.create_associative_dimensioning = as_bool(pair.assert_i16()?); },
            "$DIMSHO" => { verify_code(&pair, 70)?; self.recompute_dimensions_while_dragging = as_bool(pair.assert_i16()?); },
            "$DIMPOST" => { verify_code(&pair, 1)?; self.dimensioning_suffix = pair.assert_string()?; },
            "$DIMAPOST" => { verify_code(&pair, 1)?; self.alternate_dimensioning_suffix = pair.assert_string()?; },
            "$DIMALT" => { verify_code(&pair, 70)?; self.use_alternate_dimensioning = as_bool(pair.assert_i16()?); },
            "$DIMALTD" => { verify_code(&pair, 70)?; self.alternate_dimensioning_decimal_places = pair.assert_i16()?; },
            "$DIMALTF" => { verify_code(&pair, 40)?; self.alternate_dimensioning_scale_factor = pair.assert_f64()?; },
            "$DIMLFAC" => { verify_code(&pair, 40)?; self.dimension_linear_measurements_scale_factor = pair.assert_f64()?; },
            "$DIMTOFL" => { verify_code(&pair, 70)?; self.force_dimension_line_extensions_outside_if_text_is = as_bool(pair.assert_i16()?); },
            "$DIMTVP" => { verify_code(&pair, 40)?; self.dimension_vertical_text_position = pair.assert_f64()?; },
            "$DIMTIX" => { verify_code(&pair, 70)?; self.force_dimension_text_inside_extensions = as_bool(pair.assert_i16()?); },
            "$DIMSOXD" => { verify_code(&pair, 70)?; self.suppress_outside_extension_dimension_lines = as_bool(pair.assert_i16()?); },
            "$DIMSAH" => { verify_code(&pair, 70)?; self.use_separate_arrow_blocks_for_dimensions = as_bool(pair.assert_i16()?); },
            "$DIMBLK1" => { verify_code(&pair, 1)?; self.first_arrow_block_name = pair.assert_string()?; },
            "$DIMBLK2" => { verify_code(&pair, 1)?; self.second_arrow_block_name = pair.assert_string()?; },
            "$DIMSTYLE" => { verify_code(&pair, 2)?; self.dimension_style_name = pair.assert_string()?; },
            "$DIMCLRD" => { verify_code(&pair, 70)?; self.dimension_line_color = Color::from_raw_value(pair.assert_i16()?); },
            "$DIMCLRE" => { verify_code(&pair, 70)?; self.dimension_extension_line_color = Color::from_raw_value(pair.assert_i16()?); },
            "$DIMCLRT" => { verify_code(&pair, 70)?; self.dimension_text_color = Color::from_raw_value(pair.assert_i16()?); },
            "$DIMTFAC" => { verify_code(&pair, 40)?; self.dimension_tolerance_display_scale_factor = pair.assert_f64()?; },
            "$DIMGAP" => { verify_code(&pair, 40)?; self.dimension_line_gap = pair.assert_f64()?; },
            "$DIMJUST" => { verify_code(&pair, 70)?; self.dimension_text_justification = enum_from_number!(DimensionTextJustification, AboveLineCenter, from_i16, pair.assert_i16()?); },
            "$DIMTOLJ" => { verify_code(&pair, 70)?; self.dimension_tolerance_vertical_justification = enum_from_number!(Justification, Middle, from_i16, pair.assert_i16()?); },
            "$DIMTZIN" => { verify_code(&pair, 70)?; self.dimension_tolerance_zero_suppression = enum_from_number!(UnitZeroSuppression, SuppressZeroFeetAndZeroInches, from_i16, pair.assert_i16()?); },
            "$DIMALTZ" => { verify_code(&pair, 70)?; self.alternate_dimensioning_zero_supression = enum_from_number!(UnitZeroSuppression, SuppressZeroFeetAndZeroInches, from_i16, pair.assert_i16()?); },
            "$DIMALTTZ" => { verify_code(&pair, 70)?; self.alternate_dimensioning_tolerance_zero_supression = enum_from_number!(UnitZeroSuppression, SuppressZeroFeetAndZeroInches, from_i16, pair.assert_i16()?); },
            "$DIMFIT" => { verify_code(&pair, 70)?; self.dimension_text_and_arrow_placement = enum_from_number!(DimensionFit, TextAndArrowsOutsideLines, from_i16, pair.assert_i16()?); },
            "$DIMUPT" => { verify_code(&pair, 70)?; self.dimension_cursor_controls_text_position = as_bool(pair.assert_i16()?); },
            "$DIMUNIT" => { verify_code(&pair, 70)?; self.dimension_unit_format = enum_from_number!(UnitFormat, Decimal, from_i16, pair.assert_i16()?); },
            "$DIMDEC" => { verify_code(&pair, 70)?; self.dimension_unit_tolerance_decimal_places = pair.assert_i16()?; },
            "$DIMTDEC" => { verify_code(&pair, 70)?; self.dimension_tolerance_decimal_places = pair.assert_i16()?; },
            "$DIMALTU" => { verify_code(&pair, 70)?; self.alternate_dimensioning_units = enum_from_number!(UnitFormat, Decimal, from_i16, pair.assert_i16()?); },
            "$DIMALTTD" => { verify_code(&pair, 70)?; self.alternate_dimensioning_tolerance_decimal_places = pair.assert_i16()?; },
            "$DIMTXSTY" => { verify_code(&pair, 7)?; self.dimension_text_style = pair.assert_string()?; },
            "$DIMAUNIT" => { verify_code(&pair, 70)?; self.dimensioning_angle_format = enum_from_number!(AngleFormat, DecimalDegrees, from_i16, pair.assert_i16()?); },
            "$DIMADEC" => { verify_code(&pair, 70)?; self.angular_dimension_precision = pair.assert_i16()?; },
            "$DIMALTRND" => { verify_code(&pair, 40)?; self.alternate_dimensioning_unit_rounding = pair.assert_f64()?; },
            "$DIMAZIN" => { verify_code(&pair, 70)?; self.dimension_angle_zero_suppression = enum_from_number!(UnitZeroSuppression, SuppressZeroFeetAndZeroInches, from_i16, pair.assert_i16()?); },
            "$DIMDSEP" => { verify_code(&pair, 70)?; self.dimension_decimal_separator_char = pair.assert_i16()? as u8 as char; },
            "$DIMFRAC" => { verify_code(&pair, 70)?; self.dimension_text_height_scale_factor = enum_from_number!(DimensionFractionFormat, HorizontalStacking, from_i16, pair.assert_i16()?); },
            "$DIMLDRBLK" => { verify_code(&pair, 1)?; self.dimension_leader_block_name = pair.assert_string()?; },
            "$DIMLUNIT" => { verify_code(&pair, 70)?; self.dimension_non_angular_units = enum_from_number!(NonAngularUnits, Decimal, from_i16, pair.assert_i16()?); },
            "$DIMLWD" => { verify_code(&pair, 70)?; self.dimension_line_weight = LineWeight::from_raw_value(pair.assert_i16()?); },
            "$DIMLWE" => { verify_code(&pair, 70)?; self.dimension_extension_line_weight = LineWeight::from_raw_value(pair.assert_i16()?); },
            "$DIMTMOVE" => { verify_code(&pair, 70)?; self.dimension_text_movement_rule = enum_from_number!(DimensionTextMovementRule, MoveLineWithText, from_i16, pair.assert_i16()?); },
            "$DIMFXL" => { verify_code(&pair, 40)?; self.dimension_line_fixed_length = pair.assert_f64()?; },
            "$DIMFXLON" => { verify_code(&pair, 70)?; self.dimension_line_fixed_length_on = as_bool(pair.assert_i16()?); },
            "$DIMJOGANG" => { verify_code(&pair, 40)?; self.dimension_transverse_segment_angle_in_jogged_radius = pair.assert_f64()?; },
            "$DIMTFILL" => { verify_code(&pair, 70)?; self.dimension_text_background_color_mode = enum_from_number!(DimensionTextBackgroundColorMode, None, from_i16, pair.assert_i16()?); },
            "$DIMTFILLCLR" => { verify_code(&pair, 70)?; self.dxf_dimension_text_background_custom_color = Color::from_raw_value(pair.assert_i16()?); },
            "$DIMARCSYM" => { verify_code(&pair, 70)?; self.dimension_arc_symbol_display_mode = enum_from_number!(DimensionArcSymbolDisplayMode, SymbolBeforeText, from_i16, pair.assert_i16()?); },
            "$DIMLTYPE" => { verify_code(&pair, 6)?; self.dimension_line_type = pair.assert_string()?; },
            "$DIMLTEX1" => { verify_code(&pair, 6)?; self.dimension_first_extension_line_type = pair.assert_string()?; },
            "$DIMLTEX2" => { verify_code(&pair, 6)?; self.dimension_second_extension_line_type = pair.assert_string()?; },
            "$DIMTXTDIRECTION" => { verify_code(&pair, 70)?; self.dimension_text_direction = enum_from_number!(TextDirection, LeftToRight, from_i16, pair.assert_i16()?); },
            "$LUNITS" => { verify_code(&pair, 70)?; self.unit_format = enum_from_number!(UnitFormat, Decimal, from_i16, pair.assert_i16()?); },
            "$LUPREC" => { verify_code(&pair, 70)?; self.unit_precision = pair.assert_i16()?; },
            "$SKETCHINC" => { verify_code(&pair, 40)?; self.sketch_record_increment = pair.assert_f64()?; },
            "$FILLETRAD" => { verify_code(&pair, 40)?; self.fillet_radius = pair.assert_f64()?; },
            "$AUNITS" => { verify_code(&pair, 70)?; self.angle_unit_format = enum_from_number!(AngleFormat, DecimalDegrees, from_i16, pair.assert_i16()?); },
            "$AUPREC" => { verify_code(&pair, 70)?; self.angle_unit_precision = pair.assert_i16()?; },
            "$MENU" => { verify_code(&pair, 1)?; self.file_name = pair.assert_string()?; },
            "$ELEVATION" => { verify_code(&pair, 40)?; self.elevation = pair.assert_f64()?; },
            "$PELEVATION" => { verify_code(&pair, 40)?; self.paperspace_elevation = pair.assert_f64()?; },
            "$THICKNESS" => { verify_code(&pair, 40)?; self.thickness = pair.assert_f64()?; },
            "$LIMCHECK" => { verify_code(&pair, 70)?; self.use_limits_checking = as_bool(pair.assert_i16()?); },
            "$BLIPMODE" => { verify_code(&pair, 70)?; self.blip_mode = as_bool(pair.assert_i16()?); },
            "$CHAMFERA" => { verify_code(&pair, 40)?; self.first_chamfer_distance = pair.assert_f64()?; },
            "$CHAMFERB" => { verify_code(&pair, 40)?; self.second_chamfer_distance = pair.assert_f64()?; },
            "$CHAMFERC" => { verify_code(&pair, 40)?; self.chamfer_length = pair.assert_f64()?; },
            "$CHAMFERD" => { verify_code(&pair, 40)?; self.chamfer_angle = pair.assert_f64()?; },
            "$SKPOLY" => { verify_code(&pair, 70)?; self.polyline_sketch_mode = enum_from_number!(PolySketchMode, SketchLines, from_i16, pair.assert_i16()?); },
            "$TDCREATE" => { verify_code(&pair, 40)?; self.creation_date = as_datetime_local(pair.assert_f64()?); },
            "$TDUCREATE" => { verify_code(&pair, 40)?; self.creation_date_universal = as_datetime_utc(pair.assert_f64()?); },
            "$TDUPDATE" => { verify_code(&pair, 40)?; self.update_date = as_datetime_local(pair.assert_f64()?); },
            "$TDUUPDATE" => { verify_code(&pair, 40)?; self.update_date_universal = as_datetime_utc(pair.assert_f64()?); },
            "$TDINDWG" => { verify_code(&pair, 40)?; self.time_in_drawing = as_duration(pair.assert_f64()?); },
            "$TDUSRTIMER" => { verify_code(&pair, 40)?; self.user_elapsed_timer = as_duration(pair.assert_f64()?); },
            "$USRTIMER" => { verify_code(&pair, 70)?; self.user_timer_on = as_bool(pair.assert_i16()?); },
            "$ANGBASE" => { verify_code(&pair, 50)?; self.angle_zero_direction = pair.assert_f64()?; },
            "$ANGDIR" => { verify_code(&pair, 70)?; self.angle_direction = enum_from_number!(AngleDirection, CounterClockwise, from_i16, pair.assert_i16()?); },
            "$PDMODE" => { verify_code(&pair, 70)?; self.point_display_mode = i32::from(pair.assert_i16()?); },
            "$PDSIZE" => { verify_code(&pair, 40)?; self.point_display_size = pair.assert_f64()?; },
            "$PLINEWID" => { verify_code(&pair, 40)?; self.default_polyline_width = pair.assert_f64()?; },
            "$COORDS" => { verify_code(&pair, 70)?; self.coordinate_display = enum_from_number!(CoordinateDisplay, ContinuousUpdate, from_i16, pair.assert_i16()?); },
            "$SPLFRAME" => { verify_code(&pair, 70)?; self.display_spline_polygon_control = as_bool(pair.assert_i16()?); },
            "$SPLINETYPE" => { verify_code(&pair, 70)?; self.pedit_spline_curve_type = enum_from_number!(PolylineCurvedAndSmoothSurfaceType, CubicBSpline, from_i16, pair.assert_i16()?); },
            "$SPLINESEGS" => { verify_code(&pair, 70)?; self.line_segments_per_spline_patch = pair.assert_i16()?; },
            "$ATTDIA" => { verify_code(&pair, 70)?; self.show_attribute_entry_dialogs = as_bool(pair.assert_i16()?); },
            "$ATTREQ" => { verify_code(&pair, 70)?; self.prompt_for_attribute_on_insert = as_bool(pair.assert_i16()?); },
            "$HANDLING" => { verify_code(&pair, 70)?; self.handles_enabled = as_bool(pair.assert_i16()?); },
            "$HANDSEED" => { verify_code(&pair, 5)?; self.next_available_handle = pair.as_handle()?; },
            "$SURFTAB1" => { verify_code(&pair, 70)?; self.mesh_tabulations_in_first_direction = pair.assert_i16()?; },
            "$SURFTAB2" => { verify_code(&pair, 70)?; self.mesh_tabulations_in_second_direction = pair.assert_i16()?; },
            "$SURFTYPE" => { verify_code(&pair, 70)?; self.pedit_smooth_surface_type = enum_from_number!(PolylineCurvedAndSmoothSurfaceType, CubicBSpline, from_i16, pair.assert_i16()?); },
            "$SURFU" => { verify_code(&pair, 70)?; self.pedit_smooth_m_densith = pair.assert_i16()?; },
            "$SURFV" => { verify_code(&pair, 70)?; self.pedit_smooth_n_densith = pair.assert_i16()?; },
            "$UCSBASE" => { verify_code(&pair, 2)?; self.ucs_definition_name = pair.assert_string()?; },
            "$UCSNAME" => { verify_code(&pair, 2)?; self.ucs_name = pair.assert_string()?; },
            "$UCSORG" => { self.ucs_origin.set(&pair)?; },
            "$UCSXDIR" => { self.ucs_x_axis.set(&pair)?; },
            "$UCSYDIR" => { self.ucs_y_axis.set(&pair)?; },
            "$UCSORTHOREF" => { verify_code(&pair, 2)?; self.ortho_ucs_reference = pair.assert_string()?; },
            "$UCSORTHOVIEW" => { verify_code(&pair, 70)?; self.orthgraphic_view_type = enum_from_number!(OrthographicViewType, None, from_i16, pair.assert_i16()?); },
            "$UCSORGTOP" => { self.ucs_origin_top.set(&pair)?; },
            "$UCSORGBOTTOM" => { self.ucs_origin_bottom.set(&pair)?; },
            "$UCSORGLEFT" => { self.ucs_origin_left.set(&pair)?; },
            "$UCSORGRIGHT" => { self.ucs_origin_right.set(&pair)?; },
            "$UCSORGFRONT" => { self.ucs_origin_front.set(&pair)?; },
            "$UCSORGBACK" => { self.ucs_origin_back.set(&pair)?; },
            "$PUCSBASE" => { verify_code(&pair, 2)?; self.paperspace_ucs_definition_name = pair.assert_string()?; },
            "$PUCSNAME" => { verify_code(&pair, 2)?; self.paperspace_ucs_name = pair.assert_string()?; },
            "$PUCSORG" => { self.paperspace_ucs_origin.set(&pair)?; },
            "$PUCSXDIR" => { self.paperspace_x_axis.set(&pair)?; },
            "$PUCSYDIR" => { self.paperspace_y_axis.set(&pair)?; },
            "$PUCSORTHOREF" => { verify_code(&pair, 2)?; self.paperspace_ortho_ucs_reference = pair.assert_string()?; },
            "$PUCSORTHOVIEW" => { verify_code(&pair, 70)?; self.paperspace_orthographic_view_type = enum_from_number!(OrthographicViewType, None, from_i16, pair.assert_i16()?); },
            "$PUCSORGTOP" => { self.paperspace_ucs_origin_top.set(&pair)?; },
            "$PUCSORGBOTTOM" => { self.paperspace_ucs_origin_bottom.set(&pair)?; },
            "$PUCSORGLEFT" => { self.paperspace_ucs_origin_left.set(&pair)?; },
            "$PUCSORGRIGHT" => { self.paperspace_ucs_origin_right.set(&pair)?; },
            "$PUCSORGFRONT" => { self.paperspace_ucs_origin_front.set(&pair)?; },
            "$PUCSORGBACK" => { self.paperspace_ucs_origin_back.set(&pair)?; },
            "$USERI1" => { verify_code(&pair, 70)?; self.user_int1 = pair.assert_i16()?; },
            "$USERI2" => { verify_code(&pair, 70)?; self.user_int2 = pair.assert_i16()?; },
            "$USERI3" => { verify_code(&pair, 70)?; self.user_int3 = pair.assert_i16()?; },
            "$USERI4" => { verify_code(&pair, 70)?; self.user_int4 = pair.assert_i16()?; },
            "$USERI5" => { verify_code(&pair, 70)?; self.user_int5 = pair.assert_i16()?; },
            "$USERR1" => { verify_code(&pair, 40)?; self.user_real1 = pair.assert_f64()?; },
            "$USERR2" => { verify_code(&pair, 40)?; self.user_real2 = pair.assert_f64()?; },
            "$USERR3" => { verify_code(&pair, 40)?; self.user_real3 = pair.assert_f64()?; },
            "$USERR4" => { verify_code(&pair, 40)?; self.user_real4 = pair.assert_f64()?; },
            "$USERR5" => { verify_code(&pair, 40)?; self.user_real5 = pair.assert_f64()?; },
            "$WORLDVIEW" => { verify_code(&pair, 70)?; self.set_ucs_to_wcs_in_d_view_or_v_point = as_bool(pair.assert_i16()?); },
            "$SHADEDGE" => { verify_code(&pair, 70)?; self.edge_shading = enum_from_number!(ShadeEdgeMode, FacesInEntityColorEdgesInBlack, from_i16, pair.assert_i16()?); },
            "$SHADEDIF" => { verify_code(&pair, 70)?; self.percent_ambient_to_diffuse = pair.assert_i16()?; },
            "$TILEMODE" => { verify_code(&pair, 70)?; self.previous_release_tile_compatability = as_bool(pair.assert_i16()?); },
            "$MAXACTVP" => { verify_code(&pair, 70)?; self.maximum_active_viewports = pair.assert_i16()?; },
            "$PINSBASE" => { self.paperspace_insertion_base.set(&pair)?; },
            "$PLIMCHECK" => { verify_code(&pair, 70)?; self.limit_checking_in_paperspace = as_bool(pair.assert_i16()?); },
            "$PEXTMIN" => { self.paperspace_minimum_drawing_extents.set(&pair)?; },
            "$PEXTMAX" => { self.paperspace_maximum_drawing_extents.set(&pair)?; },
            "$PLIMMIN" => { self.paperspace_minimum_drawing_limits.set(&pair)?; },
            "$PLIMMAX" => { self.paperspace_maximum_drawing_limits.set(&pair)?; },
            "$UNITMODE" => { verify_code(&pair, 70)?; self.display_fractions_in_input = as_bool(pair.assert_i16()?); },
            "$VISRETAIN" => { verify_code(&pair, 70)?; self.retain_x_ref_dependent_visibility_settings = as_bool(pair.assert_i16()?); },
            "$PLINEGEN" => { verify_code(&pair, 70)?; self.is_polyline_continuous_around_verticies = as_bool(pair.assert_i16()?); },
            "$PSLTSCALE" => { verify_code(&pair, 70)?; self.scale_line_types_in_paperspace = as_bool(pair.assert_i16()?); },
            "$TREEDEPTH" => { verify_code(&pair, 70)?; self.spacial_index_max_depth = pair.assert_i16()?; },
            "$PICKSTYLE" => { verify_code(&pair, 70)?; self.pick_style = enum_from_number!(PickStyle, Group, from_i16, pair.assert_i16()?); },
            "$CMLSTYLE" => {
                match pair.code {
                    7 => self.current_multiline_style = pair.assert_string()?,
                    2 => self.current_multiline_style = pair.assert_string()?,
                    _ => return Err(DxfError::UnexpectedCodePair(pair.clone(), String::from("expected code [7, 2]"))),
                }
            },
            "$CMLJUST" => { verify_code(&pair, 70)?; self.current_multiline_justification = enum_from_number!(Justification, Top, from_i16, pair.assert_i16()?); },
            "$CMLSCALE" => { verify_code(&pair, 40)?; self.current_multiline_scale = pair.assert_f64()?; },
            "$PROXYGRAPHICS" => { verify_code(&pair, 70)?; self.save_proxy_graphics = as_bool(pair.assert_i16()?); },
            "$MEASUREMENT" => { verify_code(&pair, 70)?; self.drawing_units = enum_from_number!(DrawingUnits, English, from_i16, pair.assert_i16()?); },
            "$CELWEIGHT" => { verify_code(&pair, 370)?; self.new_object_line_weight = LineWeight::from_raw_value(pair.assert_i16()?); },
            "$ENDCAPS" => { verify_code(&pair, 280)?; self.end_cap_setting = enum_from_number!(EndCapSetting, None, from_i16, pair.assert_i16()?); },
            "$JOINSTYLE" => { verify_code(&pair, 280)?; self.lineweight_joint_setting = enum_from_number!(JoinStyle, None, from_i16, pair.assert_i16()?); },
            "$LWDISPLAY" => { verify_code(&pair, 290)?; self.display_linewieght_in_model_and_layout_tab = pair.assert_bool()?; },
            "$INSUNITS" => { verify_code(&pair, 70)?; self.default_drawing_units = enum_from_number!(Units, Unitless, from_i16, pair.assert_i16()?); },
            "$HYPERLINKBASE" => { verify_code(&pair, 1)?; self.hyperlink_base = pair.assert_string()?; },
            "$STYLESHEET" => { verify_code(&pair, 1)?; self.stylesheet = pair.assert_string()?; },
            "$XEDIT" => { verify_code(&pair, 290)?; self.can_use_in_place_reference_editing = pair.assert_bool()?; },
            "$CEPSNID" => { verify_code(&pair, 390)?; self.new_object_plot_style_handle = pair.as_handle()?; },
            "$CEPSNTYPE" => { verify_code(&pair, 380)?; self.new_object_plot_style = enum_from_number!(PlotStyle, ByLayer, from_i16, pair.assert_i16()?); },
            "$PSTYLEMODE" => { verify_code(&pair, 290)?; self.uses_color_dependent_plot_style_tables = pair.assert_bool()?; },
            "$FINGERPRINTGUID" => { verify_code(&pair, 2)?; self.fingerprint_guid = as_uuid(pair.assert_string()?); },
            "$VERSIONGUID" => { verify_code(&pair, 2)?; self.version_guid = as_uuid(pair.assert_string()?); },
            "$EXTNAMES" => { verify_code(&pair, 290)?; self.use_acad2000_symbol_table_naming = pair.assert_bool()?; },
            "$PSVPSCALE" => { verify_code(&pair, 40)?; self.viewport_view_scale_factor = pair.assert_f64()?; },
            "$OLESTARTUP" => { verify_code(&pair, 290)?; self.ole_startup = pair.assert_bool()?; },
            "$SORTENTS" => { verify_code(&pair, 280)?; self.object_sorting_methods_flags = i32::from(pair.assert_i16()?); },
            "$INDEXCTL" => { verify_code(&pair, 280)?; self.layer_and_spatial_index_save_mode = enum_from_number!(LayerAndSpatialIndexSaveMode, None, from_i16, pair.assert_i16()?); },
            "$HIDETEXT" => {
                match pair.code {
                    280 => self.hide_text_objects_when_producint_hidden_view = as_bool(pair.assert_i16()?),
                    290 => self.hide_text_objects_when_producint_hidden_view = pair.assert_bool()?,
                    _ => return Err(DxfError::UnexpectedCodePair(pair.clone(), String::from("expected code [280, 290]"))),
                }
            },
            "$XCLIPFRAME" => {
                match pair.code {
                    290 => self.is_x_ref_clipping_boundary_visible = clipping_from_bool(pair.assert_bool()?),
                    280 => self.is_x_ref_clipping_boundary_visible = enum_from_number!(XrefClippingBoundaryVisibility, DisplayedNotPlotted, from_i16, pair.assert_i16()?),
                    _ => return Err(DxfError::UnexpectedCodePair(pair.clone(), String::from("expected code [290, 280]"))),
                }
            },
            "$HALOGAP" => { verify_code(&pair, 280)?; self.halo_gap_percent = f64::from(pair.assert_i16()?); },
            "$OBSCOLOR" => { verify_code(&pair, 70)?; self.obscured_line_color = Color::from_raw_value(pair.assert_i16()?); },
            "$OBSLTYPE" => { verify_code(&pair, 280)?; self.obscured_line_type_style = enum_from_number!(LineTypeStyle, Off, from_i16, pair.assert_i16()?); },
            "$INTERSECTIONDISPLAY" => {
                match pair.code {
                    280 => self.display_intersection_polylines = as_bool(pair.assert_i16()?),
                    290 => self.display_intersection_polylines = pair.assert_bool()?,
                    _ => return Err(DxfError::UnexpectedCodePair(pair.clone(), String::from("expected code [280, 290]"))),
                }
            },
            "$INTERSECTIONCOLOR" => { verify_code(&pair, 70)?; self.intersection_polyline_color = Color::from_raw_value(pair.assert_i16()?); },
            "$DIMASSOC" => { verify_code(&pair, 280)?; self.dimension_object_associativity = enum_from_number!(DimensionAssociativity, NonAssociativeObjects, from_i16, pair.assert_i16()?); },
            "$PROJECTNAME" => { verify_code(&pair, 1)?; self.project_name = pair.assert_string()?; },
            "$CAMERADISPLAY" => { verify_code(&pair, 290)?; self.use_camera_display = pair.assert_bool()?; },
            "$LENSLENGTH" => { verify_code(&pair, 40)?; self.lens_length = pair.assert_f64()?; },
            "$CAMERAHEIGHT" => { verify_code(&pair, 40)?; self.camera_height = pair.assert_f64()?; },
            "$STEPSPERSEC" => { verify_code(&pair, 40)?; self.steps_per_second_in_walk_or_fly_mode = pair.assert_f64()?; },
            "$STEPSIZE" => { verify_code(&pair, 40)?; self.step_size_in_walk_or_fly_mode = pair.assert_f64()?; },
            "$3DDWFPREC" => { verify_code(&pair, 40)?; self.dwf_3d_precision = enum_from_number!(Dwf3DPrecision, Deviation_0_5, from_f64, pair.assert_f64()?); },
            "$PSOLWIDTH" => { verify_code(&pair, 40)?; self.last_poly_solid_width = pair.assert_f64()?; },
            "$PSOLHEIGHT" => { verify_code(&pair, 40)?; self.last_poly_solid_height = pair.assert_f64()?; },
            "$LOFTANG1" => { verify_code(&pair, 40)?; self.loft_operation_first_draft_angle = pair.assert_f64()?; },
            "$LOFTANG2" => { verify_code(&pair, 40)?; self.loft_operation_second_draft_angle = pair.assert_f64()?; },
            "$LOFTMAG1" => { verify_code(&pair, 40)?; self.loft_operation_first_magnitude = pair.assert_f64()?; },
            "$LOFTMAG2" => { verify_code(&pair, 40)?; self.loft_operation_second_magnitude = pair.assert_f64()?; },
            "$LOFTPARAM" => { verify_code(&pair, 70)?; self.loft_flags = i32::from(pair.assert_i16()?); },
            "$LOFTNORMALS" => { verify_code(&pair, 280)?; self.lofted_object_normal_mode = enum_from_number!(LoftedObjectNormalMode, SmoothFit, from_i16, pair.assert_i16()?); },
            "$LATITUDE" => { verify_code(&pair, 40)?; self.latitude = pair.assert_f64()?; },
            "$LONGITUDE" => { verify_code(&pair, 40)?; self.longitude = pair.assert_f64()?; },
            "$NORTHDIRECTION" => { verify_code(&pair, 40)?; self.angle_between_y_axis_and_north = pair.assert_f64()?; },
            "$TIMEZONE" => { verify_code(&pair, 70)?; self.time_zone = enum_from_number!(DrawingTimeZone, PacificTime_US_Canada_SanFrancisco_Vancouver, from_i16, pair.assert_i16()?); },
            "$LIGHTGLYPHDISPLAY" => { verify_code(&pair, 280)?; self.use_light_glyph_display = as_bool(pair.assert_i16()?); },
            "$TILEMODELIGHTSYNCH" => { verify_code(&pair, 280)?; self.use_tile_mode_light_sync = as_bool(pair.assert_i16()?); },
            "$CMATERIAL" => { verify_code(&pair, 347)?; self.current_material_handle = pair.as_handle()?; },
            "$SOLIDHIST" => { verify_code(&pair, 280)?; self.new_solids_contain_history = as_bool(pair.assert_i16()?); },
            "$SHOWHIST" => { verify_code(&pair, 280)?; self.solid_history_mode = enum_from_number!(SolidHistoryMode, DoesNotOverride, from_i16, pair.assert_i16()?); },
            "$DWFFRAME" => { verify_code(&pair, 280)?; self.dwf_underlay_frame_mode = enum_from_number!(UnderlayFrameMode, DisplayNoPlot, from_i16, pair.assert_i16()?); },
            "$DGNFRAME" => { verify_code(&pair, 280)?; self.dgn_underlay_frame_mode = enum_from_number!(UnderlayFrameMode, None, from_i16, pair.assert_i16()?); },
            "$REALWORLDSCALE" => { verify_code(&pair, 290)?; self.use_real_world_scale = pair.assert_bool()?; },
            "$INTERFERECOLOR" => { verify_code(&pair, 62)?; self.interference_object_color = Color::from_raw_value(pair.assert_i16()?); },
            "$INTERFEREOBJVS" => { verify_code(&pair, 345)?; self.interference_object_visual_style_pointer = pair.as_handle()?; },
            "$INTERFEREVPVS" => { verify_code(&pair, 346)?; self.interference_view_port_visual_style_pointer = pair.as_handle()?; },
            "$CSHADOW" => { verify_code(&pair, 280)?; self.shadow_mode = enum_from_number!(ShadowMode, CastsAndReceivesShadows, from_i16, pair.assert_i16()?); },
            "$SHADOWPLANELOCATION" => { verify_code(&pair, 40)?; self.shadow_plane_z_offset = pair.assert_f64()?; },
            "$AXISMODE" => { verify_code(&pair, 70)?; self.axis_on = as_bool(pair.assert_i16()?); },
            "$AXISUNIT" => { self.axis_tick_spacing.set(&pair)?; },
            "$FASTZOOM" => { verify_code(&pair, 70)?; self.fast_zoom = as_bool(pair.assert_i16()?); },
            "$GRIDMODE" => { verify_code(&pair, 70)?; self.grid_on = as_bool(pair.assert_i16()?); },
            "$GRIDUNIT" => { self.grid_spacing.set(&pair)?; },
            "$SNAPANG" => { verify_code(&pair, 50)?; self.snap_rotation_angle = pair.assert_f64()?; },
            "$SNAPBASE" => { self.snap_base_point.set(&pair)?; },
            "$SNAPISOPAIR" => { verify_code(&pair, 70)?; self.snap_isometric_plane = enum_from_number!(SnapIsometricPlane, Left, from_i16, pair.assert_i16()?); },
            "$SNAPMODE" => { verify_code(&pair, 70)?; self.snap_on = as_bool(pair.assert_i16()?); },
            "$SNAPSTYLE" => { verify_code(&pair, 70)?; self.snap_style = enum_from_number!(SnapStyle, Standard, from_i16, pair.assert_i16()?); },
            "$SNAPUNIT" => { self.snap_spacing.set(&pair)?; },
            "$VIEWCTR" => { self.view_center.set(&pair)?; },
            "$VIEWDIR" => { self.view_direction.set(&pair)?; },
            "$VIEWSIZE" => { verify_code(&pair, 40)?; self.view_height = pair.assert_f64()?; },
            _ => (),
        }

        Ok(())
    }
    #[allow(clippy::cognitive_complexity)] // long function, no good way to simplify this
    pub(crate) fn write_code_pairs<T>(&self, writer: &mut CodePairWriter<T>) -> DxfResult<()>
        where T: Write + ?Sized {

        // $ACADVER
        writer.write_code_pair(&CodePair::new_str(9, "$ACADVER"))?;
        writer.write_code_pair(&CodePair::new_string(1, &self.version.to_string()))?;

        // $ACADMAINTVER
        if self.version >= AcadVersion::R14 {
            writer.write_code_pair(&CodePair::new_str(9, "$ACADMAINTVER"))?;
            writer.write_code_pair(&CodePair::new_i16(70, self.maintenance_version))?;
        }

        // $DWGCODEPAGE
        if self.version >= AcadVersion::R13 {
            writer.write_code_pair(&CodePair::new_str(9, "$DWGCODEPAGE"))?;
            writer.write_code_pair(&CodePair::new_string(3, &self.drawing_code_page))?;
        }

        // $LASTSAVEDBY
        if self.version >= AcadVersion::R2004 {
            writer.write_code_pair(&CodePair::new_str(9, "$LASTSAVEDBY"))?;
            writer.write_code_pair(&CodePair::new_string(1, &self.last_saved_by))?;
        }

        // $REQUIREDVERSIONS
        if self.version >= AcadVersion::R2013 {
            writer.write_code_pair(&CodePair::new_str(9, "$REQUIREDVERSIONS"))?;
            writer.write_code_pair(&CodePair::new_i64(160, self.required_versions))?;
        }

        // $INSBASE
        writer.write_code_pair(&CodePair::new_str(9, "$INSBASE"))?;
        writer.write_code_pair(&CodePair::new_f64(10, self.insertion_base.x))?;
        writer.write_code_pair(&CodePair::new_f64(20, self.insertion_base.y))?;
        writer.write_code_pair(&CodePair::new_f64(30, self.insertion_base.z))?;

        // $EXTMIN
        writer.write_code_pair(&CodePair::new_str(9, "$EXTMIN"))?;
        writer.write_code_pair(&CodePair::new_f64(10, self.minimum_drawing_extents.x))?;
        writer.write_code_pair(&CodePair::new_f64(20, self.minimum_drawing_extents.y))?;
        writer.write_code_pair(&CodePair::new_f64(30, self.minimum_drawing_extents.z))?;

        // $EXTMAX
        writer.write_code_pair(&CodePair::new_str(9, "$EXTMAX"))?;
        writer.write_code_pair(&CodePair::new_f64(10, self.maximum_drawing_extents.x))?;
        writer.write_code_pair(&CodePair::new_f64(20, self.maximum_drawing_extents.y))?;
        writer.write_code_pair(&CodePair::new_f64(30, self.maximum_drawing_extents.z))?;

        // $LIMMIN
        writer.write_code_pair(&CodePair::new_str(9, "$LIMMIN"))?;
        writer.write_code_pair(&CodePair::new_f64(10, self.minimum_drawing_limits.x))?;
        writer.write_code_pair(&CodePair::new_f64(20, self.minimum_drawing_limits.y))?;

        // $LIMMAX
        writer.write_code_pair(&CodePair::new_str(9, "$LIMMAX"))?;
        writer.write_code_pair(&CodePair::new_f64(10, self.maximum_drawing_limits.x))?;
        writer.write_code_pair(&CodePair::new_f64(20, self.maximum_drawing_limits.y))?;

        // $ORTHOMODE
        writer.write_code_pair(&CodePair::new_str(9, "$ORTHOMODE"))?;
        writer.write_code_pair(&CodePair::new_i16(70, as_i16(self.draw_orthogonal_lines)))?;

        // $REGENMODE
        writer.write_code_pair(&CodePair::new_str(9, "$REGENMODE"))?;
        writer.write_code_pair(&CodePair::new_i16(70, as_i16(self.use_regen_mode)))?;

        // $FILLMODE
        writer.write_code_pair(&CodePair::new_str(9, "$FILLMODE"))?;
        writer.write_code_pair(&CodePair::new_i16(70, as_i16(self.fill_mode_on)))?;

        // $QTEXTMODE
        writer.write_code_pair(&CodePair::new_str(9, "$QTEXTMODE"))?;
        writer.write_code_pair(&CodePair::new_i16(70, as_i16(self.use_quick_text_mode)))?;

        // $MIRRTEXT
        writer.write_code_pair(&CodePair::new_str(9, "$MIRRTEXT"))?;
        writer.write_code_pair(&CodePair::new_i16(70, as_i16(self.mirror_text)))?;

        // $DRAGMODE
        if self.version <= AcadVersion::R14 {
            writer.write_code_pair(&CodePair::new_str(9, "$DRAGMODE"))?;
            writer.write_code_pair(&CodePair::new_i16(70, self.drag_mode as i16))?;
        }

        // $LTSCALE
        writer.write_code_pair(&CodePair::new_str(9, "$LTSCALE"))?;
        writer.write_code_pair(&CodePair::new_f64(40, self.line_type_scale))?;

        // $OSMODE
        if self.version <= AcadVersion::R14 {
            writer.write_code_pair(&CodePair::new_str(9, "$OSMODE"))?;
            writer.write_code_pair(&CodePair::new_i16(70, self.object_snap_flags as i16))?;
        }

        // $ATTMODE
        writer.write_code_pair(&CodePair::new_str(9, "$ATTMODE"))?;
        writer.write_code_pair(&CodePair::new_i16(70, self.attribute_visibility as i16))?;

        // $TEXTSIZE
        writer.write_code_pair(&CodePair::new_str(9, "$TEXTSIZE"))?;
        writer.write_code_pair(&CodePair::new_f64(40, self.default_text_height))?;

        // $TRACEWID
        writer.write_code_pair(&CodePair::new_str(9, "$TRACEWID"))?;
        writer.write_code_pair(&CodePair::new_f64(40, self.trace_width))?;

        // $TEXTSTYLE
        writer.write_code_pair(&CodePair::new_str(9, "$TEXTSTYLE"))?;
        writer.write_code_pair(&CodePair::new_string(7, &self.text_style))?;

        // $CLAYER
        writer.write_code_pair(&CodePair::new_str(9, "$CLAYER"))?;
        writer.write_code_pair(&CodePair::new_string(8, &self.current_layer))?;

        // $CELTYPE
        writer.write_code_pair(&CodePair::new_str(9, "$CELTYPE"))?;
        writer.write_code_pair(&CodePair::new_string(6, &self.current_entity_line_type))?;

        // $CECOLOR
        writer.write_code_pair(&CodePair::new_str(9, "$CECOLOR"))?;
        writer.write_code_pair(&CodePair::new_i16(62, self.current_entity_color.get_raw_value()))?;

        // $CELTSCALE
        if self.version >= AcadVersion::R13 {
            writer.write_code_pair(&CodePair::new_str(9, "$CELTSCALE"))?;
            writer.write_code_pair(&CodePair::new_f64(40, self.current_entity_line_type_scale))?;
        }

        // $DELOBJ
        if self.version >= AcadVersion::R13 && self.version <= AcadVersion::R14 {
            writer.write_code_pair(&CodePair::new_str(9, "$DELOBJ"))?;
            writer.write_code_pair(&CodePair::new_i16(70, as_i16(self.retain_deleted_objects)))?;
        }

        // $DISPSILH
        if self.version >= AcadVersion::R13 {
            writer.write_code_pair(&CodePair::new_str(9, "$DISPSILH"))?;
            writer.write_code_pair(&CodePair::new_i16(70, as_i16(self.display_silhouette_curves_in_wireframe_mode)))?;
        }

        // $DRAGVS
        if self.version >= AcadVersion::R2007 && self.solid_visual_style_pointer != Handle::empty() {
            writer.write_code_pair(&CodePair::new_str(9, "$DRAGVS"))?;
            writer.write_code_pair(&CodePair::new_string(349, &self.solid_visual_style_pointer.as_string()))?;
        }

        // $DIMSCALE
        writer.write_code_pair(&CodePair::new_str(9, "$DIMSCALE"))?;
        writer.write_code_pair(&CodePair::new_f64(40, self.dimensioning_scale_factor))?;

        // $DIMASZ
        writer.write_code_pair(&CodePair::new_str(9, "$DIMASZ"))?;
        writer.write_code_pair(&CodePair::new_f64(40, self.dimensioning_arrow_size))?;

        // $DIMEXO
        writer.write_code_pair(&CodePair::new_str(9, "$DIMEXO"))?;
        writer.write_code_pair(&CodePair::new_f64(40, self.dimension_extension_line_offset))?;

        // $DIMDLI
        writer.write_code_pair(&CodePair::new_str(9, "$DIMDLI"))?;
        writer.write_code_pair(&CodePair::new_f64(40, self.dimension_line_increment))?;

        // $DIMRND
        writer.write_code_pair(&CodePair::new_str(9, "$DIMRND"))?;
        writer.write_code_pair(&CodePair::new_f64(40, self.dimension_distance_rounding_value))?;

        // $DIMDLE
        writer.write_code_pair(&CodePair::new_str(9, "$DIMDLE"))?;
        writer.write_code_pair(&CodePair::new_f64(40, self.dimension_line_extension))?;

        // $DIMEXE
        writer.write_code_pair(&CodePair::new_str(9, "$DIMEXE"))?;
        writer.write_code_pair(&CodePair::new_f64(40, self.dimension_extension_line_extension))?;

        // $DIMTP
        writer.write_code_pair(&CodePair::new_str(9, "$DIMTP"))?;
        writer.write_code_pair(&CodePair::new_f64(40, self.dimension_plus_tolerance))?;

        // $DIMTM
        writer.write_code_pair(&CodePair::new_str(9, "$DIMTM"))?;
        writer.write_code_pair(&CodePair::new_f64(40, self.dimension_minus_tolerance))?;

        // $DIMTXT
        writer.write_code_pair(&CodePair::new_str(9, "$DIMTXT"))?;
        writer.write_code_pair(&CodePair::new_f64(40, self.dimensioning_text_height))?;

        // $DIMCEN
        writer.write_code_pair(&CodePair::new_str(9, "$DIMCEN"))?;
        writer.write_code_pair(&CodePair::new_f64(40, self.center_mark_size))?;

        // $DIMTSZ
        writer.write_code_pair(&CodePair::new_str(9, "$DIMTSZ"))?;
        writer.write_code_pair(&CodePair::new_f64(40, self.dimensioning_tick_size))?;

        // $DIMTOL
        writer.write_code_pair(&CodePair::new_str(9, "$DIMTOL"))?;
        writer.write_code_pair(&CodePair::new_i16(70, as_i16(self.generate_dimension_tolerances)))?;

        // $DIMLIM
        writer.write_code_pair(&CodePair::new_str(9, "$DIMLIM"))?;
        writer.write_code_pair(&CodePair::new_i16(70, as_i16(self.generate_dimension_limits)))?;

        // $DIMTIH
        writer.write_code_pair(&CodePair::new_str(9, "$DIMTIH"))?;
        writer.write_code_pair(&CodePair::new_i16(70, as_i16(self.dimension_text_inside_horizontal)))?;

        // $DIMTOH
        writer.write_code_pair(&CodePair::new_str(9, "$DIMTOH"))?;
        writer.write_code_pair(&CodePair::new_i16(70, as_i16(self.dimension_text_outside_horizontal)))?;

        // $DIMSE1
        if self.version >= AcadVersion::R12 {
            writer.write_code_pair(&CodePair::new_str(9, "$DIMSE1"))?;
            writer.write_code_pair(&CodePair::new_i16(70, as_i16(self.suppress_first_dimension_extension_line)))?;
        }

        // $DIMSE2
        if self.version >= AcadVersion::R12 {
            writer.write_code_pair(&CodePair::new_str(9, "$DIMSE2"))?;
            writer.write_code_pair(&CodePair::new_i16(70, as_i16(self.suppress_second_dimension_extension_line)))?;
        }

        // $DIMTAD
        writer.write_code_pair(&CodePair::new_str(9, "$DIMTAD"))?;
        writer.write_code_pair(&CodePair::new_i16(70, as_i16(self.text_above_dimension_line)))?;

        // $DIMZIN
        writer.write_code_pair(&CodePair::new_str(9, "$DIMZIN"))?;
        writer.write_code_pair(&CodePair::new_i16(70, self.dimension_unit_zero_suppression as i16))?;

        // $DIMBLK
        writer.write_code_pair(&CodePair::new_str(9, "$DIMBLK"))?;
        writer.write_code_pair(&CodePair::new_string(1, &self.arrow_block_name))?;

        // $DIMASO
        writer.write_code_pair(&CodePair::new_str(9, "$DIMASO"))?;
        writer.write_code_pair(&CodePair::new_i16(70, as_i16(self.create_associative_dimensioning)))?;

        // $DIMSHO
        writer.write_code_pair(&CodePair::new_str(9, "$DIMSHO"))?;
        writer.write_code_pair(&CodePair::new_i16(70, as_i16(self.recompute_dimensions_while_dragging)))?;

        // $DIMPOST
        writer.write_code_pair(&CodePair::new_str(9, "$DIMPOST"))?;
        writer.write_code_pair(&CodePair::new_string(1, &self.dimensioning_suffix))?;

        // $DIMAPOST
        writer.write_code_pair(&CodePair::new_str(9, "$DIMAPOST"))?;
        writer.write_code_pair(&CodePair::new_string(1, &self.alternate_dimensioning_suffix))?;

        // $DIMALT
        writer.write_code_pair(&CodePair::new_str(9, "$DIMALT"))?;
        writer.write_code_pair(&CodePair::new_i16(70, as_i16(self.use_alternate_dimensioning)))?;

        // $DIMALTD
        writer.write_code_pair(&CodePair::new_str(9, "$DIMALTD"))?;
        writer.write_code_pair(&CodePair::new_i16(70, self.alternate_dimensioning_decimal_places))?;

        // $DIMALTF
        writer.write_code_pair(&CodePair::new_str(9, "$DIMALTF"))?;
        writer.write_code_pair(&CodePair::new_f64(40, self.alternate_dimensioning_scale_factor))?;

        // $DIMLFAC
        writer.write_code_pair(&CodePair::new_str(9, "$DIMLFAC"))?;
        writer.write_code_pair(&CodePair::new_f64(40, self.dimension_linear_measurements_scale_factor))?;

        // $DIMTOFL
        writer.write_code_pair(&CodePair::new_str(9, "$DIMTOFL"))?;
        writer.write_code_pair(&CodePair::new_i16(70, as_i16(self.force_dimension_line_extensions_outside_if_text_is)))?;

        // $DIMTVP
        writer.write_code_pair(&CodePair::new_str(9, "$DIMTVP"))?;
        writer.write_code_pair(&CodePair::new_f64(40, self.dimension_vertical_text_position))?;

        // $DIMTIX
        writer.write_code_pair(&CodePair::new_str(9, "$DIMTIX"))?;
        writer.write_code_pair(&CodePair::new_i16(70, as_i16(self.force_dimension_text_inside_extensions)))?;

        // $DIMSOXD
        writer.write_code_pair(&CodePair::new_str(9, "$DIMSOXD"))?;
        writer.write_code_pair(&CodePair::new_i16(70, as_i16(self.suppress_outside_extension_dimension_lines)))?;

        // $DIMSAH
        writer.write_code_pair(&CodePair::new_str(9, "$DIMSAH"))?;
        writer.write_code_pair(&CodePair::new_i16(70, as_i16(self.use_separate_arrow_blocks_for_dimensions)))?;

        // $DIMBLK1
        writer.write_code_pair(&CodePair::new_str(9, "$DIMBLK1"))?;
        writer.write_code_pair(&CodePair::new_string(1, &self.first_arrow_block_name))?;

        // $DIMBLK2
        writer.write_code_pair(&CodePair::new_str(9, "$DIMBLK2"))?;
        writer.write_code_pair(&CodePair::new_string(1, &self.second_arrow_block_name))?;

        // $DIMSTYLE
        writer.write_code_pair(&CodePair::new_str(9, "$DIMSTYLE"))?;
        writer.write_code_pair(&CodePair::new_string(2, &self.dimension_style_name))?;

        // $DIMCLRD
        if self.version >= AcadVersion::R11 {
            writer.write_code_pair(&CodePair::new_str(9, "$DIMCLRD"))?;
            writer.write_code_pair(&CodePair::new_i16(70, self.dimension_line_color.get_raw_value()))?;
        }

        // $DIMCLRE
        if self.version >= AcadVersion::R11 {
            writer.write_code_pair(&CodePair::new_str(9, "$DIMCLRE"))?;
            writer.write_code_pair(&CodePair::new_i16(70, self.dimension_extension_line_color.get_raw_value()))?;
        }

        // $DIMCLRT
        if self.version >= AcadVersion::R11 {
            writer.write_code_pair(&CodePair::new_str(9, "$DIMCLRT"))?;
            writer.write_code_pair(&CodePair::new_i16(70, self.dimension_text_color.get_raw_value()))?;
        }

        // $DIMTFAC
        if self.version >= AcadVersion::R12 {
            writer.write_code_pair(&CodePair::new_str(9, "$DIMTFAC"))?;
            writer.write_code_pair(&CodePair::new_f64(40, self.dimension_tolerance_display_scale_factor))?;
        }

        // $DIMGAP
        if self.version >= AcadVersion::R11 {
            writer.write_code_pair(&CodePair::new_str(9, "$DIMGAP"))?;
            writer.write_code_pair(&CodePair::new_f64(40, self.dimension_line_gap))?;
        }

        // $DIMJUST
        if self.version >= AcadVersion::R13 {
            writer.write_code_pair(&CodePair::new_str(9, "$DIMJUST"))?;
            writer.write_code_pair(&CodePair::new_i16(70, self.dimension_text_justification as i16))?;
        }

        // $DIMSD1
        if self.version >= AcadVersion::R13 {
            writer.write_code_pair(&CodePair::new_str(9, "$DIMSD1"))?;
            writer.write_code_pair(&CodePair::new_i16(70, as_i16(self.suppress_first_dimension_extension_line)))?;
        }

        // $DIMSD2
        if self.version >= AcadVersion::R13 {
            writer.write_code_pair(&CodePair::new_str(9, "$DIMSD2"))?;
            writer.write_code_pair(&CodePair::new_i16(70, as_i16(self.suppress_second_dimension_extension_line)))?;
        }

        // $DIMTOLJ
        if self.version >= AcadVersion::R13 {
            writer.write_code_pair(&CodePair::new_str(9, "$DIMTOLJ"))?;
            writer.write_code_pair(&CodePair::new_i16(70, self.dimension_tolerance_vertical_justification as i16))?;
        }

        // $DIMTZIN
        if self.version >= AcadVersion::R13 {
            writer.write_code_pair(&CodePair::new_str(9, "$DIMTZIN"))?;
            writer.write_code_pair(&CodePair::new_i16(70, self.dimension_tolerance_zero_suppression as i16))?;
        }

        // $DIMALTZ
        if self.version >= AcadVersion::R13 {
            writer.write_code_pair(&CodePair::new_str(9, "$DIMALTZ"))?;
            writer.write_code_pair(&CodePair::new_i16(70, self.alternate_dimensioning_zero_supression as i16))?;
        }

        // $DIMALTTZ
        if self.version >= AcadVersion::R13 {
            writer.write_code_pair(&CodePair::new_str(9, "$DIMALTTZ"))?;
            writer.write_code_pair(&CodePair::new_i16(70, self.alternate_dimensioning_tolerance_zero_supression as i16))?;
        }

        // $DIMFIT
        if self.version >= AcadVersion::R13 && self.version <= AcadVersion::R14 {
            writer.write_code_pair(&CodePair::new_str(9, "$DIMFIT"))?;
            writer.write_code_pair(&CodePair::new_i16(70, self.dimension_text_and_arrow_placement as i16))?;
        }

        // $DIMUPT
        if self.version >= AcadVersion::R13 {
            writer.write_code_pair(&CodePair::new_str(9, "$DIMUPT"))?;
            writer.write_code_pair(&CodePair::new_i16(70, as_i16(self.dimension_cursor_controls_text_position)))?;
        }

        // $DIMUNIT
        if self.version >= AcadVersion::R13 && self.version <= AcadVersion::R14 {
            writer.write_code_pair(&CodePair::new_str(9, "$DIMUNIT"))?;
            writer.write_code_pair(&CodePair::new_i16(70, self.dimension_unit_format as i16))?;
        }

        // $DIMDEC
        if self.version >= AcadVersion::R13 {
            writer.write_code_pair(&CodePair::new_str(9, "$DIMDEC"))?;
            writer.write_code_pair(&CodePair::new_i16(70, self.dimension_unit_tolerance_decimal_places))?;
        }

        // $DIMTDEC
        if self.version >= AcadVersion::R13 {
            writer.write_code_pair(&CodePair::new_str(9, "$DIMTDEC"))?;
            writer.write_code_pair(&CodePair::new_i16(70, self.dimension_tolerance_decimal_places))?;
        }

        // $DIMALTU
        if self.version >= AcadVersion::R13 {
            writer.write_code_pair(&CodePair::new_str(9, "$DIMALTU"))?;
            writer.write_code_pair(&CodePair::new_i16(70, self.alternate_dimensioning_units as i16))?;
        }

        // $DIMALTTD
        if self.version >= AcadVersion::R13 {
            writer.write_code_pair(&CodePair::new_str(9, "$DIMALTTD"))?;
            writer.write_code_pair(&CodePair::new_i16(70, self.alternate_dimensioning_tolerance_decimal_places))?;
        }

        // $DIMTXSTY
        if self.version >= AcadVersion::R13 {
            writer.write_code_pair(&CodePair::new_str(9, "$DIMTXSTY"))?;
            writer.write_code_pair(&CodePair::new_string(7, &self.dimension_text_style))?;
        }

        // $DIMAUNIT
        if self.version >= AcadVersion::R13 {
            writer.write_code_pair(&CodePair::new_str(9, "$DIMAUNIT"))?;
            writer.write_code_pair(&CodePair::new_i16(70, self.dimensioning_angle_format as i16))?;
        }

        // $DIMADEC
        if self.version >= AcadVersion::R2000 {
            writer.write_code_pair(&CodePair::new_str(9, "$DIMADEC"))?;
            writer.write_code_pair(&CodePair::new_i16(70, self.angular_dimension_precision))?;
        }

        // $DIMALTRND
        if self.version >= AcadVersion::R2000 {
            writer.write_code_pair(&CodePair::new_str(9, "$DIMALTRND"))?;
            writer.write_code_pair(&CodePair::new_f64(40, self.alternate_dimensioning_unit_rounding))?;
        }

        // $DIMAZIN
        if self.version >= AcadVersion::R2000 {
            writer.write_code_pair(&CodePair::new_str(9, "$DIMAZIN"))?;
            writer.write_code_pair(&CodePair::new_i16(70, self.dimension_angle_zero_suppression as i16))?;
        }

        // $DIMDSEP
        if self.version >= AcadVersion::R2000 {
            writer.write_code_pair(&CodePair::new_str(9, "$DIMDSEP"))?;
            writer.write_code_pair(&CodePair::new_i16(70, self.dimension_decimal_separator_char as i16))?;
        }

        // $DIMATFIT
        if self.version >= AcadVersion::R2000 {
            writer.write_code_pair(&CodePair::new_str(9, "$DIMATFIT"))?;
            writer.write_code_pair(&CodePair::new_i16(70, self.dimension_text_and_arrow_placement as i16))?;
        }

        // $DIMFRAC
        if self.version >= AcadVersion::R2000 {
            writer.write_code_pair(&CodePair::new_str(9, "$DIMFRAC"))?;
            writer.write_code_pair(&CodePair::new_i16(70, self.dimension_text_height_scale_factor as i16))?;
        }

        // $DIMLDRBLK
        if self.version >= AcadVersion::R2000 {
            writer.write_code_pair(&CodePair::new_str(9, "$DIMLDRBLK"))?;
            writer.write_code_pair(&CodePair::new_string(1, &self.dimension_leader_block_name))?;
        }

        // $DIMLUNIT
        if self.version >= AcadVersion::R2000 {
            writer.write_code_pair(&CodePair::new_str(9, "$DIMLUNIT"))?;
            writer.write_code_pair(&CodePair::new_i16(70, self.dimension_non_angular_units as i16))?;
        }

        // $DIMLWD
        if self.version >= AcadVersion::R2000 {
            writer.write_code_pair(&CodePair::new_str(9, "$DIMLWD"))?;
            writer.write_code_pair(&CodePair::new_i16(70, self.dimension_line_weight.get_raw_value()))?;
        }

        // $DIMLWE
        if self.version >= AcadVersion::R2000 {
            writer.write_code_pair(&CodePair::new_str(9, "$DIMLWE"))?;
            writer.write_code_pair(&CodePair::new_i16(70, self.dimension_extension_line_weight.get_raw_value()))?;
        }

        // $DIMTMOVE
        if self.version >= AcadVersion::R2000 {
            writer.write_code_pair(&CodePair::new_str(9, "$DIMTMOVE"))?;
            writer.write_code_pair(&CodePair::new_i16(70, self.dimension_text_movement_rule as i16))?;
        }

        // $DIMFXL
        if self.version >= AcadVersion::R2007 {
            writer.write_code_pair(&CodePair::new_str(9, "$DIMFXL"))?;
            writer.write_code_pair(&CodePair::new_f64(40, self.dimension_line_fixed_length))?;
        }

        // $DIMFXLON
        if self.version >= AcadVersion::R2007 {
            writer.write_code_pair(&CodePair::new_str(9, "$DIMFXLON"))?;
            writer.write_code_pair(&CodePair::new_i16(70, as_i16(self.dimension_line_fixed_length_on)))?;
        }

        // $DIMJOGANG
        if self.version >= AcadVersion::R2007 {
            writer.write_code_pair(&CodePair::new_str(9, "$DIMJOGANG"))?;
            writer.write_code_pair(&CodePair::new_f64(40, self.dimension_transverse_segment_angle_in_jogged_radius))?;
        }

        // $DIMTFILL
        if self.version >= AcadVersion::R2007 {
            writer.write_code_pair(&CodePair::new_str(9, "$DIMTFILL"))?;
            writer.write_code_pair(&CodePair::new_i16(70, self.dimension_text_background_color_mode as i16))?;
        }

        // $DIMTFILLCLR
        if self.version >= AcadVersion::R2007 {
            writer.write_code_pair(&CodePair::new_str(9, "$DIMTFILLCLR"))?;
            writer.write_code_pair(&CodePair::new_i16(70, self.dxf_dimension_text_background_custom_color.get_raw_value()))?;
        }

        // $DIMARCSYM
        if self.version >= AcadVersion::R2007 {
            writer.write_code_pair(&CodePair::new_str(9, "$DIMARCSYM"))?;
            writer.write_code_pair(&CodePair::new_i16(70, self.dimension_arc_symbol_display_mode as i16))?;
        }

        // $DIMLTYPE
        if self.version >= AcadVersion::R2007 {
            writer.write_code_pair(&CodePair::new_str(9, "$DIMLTYPE"))?;
            writer.write_code_pair(&CodePair::new_string(6, &self.dimension_line_type))?;
        }

        // $DIMLTEX1
        if self.version >= AcadVersion::R2007 {
            writer.write_code_pair(&CodePair::new_str(9, "$DIMLTEX1"))?;
            writer.write_code_pair(&CodePair::new_string(6, &self.dimension_first_extension_line_type))?;
        }

        // $DIMLTEX2
        if self.version >= AcadVersion::R2007 {
            writer.write_code_pair(&CodePair::new_str(9, "$DIMLTEX2"))?;
            writer.write_code_pair(&CodePair::new_string(6, &self.dimension_second_extension_line_type))?;
        }

        // $DIMTXTDIRECTION
        if self.version >= AcadVersion::R2010 {
            writer.write_code_pair(&CodePair::new_str(9, "$DIMTXTDIRECTION"))?;
            writer.write_code_pair(&CodePair::new_i16(70, self.dimension_text_direction as i16))?;
        }

        // $LUNITS
        writer.write_code_pair(&CodePair::new_str(9, "$LUNITS"))?;
        writer.write_code_pair(&CodePair::new_i16(70, self.unit_format as i16))?;

        // $LUPREC
        writer.write_code_pair(&CodePair::new_str(9, "$LUPREC"))?;
        writer.write_code_pair(&CodePair::new_i16(70, self.unit_precision))?;

        // $SKETCHINC
        writer.write_code_pair(&CodePair::new_str(9, "$SKETCHINC"))?;
        writer.write_code_pair(&CodePair::new_f64(40, self.sketch_record_increment))?;

        // $FILLETRAD
        writer.write_code_pair(&CodePair::new_str(9, "$FILLETRAD"))?;
        writer.write_code_pair(&CodePair::new_f64(40, self.fillet_radius))?;

        // $AUNITS
        writer.write_code_pair(&CodePair::new_str(9, "$AUNITS"))?;
        writer.write_code_pair(&CodePair::new_i16(70, self.angle_unit_format as i16))?;

        // $AUPREC
        writer.write_code_pair(&CodePair::new_str(9, "$AUPREC"))?;
        writer.write_code_pair(&CodePair::new_i16(70, self.angle_unit_precision))?;

        // $MENU
        writer.write_code_pair(&CodePair::new_str(9, "$MENU"))?;
        writer.write_code_pair(&CodePair::new_string(1, &self.file_name))?;

        // $ELEVATION
        writer.write_code_pair(&CodePair::new_str(9, "$ELEVATION"))?;
        writer.write_code_pair(&CodePair::new_f64(40, self.elevation))?;

        // $PELEVATION
        if self.version >= AcadVersion::R11 {
            writer.write_code_pair(&CodePair::new_str(9, "$PELEVATION"))?;
            writer.write_code_pair(&CodePair::new_f64(40, self.paperspace_elevation))?;
        }

        // $THICKNESS
        writer.write_code_pair(&CodePair::new_str(9, "$THICKNESS"))?;
        writer.write_code_pair(&CodePair::new_f64(40, self.thickness))?;

        // $LIMCHECK
        writer.write_code_pair(&CodePair::new_str(9, "$LIMCHECK"))?;
        writer.write_code_pair(&CodePair::new_i16(70, as_i16(self.use_limits_checking)))?;

        // $BLIPMODE
        if self.version <= AcadVersion::R14 {
            writer.write_code_pair(&CodePair::new_str(9, "$BLIPMODE"))?;
            writer.write_code_pair(&CodePair::new_i16(70, as_i16(self.blip_mode)))?;
        }

        // $CHAMFERA
        writer.write_code_pair(&CodePair::new_str(9, "$CHAMFERA"))?;
        writer.write_code_pair(&CodePair::new_f64(40, self.first_chamfer_distance))?;

        // $CHAMFERB
        writer.write_code_pair(&CodePair::new_str(9, "$CHAMFERB"))?;
        writer.write_code_pair(&CodePair::new_f64(40, self.second_chamfer_distance))?;

        // $CHAMFERC
        if self.version >= AcadVersion::R14 {
            writer.write_code_pair(&CodePair::new_str(9, "$CHAMFERC"))?;
            writer.write_code_pair(&CodePair::new_f64(40, self.chamfer_length))?;
        }

        // $CHAMFERD
        if self.version >= AcadVersion::R14 {
            writer.write_code_pair(&CodePair::new_str(9, "$CHAMFERD"))?;
            writer.write_code_pair(&CodePair::new_f64(40, self.chamfer_angle))?;
        }

        // $SKPOLY
        writer.write_code_pair(&CodePair::new_str(9, "$SKPOLY"))?;
        writer.write_code_pair(&CodePair::new_i16(70, self.polyline_sketch_mode as i16))?;

        // $TDCREATE
        writer.write_code_pair(&CodePair::new_str(9, "$TDCREATE"))?;
        writer.write_code_pair(&CodePair::new_f64(40, as_double_local(self.creation_date)))?;

        // $TDUCREATE
        if self.version >= AcadVersion::R2000 {
            writer.write_code_pair(&CodePair::new_str(9, "$TDUCREATE"))?;
            writer.write_code_pair(&CodePair::new_f64(40, as_double_utc(self.creation_date_universal)))?;
        }

        // $TDUPDATE
        writer.write_code_pair(&CodePair::new_str(9, "$TDUPDATE"))?;
        writer.write_code_pair(&CodePair::new_f64(40, as_double_local(self.update_date)))?;

        // $TDUUPDATE
        if self.version >= AcadVersion::R2000 {
            writer.write_code_pair(&CodePair::new_str(9, "$TDUUPDATE"))?;
            writer.write_code_pair(&CodePair::new_f64(40, as_double_utc(self.update_date_universal)))?;
        }

        // $TDINDWG
        writer.write_code_pair(&CodePair::new_str(9, "$TDINDWG"))?;
        writer.write_code_pair(&CodePair::new_f64(40, duration_as_double(self.time_in_drawing)))?;

        // $TDUSRTIMER
        writer.write_code_pair(&CodePair::new_str(9, "$TDUSRTIMER"))?;
        writer.write_code_pair(&CodePair::new_f64(40, duration_as_double(self.user_elapsed_timer)))?;

        // $USRTIMER
        writer.write_code_pair(&CodePair::new_str(9, "$USRTIMER"))?;
        writer.write_code_pair(&CodePair::new_i16(70, as_i16(self.user_timer_on)))?;

        // $ANGBASE
        writer.write_code_pair(&CodePair::new_str(9, "$ANGBASE"))?;
        writer.write_code_pair(&CodePair::new_f64(50, self.angle_zero_direction))?;

        // $ANGDIR
        writer.write_code_pair(&CodePair::new_str(9, "$ANGDIR"))?;
        writer.write_code_pair(&CodePair::new_i16(70, self.angle_direction as i16))?;

        // $PDMODE
        writer.write_code_pair(&CodePair::new_str(9, "$PDMODE"))?;
        writer.write_code_pair(&CodePair::new_i16(70, self.point_display_mode as i16))?;

        // $PDSIZE
        writer.write_code_pair(&CodePair::new_str(9, "$PDSIZE"))?;
        writer.write_code_pair(&CodePair::new_f64(40, self.point_display_size))?;

        // $PLINEWID
        writer.write_code_pair(&CodePair::new_str(9, "$PLINEWID"))?;
        writer.write_code_pair(&CodePair::new_f64(40, self.default_polyline_width))?;

        // $COORDS
        if self.version <= AcadVersion::R14 {
            writer.write_code_pair(&CodePair::new_str(9, "$COORDS"))?;
            writer.write_code_pair(&CodePair::new_i16(70, self.coordinate_display as i16))?;
        }

        // $SPLFRAME
        if self.version <= AcadVersion::R2013 {
            writer.write_code_pair(&CodePair::new_str(9, "$SPLFRAME"))?;
            writer.write_code_pair(&CodePair::new_i16(70, as_i16(self.display_spline_polygon_control)))?;
        }

        // $SPLINETYPE
        writer.write_code_pair(&CodePair::new_str(9, "$SPLINETYPE"))?;
        writer.write_code_pair(&CodePair::new_i16(70, self.pedit_spline_curve_type as i16))?;

        // $SPLINESEGS
        writer.write_code_pair(&CodePair::new_str(9, "$SPLINESEGS"))?;
        writer.write_code_pair(&CodePair::new_i16(70, self.line_segments_per_spline_patch))?;

        // $ATTDIA
        if self.version <= AcadVersion::R14 {
            writer.write_code_pair(&CodePair::new_str(9, "$ATTDIA"))?;
            writer.write_code_pair(&CodePair::new_i16(70, as_i16(self.show_attribute_entry_dialogs)))?;
        }

        // $ATTREQ
        if self.version <= AcadVersion::R14 {
            writer.write_code_pair(&CodePair::new_str(9, "$ATTREQ"))?;
            writer.write_code_pair(&CodePair::new_i16(70, as_i16(self.prompt_for_attribute_on_insert)))?;
        }

        // $HANDLING
        if self.version <= AcadVersion::R12 {
            writer.write_code_pair(&CodePair::new_str(9, "$HANDLING"))?;
            writer.write_code_pair(&CodePair::new_i16(70, as_i16(self.handles_enabled)))?;
        }

        // $HANDSEED
        writer.write_code_pair(&CodePair::new_str(9, "$HANDSEED"))?;
        writer.write_code_pair(&CodePair::new_string(5, &self.next_available_handle.as_string()))?;

        // $SURFTAB1
        writer.write_code_pair(&CodePair::new_str(9, "$SURFTAB1"))?;
        writer.write_code_pair(&CodePair::new_i16(70, self.mesh_tabulations_in_first_direction))?;

        // $SURFTAB2
        writer.write_code_pair(&CodePair::new_str(9, "$SURFTAB2"))?;
        writer.write_code_pair(&CodePair::new_i16(70, self.mesh_tabulations_in_second_direction))?;

        // $SURFTYPE
        writer.write_code_pair(&CodePair::new_str(9, "$SURFTYPE"))?;
        writer.write_code_pair(&CodePair::new_i16(70, self.pedit_smooth_surface_type as i16))?;

        // $SURFU
        writer.write_code_pair(&CodePair::new_str(9, "$SURFU"))?;
        writer.write_code_pair(&CodePair::new_i16(70, self.pedit_smooth_m_densith))?;

        // $SURFV
        writer.write_code_pair(&CodePair::new_str(9, "$SURFV"))?;
        writer.write_code_pair(&CodePair::new_i16(70, self.pedit_smooth_n_densith))?;

        // $UCSBASE
        if self.version >= AcadVersion::R2000 {
            writer.write_code_pair(&CodePair::new_str(9, "$UCSBASE"))?;
            writer.write_code_pair(&CodePair::new_string(2, &self.ucs_definition_name))?;
        }

        // $UCSNAME
        writer.write_code_pair(&CodePair::new_str(9, "$UCSNAME"))?;
        writer.write_code_pair(&CodePair::new_string(2, &self.ucs_name))?;

        // $UCSORG
        writer.write_code_pair(&CodePair::new_str(9, "$UCSORG"))?;
        writer.write_code_pair(&CodePair::new_f64(10, self.ucs_origin.x))?;
        writer.write_code_pair(&CodePair::new_f64(20, self.ucs_origin.y))?;
        writer.write_code_pair(&CodePair::new_f64(30, self.ucs_origin.z))?;

        // $UCSXDIR
        writer.write_code_pair(&CodePair::new_str(9, "$UCSXDIR"))?;
        writer.write_code_pair(&CodePair::new_f64(10, self.ucs_x_axis.x))?;
        writer.write_code_pair(&CodePair::new_f64(20, self.ucs_x_axis.y))?;
        writer.write_code_pair(&CodePair::new_f64(30, self.ucs_x_axis.z))?;

        // $UCSYDIR
        writer.write_code_pair(&CodePair::new_str(9, "$UCSYDIR"))?;
        writer.write_code_pair(&CodePair::new_f64(10, self.ucs_y_axis.x))?;
        writer.write_code_pair(&CodePair::new_f64(20, self.ucs_y_axis.y))?;
        writer.write_code_pair(&CodePair::new_f64(30, self.ucs_y_axis.z))?;

        // $UCSORTHOREF
        if self.version >= AcadVersion::R2000 {
            writer.write_code_pair(&CodePair::new_str(9, "$UCSORTHOREF"))?;
            writer.write_code_pair(&CodePair::new_string(2, &self.ortho_ucs_reference))?;
        }

        // $UCSORTHOVIEW
        if self.version >= AcadVersion::R2000 {
            writer.write_code_pair(&CodePair::new_str(9, "$UCSORTHOVIEW"))?;
            writer.write_code_pair(&CodePair::new_i16(70, self.orthgraphic_view_type as i16))?;
        }

        // $UCSORGTOP
        if self.version >= AcadVersion::R2000 {
            writer.write_code_pair(&CodePair::new_str(9, "$UCSORGTOP"))?;
            writer.write_code_pair(&CodePair::new_f64(10, self.ucs_origin_top.x))?;
            writer.write_code_pair(&CodePair::new_f64(20, self.ucs_origin_top.y))?;
            writer.write_code_pair(&CodePair::new_f64(30, self.ucs_origin_top.z))?;
        }

        // $UCSORGBOTTOM
        if self.version >= AcadVersion::R2000 {
            writer.write_code_pair(&CodePair::new_str(9, "$UCSORGBOTTOM"))?;
            writer.write_code_pair(&CodePair::new_f64(10, self.ucs_origin_bottom.x))?;
            writer.write_code_pair(&CodePair::new_f64(20, self.ucs_origin_bottom.y))?;
            writer.write_code_pair(&CodePair::new_f64(30, self.ucs_origin_bottom.z))?;
        }

        // $UCSORGLEFT
        if self.version >= AcadVersion::R2000 {
            writer.write_code_pair(&CodePair::new_str(9, "$UCSORGLEFT"))?;
            writer.write_code_pair(&CodePair::new_f64(10, self.ucs_origin_left.x))?;
            writer.write_code_pair(&CodePair::new_f64(20, self.ucs_origin_left.y))?;
            writer.write_code_pair(&CodePair::new_f64(30, self.ucs_origin_left.z))?;
        }

        // $UCSORGRIGHT
        if self.version >= AcadVersion::R2000 {
            writer.write_code_pair(&CodePair::new_str(9, "$UCSORGRIGHT"))?;
            writer.write_code_pair(&CodePair::new_f64(10, self.ucs_origin_right.x))?;
            writer.write_code_pair(&CodePair::new_f64(20, self.ucs_origin_right.y))?;
            writer.write_code_pair(&CodePair::new_f64(30, self.ucs_origin_right.z))?;
        }

        // $UCSORGFRONT
        if self.version >= AcadVersion::R2000 {
            writer.write_code_pair(&CodePair::new_str(9, "$UCSORGFRONT"))?;
            writer.write_code_pair(&CodePair::new_f64(10, self.ucs_origin_front.x))?;
            writer.write_code_pair(&CodePair::new_f64(20, self.ucs_origin_front.y))?;
            writer.write_code_pair(&CodePair::new_f64(30, self.ucs_origin_front.z))?;
        }

        // $UCSORGBACK
        if self.version >= AcadVersion::R2000 {
            writer.write_code_pair(&CodePair::new_str(9, "$UCSORGBACK"))?;
            writer.write_code_pair(&CodePair::new_f64(10, self.ucs_origin_back.x))?;
            writer.write_code_pair(&CodePair::new_f64(20, self.ucs_origin_back.y))?;
            writer.write_code_pair(&CodePair::new_f64(30, self.ucs_origin_back.z))?;
        }

        // $PUCSBASE
        if self.version >= AcadVersion::R2000 {
            writer.write_code_pair(&CodePair::new_str(9, "$PUCSBASE"))?;
            writer.write_code_pair(&CodePair::new_string(2, &self.paperspace_ucs_definition_name))?;
        }

        // $PUCSNAME
        if self.version >= AcadVersion::R11 {
            writer.write_code_pair(&CodePair::new_str(9, "$PUCSNAME"))?;
            writer.write_code_pair(&CodePair::new_string(2, &self.paperspace_ucs_name))?;
        }

        // $PUCSORG
        if self.version >= AcadVersion::R11 {
            writer.write_code_pair(&CodePair::new_str(9, "$PUCSORG"))?;
            writer.write_code_pair(&CodePair::new_f64(10, self.paperspace_ucs_origin.x))?;
            writer.write_code_pair(&CodePair::new_f64(20, self.paperspace_ucs_origin.y))?;
            writer.write_code_pair(&CodePair::new_f64(30, self.paperspace_ucs_origin.z))?;
        }

        // $PUCSXDIR
        if self.version >= AcadVersion::R11 {
            writer.write_code_pair(&CodePair::new_str(9, "$PUCSXDIR"))?;
            writer.write_code_pair(&CodePair::new_f64(10, self.paperspace_x_axis.x))?;
            writer.write_code_pair(&CodePair::new_f64(20, self.paperspace_x_axis.y))?;
            writer.write_code_pair(&CodePair::new_f64(30, self.paperspace_x_axis.z))?;
        }

        // $PUCSYDIR
        if self.version >= AcadVersion::R11 {
            writer.write_code_pair(&CodePair::new_str(9, "$PUCSYDIR"))?;
            writer.write_code_pair(&CodePair::new_f64(10, self.paperspace_y_axis.x))?;
            writer.write_code_pair(&CodePair::new_f64(20, self.paperspace_y_axis.y))?;
            writer.write_code_pair(&CodePair::new_f64(30, self.paperspace_y_axis.z))?;
        }

        // $PUCSORTHOREF
        if self.version >= AcadVersion::R2000 {
            writer.write_code_pair(&CodePair::new_str(9, "$PUCSORTHOREF"))?;
            writer.write_code_pair(&CodePair::new_string(2, &self.paperspace_ortho_ucs_reference))?;
        }

        // $PUCSORTHOVIEW
        if self.version >= AcadVersion::R2000 {
            writer.write_code_pair(&CodePair::new_str(9, "$PUCSORTHOVIEW"))?;
            writer.write_code_pair(&CodePair::new_i16(70, self.paperspace_orthographic_view_type as i16))?;
        }

        // $PUCSORGTOP
        if self.version >= AcadVersion::R2000 {
            writer.write_code_pair(&CodePair::new_str(9, "$PUCSORGTOP"))?;
            writer.write_code_pair(&CodePair::new_f64(10, self.paperspace_ucs_origin_top.x))?;
            writer.write_code_pair(&CodePair::new_f64(20, self.paperspace_ucs_origin_top.y))?;
            writer.write_code_pair(&CodePair::new_f64(30, self.paperspace_ucs_origin_top.z))?;
        }

        // $PUCSORGBOTTOM
        if self.version >= AcadVersion::R2000 {
            writer.write_code_pair(&CodePair::new_str(9, "$PUCSORGBOTTOM"))?;
            writer.write_code_pair(&CodePair::new_f64(10, self.paperspace_ucs_origin_bottom.x))?;
            writer.write_code_pair(&CodePair::new_f64(20, self.paperspace_ucs_origin_bottom.y))?;
            writer.write_code_pair(&CodePair::new_f64(30, self.paperspace_ucs_origin_bottom.z))?;
        }

        // $PUCSORGLEFT
        if self.version >= AcadVersion::R2000 {
            writer.write_code_pair(&CodePair::new_str(9, "$PUCSORGLEFT"))?;
            writer.write_code_pair(&CodePair::new_f64(10, self.paperspace_ucs_origin_left.x))?;
            writer.write_code_pair(&CodePair::new_f64(20, self.paperspace_ucs_origin_left.y))?;
            writer.write_code_pair(&CodePair::new_f64(30, self.paperspace_ucs_origin_left.z))?;
        }

        // $PUCSORGRIGHT
        if self.version >= AcadVersion::R2000 {
            writer.write_code_pair(&CodePair::new_str(9, "$PUCSORGRIGHT"))?;
            writer.write_code_pair(&CodePair::new_f64(10, self.paperspace_ucs_origin_right.x))?;
            writer.write_code_pair(&CodePair::new_f64(20, self.paperspace_ucs_origin_right.y))?;
            writer.write_code_pair(&CodePair::new_f64(30, self.paperspace_ucs_origin_right.z))?;
        }

        // $PUCSORGFRONT
        if self.version >= AcadVersion::R2000 {
            writer.write_code_pair(&CodePair::new_str(9, "$PUCSORGFRONT"))?;
            writer.write_code_pair(&CodePair::new_f64(10, self.paperspace_ucs_origin_front.x))?;
            writer.write_code_pair(&CodePair::new_f64(20, self.paperspace_ucs_origin_front.y))?;
            writer.write_code_pair(&CodePair::new_f64(30, self.paperspace_ucs_origin_front.z))?;
        }

        // $PUCSORGBACK
        if self.version >= AcadVersion::R2000 {
            writer.write_code_pair(&CodePair::new_str(9, "$PUCSORGBACK"))?;
            writer.write_code_pair(&CodePair::new_f64(10, self.paperspace_ucs_origin_back.x))?;
            writer.write_code_pair(&CodePair::new_f64(20, self.paperspace_ucs_origin_back.y))?;
            writer.write_code_pair(&CodePair::new_f64(30, self.paperspace_ucs_origin_back.z))?;
        }

        // $USERI1
        writer.write_code_pair(&CodePair::new_str(9, "$USERI1"))?;
        writer.write_code_pair(&CodePair::new_i16(70, self.user_int1))?;

        // $USERI2
        writer.write_code_pair(&CodePair::new_str(9, "$USERI2"))?;
        writer.write_code_pair(&CodePair::new_i16(70, self.user_int2))?;

        // $USERI3
        writer.write_code_pair(&CodePair::new_str(9, "$USERI3"))?;
        writer.write_code_pair(&CodePair::new_i16(70, self.user_int3))?;

        // $USERI4
        writer.write_code_pair(&CodePair::new_str(9, "$USERI4"))?;
        writer.write_code_pair(&CodePair::new_i16(70, self.user_int4))?;

        // $USERI5
        writer.write_code_pair(&CodePair::new_str(9, "$USERI5"))?;
        writer.write_code_pair(&CodePair::new_i16(70, self.user_int5))?;

        // $USERR1
        writer.write_code_pair(&CodePair::new_str(9, "$USERR1"))?;
        writer.write_code_pair(&CodePair::new_f64(40, self.user_real1))?;

        // $USERR2
        writer.write_code_pair(&CodePair::new_str(9, "$USERR2"))?;
        writer.write_code_pair(&CodePair::new_f64(40, self.user_real2))?;

        // $USERR3
        writer.write_code_pair(&CodePair::new_str(9, "$USERR3"))?;
        writer.write_code_pair(&CodePair::new_f64(40, self.user_real3))?;

        // $USERR4
        writer.write_code_pair(&CodePair::new_str(9, "$USERR4"))?;
        writer.write_code_pair(&CodePair::new_f64(40, self.user_real4))?;

        // $USERR5
        writer.write_code_pair(&CodePair::new_str(9, "$USERR5"))?;
        writer.write_code_pair(&CodePair::new_f64(40, self.user_real5))?;

        // $WORLDVIEW
        writer.write_code_pair(&CodePair::new_str(9, "$WORLDVIEW"))?;
        writer.write_code_pair(&CodePair::new_i16(70, as_i16(self.set_ucs_to_wcs_in_d_view_or_v_point)))?;

        // $SHADEDGE
        if self.version >= AcadVersion::R11 {
            writer.write_code_pair(&CodePair::new_str(9, "$SHADEDGE"))?;
            writer.write_code_pair(&CodePair::new_i16(70, self.edge_shading as i16))?;
        }

        // $SHADEDIF
        if self.version >= AcadVersion::R11 {
            writer.write_code_pair(&CodePair::new_str(9, "$SHADEDIF"))?;
            writer.write_code_pair(&CodePair::new_i16(70, self.percent_ambient_to_diffuse))?;
        }

        // $TILEMODE
        if self.version >= AcadVersion::R11 {
            writer.write_code_pair(&CodePair::new_str(9, "$TILEMODE"))?;
            writer.write_code_pair(&CodePair::new_i16(70, as_i16(self.previous_release_tile_compatability)))?;
        }

        // $MAXACTVP
        if self.version >= AcadVersion::R11 {
            writer.write_code_pair(&CodePair::new_str(9, "$MAXACTVP"))?;
            writer.write_code_pair(&CodePair::new_i16(70, self.maximum_active_viewports))?;
        }

        // $PINSBASE
        if self.version >= AcadVersion::R14 {
            writer.write_code_pair(&CodePair::new_str(9, "$PINSBASE"))?;
            writer.write_code_pair(&CodePair::new_f64(10, self.paperspace_insertion_base.x))?;
            writer.write_code_pair(&CodePair::new_f64(20, self.paperspace_insertion_base.y))?;
            writer.write_code_pair(&CodePair::new_f64(30, self.paperspace_insertion_base.z))?;
        }

        // $PLIMCHECK
        if self.version >= AcadVersion::R11 {
            writer.write_code_pair(&CodePair::new_str(9, "$PLIMCHECK"))?;
            writer.write_code_pair(&CodePair::new_i16(70, as_i16(self.limit_checking_in_paperspace)))?;
        }

        // $PEXTMIN
        if self.version >= AcadVersion::R11 {
            writer.write_code_pair(&CodePair::new_str(9, "$PEXTMIN"))?;
            writer.write_code_pair(&CodePair::new_f64(10, self.paperspace_minimum_drawing_extents.x))?;
            writer.write_code_pair(&CodePair::new_f64(20, self.paperspace_minimum_drawing_extents.y))?;
            writer.write_code_pair(&CodePair::new_f64(30, self.paperspace_minimum_drawing_extents.z))?;
        }

        // $PEXTMAX
        if self.version >= AcadVersion::R11 {
            writer.write_code_pair(&CodePair::new_str(9, "$PEXTMAX"))?;
            writer.write_code_pair(&CodePair::new_f64(10, self.paperspace_maximum_drawing_extents.x))?;
            writer.write_code_pair(&CodePair::new_f64(20, self.paperspace_maximum_drawing_extents.y))?;
            writer.write_code_pair(&CodePair::new_f64(30, self.paperspace_maximum_drawing_extents.z))?;
        }

        // $PLIMMIN
        if self.version >= AcadVersion::R11 {
            writer.write_code_pair(&CodePair::new_str(9, "$PLIMMIN"))?;
            writer.write_code_pair(&CodePair::new_f64(10, self.paperspace_minimum_drawing_limits.x))?;
            writer.write_code_pair(&CodePair::new_f64(20, self.paperspace_minimum_drawing_limits.y))?;
        }

        // $PLIMMAX
        if self.version >= AcadVersion::R11 {
            writer.write_code_pair(&CodePair::new_str(9, "$PLIMMAX"))?;
            writer.write_code_pair(&CodePair::new_f64(10, self.paperspace_maximum_drawing_limits.x))?;
            writer.write_code_pair(&CodePair::new_f64(20, self.paperspace_maximum_drawing_limits.y))?;
        }

        // $UNITMODE
        if self.version >= AcadVersion::R11 {
            writer.write_code_pair(&CodePair::new_str(9, "$UNITMODE"))?;
            writer.write_code_pair(&CodePair::new_i16(70, as_i16(self.display_fractions_in_input)))?;
        }

        // $VISRETAIN
        if self.version >= AcadVersion::R12 {
            writer.write_code_pair(&CodePair::new_str(9, "$VISRETAIN"))?;
            writer.write_code_pair(&CodePair::new_i16(70, as_i16(self.retain_x_ref_dependent_visibility_settings)))?;
        }

        // $PLINEGEN
        if self.version >= AcadVersion::R11 {
            writer.write_code_pair(&CodePair::new_str(9, "$PLINEGEN"))?;
            writer.write_code_pair(&CodePair::new_i16(70, as_i16(self.is_polyline_continuous_around_verticies)))?;
        }

        // $PSLTSCALE
        if self.version >= AcadVersion::R11 {
            writer.write_code_pair(&CodePair::new_str(9, "$PSLTSCALE"))?;
            writer.write_code_pair(&CodePair::new_i16(70, as_i16(self.scale_line_types_in_paperspace)))?;
        }

        // $TREEDEPTH
        if self.version >= AcadVersion::R14 {
            writer.write_code_pair(&CodePair::new_str(9, "$TREEDEPTH"))?;
            writer.write_code_pair(&CodePair::new_i16(70, self.spacial_index_max_depth))?;
        }

        // $PICKSTYLE
        if self.version >= AcadVersion::R13 && self.version <= AcadVersion::R14 {
            writer.write_code_pair(&CodePair::new_str(9, "$PICKSTYLE"))?;
            writer.write_code_pair(&CodePair::new_i16(70, self.pick_style as i16))?;
        }

        // $CMLSTYLE
        if self.version >= AcadVersion::R13 && self.version <= AcadVersion::R13 {
            writer.write_code_pair(&CodePair::new_str(9, "$CMLSTYLE"))?;
            writer.write_code_pair(&CodePair::new_string(7, &self.current_multiline_style))?;
        }

        // $CMLSTYLE
        if self.version >= AcadVersion::R14 {
            writer.write_code_pair(&CodePair::new_str(9, "$CMLSTYLE"))?;
            writer.write_code_pair(&CodePair::new_string(2, &self.current_multiline_style))?;
        }

        // $CMLJUST
        if self.version >= AcadVersion::R13 {
            writer.write_code_pair(&CodePair::new_str(9, "$CMLJUST"))?;
            writer.write_code_pair(&CodePair::new_i16(70, self.current_multiline_justification as i16))?;
        }

        // $CMLSCALE
        if self.version >= AcadVersion::R13 {
            writer.write_code_pair(&CodePair::new_str(9, "$CMLSCALE"))?;
            writer.write_code_pair(&CodePair::new_f64(40, self.current_multiline_scale))?;
        }

        // $PROXYGRAPHICS
        if self.version >= AcadVersion::R14 {
            writer.write_code_pair(&CodePair::new_str(9, "$PROXYGRAPHICS"))?;
            writer.write_code_pair(&CodePair::new_i16(70, as_i16(self.save_proxy_graphics)))?;
        }

        // $MEASUREMENT
        if self.version >= AcadVersion::R14 {
            writer.write_code_pair(&CodePair::new_str(9, "$MEASUREMENT"))?;
            writer.write_code_pair(&CodePair::new_i16(70, self.drawing_units as i16))?;
        }

        // $CELWEIGHT
        if self.version >= AcadVersion::R2000 {
            writer.write_code_pair(&CodePair::new_str(9, "$CELWEIGHT"))?;
            writer.write_code_pair(&CodePair::new_i16(370, self.new_object_line_weight.get_raw_value()))?;
        }

        // $ENDCAPS
        if self.version >= AcadVersion::R2000 {
            writer.write_code_pair(&CodePair::new_str(9, "$ENDCAPS"))?;
            writer.write_code_pair(&CodePair::new_i16(280, self.end_cap_setting as i16))?;
        }

        // $JOINSTYLE
        if self.version >= AcadVersion::R2000 {
            writer.write_code_pair(&CodePair::new_str(9, "$JOINSTYLE"))?;
            writer.write_code_pair(&CodePair::new_i16(280, self.lineweight_joint_setting as i16))?;
        }

        // $LWDISPLAY
        if self.version >= AcadVersion::R2000 {
            writer.write_code_pair(&CodePair::new_str(9, "$LWDISPLAY"))?;
            writer.write_code_pair(&CodePair::new_bool(290, self.display_linewieght_in_model_and_layout_tab))?;
        }

        // $INSUNITS
        if self.version >= AcadVersion::R2000 {
            writer.write_code_pair(&CodePair::new_str(9, "$INSUNITS"))?;
            writer.write_code_pair(&CodePair::new_i16(70, self.default_drawing_units as i16))?;
        }

        // $HYPERLINKBASE
        if self.version >= AcadVersion::R2000 {
            writer.write_code_pair(&CodePair::new_str(9, "$HYPERLINKBASE"))?;
            writer.write_code_pair(&CodePair::new_string(1, &self.hyperlink_base))?;
        }

        // $STYLESHEET
        if self.version >= AcadVersion::R2000 {
            writer.write_code_pair(&CodePair::new_str(9, "$STYLESHEET"))?;
            writer.write_code_pair(&CodePair::new_string(1, &self.stylesheet))?;
        }

        // $XEDIT
        if self.version >= AcadVersion::R2000 {
            writer.write_code_pair(&CodePair::new_str(9, "$XEDIT"))?;
            writer.write_code_pair(&CodePair::new_bool(290, self.can_use_in_place_reference_editing))?;
        }

        // $CEPSNID
        if self.version >= AcadVersion::R2000 && self.new_object_plot_style_handle != Handle::empty() {
            writer.write_code_pair(&CodePair::new_str(9, "$CEPSNID"))?;
            writer.write_code_pair(&CodePair::new_string(390, &self.new_object_plot_style_handle.as_string()))?;
        }

        // $CEPSNTYPE
        if self.version >= AcadVersion::R2000 {
            writer.write_code_pair(&CodePair::new_str(9, "$CEPSNTYPE"))?;
            writer.write_code_pair(&CodePair::new_i16(380, self.new_object_plot_style as i16))?;
        }

        // $PSTYLEMODE
        if self.version >= AcadVersion::R2000 {
            writer.write_code_pair(&CodePair::new_str(9, "$PSTYLEMODE"))?;
            writer.write_code_pair(&CodePair::new_bool(290, self.uses_color_dependent_plot_style_tables))?;
        }

        // $FINGERPRINTGUID
        if self.version >= AcadVersion::R2000 {
            writer.write_code_pair(&CodePair::new_str(9, "$FINGERPRINTGUID"))?;
            writer.write_code_pair(&CodePair::new_string(2, &uuid_string(&self.fingerprint_guid)))?;
        }

        // $VERSIONGUID
        if self.version >= AcadVersion::R2000 {
            writer.write_code_pair(&CodePair::new_str(9, "$VERSIONGUID"))?;
            writer.write_code_pair(&CodePair::new_string(2, &uuid_string(&self.version_guid)))?;
        }

        // $EXTNAMES
        if self.version >= AcadVersion::R2000 {
            writer.write_code_pair(&CodePair::new_str(9, "$EXTNAMES"))?;
            writer.write_code_pair(&CodePair::new_bool(290, self.use_acad2000_symbol_table_naming))?;
        }

        // $PSVPSCALE
        if self.version >= AcadVersion::R2000 {
            writer.write_code_pair(&CodePair::new_str(9, "$PSVPSCALE"))?;
            writer.write_code_pair(&CodePair::new_f64(40, self.viewport_view_scale_factor))?;
        }

        // $OLESTARTUP
        if self.version >= AcadVersion::R2000 {
            writer.write_code_pair(&CodePair::new_str(9, "$OLESTARTUP"))?;
            writer.write_code_pair(&CodePair::new_bool(290, self.ole_startup))?;
        }

        // $SORTENTS
        if self.version >= AcadVersion::R2004 {
            writer.write_code_pair(&CodePair::new_str(9, "$SORTENTS"))?;
            writer.write_code_pair(&CodePair::new_i16(280, self.object_sorting_methods_flags as i16))?;
        }

        // $INDEXCTL
        if self.version >= AcadVersion::R2004 {
            writer.write_code_pair(&CodePair::new_str(9, "$INDEXCTL"))?;
            writer.write_code_pair(&CodePair::new_i16(280, self.layer_and_spatial_index_save_mode as i16))?;
        }

        // $HIDETEXT
        if self.version >= AcadVersion::R2004 {
            writer.write_code_pair(&CodePair::new_str(9, "$HIDETEXT"))?;
            writer.write_code_pair(&CodePair::new_i16(280, as_i16(self.hide_text_objects_when_producint_hidden_view)))?;
        }

        // $XCLIPFRAME
        if self.version >= AcadVersion::R2004 && self.version <= AcadVersion::R2007 {
            writer.write_code_pair(&CodePair::new_str(9, "$XCLIPFRAME"))?;
            writer.write_code_pair(&CodePair::new_bool(290, bool_from_clipping(self.is_x_ref_clipping_boundary_visible)))?;
        }

        // $XCLIPFRAME
        if self.version >= AcadVersion::R2010 {
            writer.write_code_pair(&CodePair::new_str(9, "$XCLIPFRAME"))?;
            writer.write_code_pair(&CodePair::new_i16(280, self.is_x_ref_clipping_boundary_visible as i16))?;
        }

        // $HALOGAP
        if self.version >= AcadVersion::R2004 {
            writer.write_code_pair(&CodePair::new_str(9, "$HALOGAP"))?;
            writer.write_code_pair(&CodePair::new_i16(280, self.halo_gap_percent as i16))?;
        }

        // $OBSCOLOR
        if self.version >= AcadVersion::R2004 {
            writer.write_code_pair(&CodePair::new_str(9, "$OBSCOLOR"))?;
            writer.write_code_pair(&CodePair::new_i16(70, self.obscured_line_color.get_raw_value()))?;
        }

        // $OBSLTYPE
        if self.version >= AcadVersion::R2004 {
            writer.write_code_pair(&CodePair::new_str(9, "$OBSLTYPE"))?;
            writer.write_code_pair(&CodePair::new_i16(280, self.obscured_line_type_style as i16))?;
        }

        // $INTERSECTIONDISPLAY
        if self.version >= AcadVersion::R2004 {
            writer.write_code_pair(&CodePair::new_str(9, "$INTERSECTIONDISPLAY"))?;
            writer.write_code_pair(&CodePair::new_i16(280, as_i16(self.display_intersection_polylines)))?;
        }

        // $INTERSECTIONCOLOR
        if self.version >= AcadVersion::R2004 {
            writer.write_code_pair(&CodePair::new_str(9, "$INTERSECTIONCOLOR"))?;
            writer.write_code_pair(&CodePair::new_i16(70, self.intersection_polyline_color.get_raw_value()))?;
        }

        // $DIMASSOC
        if self.version >= AcadVersion::R2004 {
            writer.write_code_pair(&CodePair::new_str(9, "$DIMASSOC"))?;
            writer.write_code_pair(&CodePair::new_i16(280, self.dimension_object_associativity as i16))?;
        }

        // $PROJECTNAME
        if self.version >= AcadVersion::R2004 {
            writer.write_code_pair(&CodePair::new_str(9, "$PROJECTNAME"))?;
            writer.write_code_pair(&CodePair::new_string(1, &self.project_name))?;
        }

        // $CAMERADISPLAY
        if self.version >= AcadVersion::R2007 {
            writer.write_code_pair(&CodePair::new_str(9, "$CAMERADISPLAY"))?;
            writer.write_code_pair(&CodePair::new_bool(290, self.use_camera_display))?;
        }

        // $LENSLENGTH
        if self.version >= AcadVersion::R2007 {
            writer.write_code_pair(&CodePair::new_str(9, "$LENSLENGTH"))?;
            writer.write_code_pair(&CodePair::new_f64(40, self.lens_length))?;
        }

        // $CAMERAHEIGHT
        if self.version >= AcadVersion::R2007 {
            writer.write_code_pair(&CodePair::new_str(9, "$CAMERAHEIGHT"))?;
            writer.write_code_pair(&CodePair::new_f64(40, self.camera_height))?;
        }

        // $STEPSPERSEC
        if self.version >= AcadVersion::R2007 {
            writer.write_code_pair(&CodePair::new_str(9, "$STEPSPERSEC"))?;
            writer.write_code_pair(&CodePair::new_f64(40, self.steps_per_second_in_walk_or_fly_mode))?;
        }

        // $STEPSIZE
        if self.version >= AcadVersion::R2007 {
            writer.write_code_pair(&CodePair::new_str(9, "$STEPSIZE"))?;
            writer.write_code_pair(&CodePair::new_f64(40, self.step_size_in_walk_or_fly_mode))?;
        }

        // $3DDWFPREC
        if self.version >= AcadVersion::R2007 {
            writer.write_code_pair(&CodePair::new_str(9, "$3DDWFPREC"))?;
            writer.write_code_pair(&CodePair::new_f64(40, f64::from(self.dwf_3d_precision as i32)))?;
        }

        // $PSOLWIDTH
        if self.version >= AcadVersion::R2007 {
            writer.write_code_pair(&CodePair::new_str(9, "$PSOLWIDTH"))?;
            writer.write_code_pair(&CodePair::new_f64(40, self.last_poly_solid_width))?;
        }

        // $PSOLHEIGHT
        if self.version >= AcadVersion::R2007 {
            writer.write_code_pair(&CodePair::new_str(9, "$PSOLHEIGHT"))?;
            writer.write_code_pair(&CodePair::new_f64(40, self.last_poly_solid_height))?;
        }

        // $LOFTANG1
        if self.version >= AcadVersion::R2007 {
            writer.write_code_pair(&CodePair::new_str(9, "$LOFTANG1"))?;
            writer.write_code_pair(&CodePair::new_f64(40, self.loft_operation_first_draft_angle))?;
        }

        // $LOFTANG2
        if self.version >= AcadVersion::R2007 {
            writer.write_code_pair(&CodePair::new_str(9, "$LOFTANG2"))?;
            writer.write_code_pair(&CodePair::new_f64(40, self.loft_operation_second_draft_angle))?;
        }

        // $LOFTMAG1
        if self.version >= AcadVersion::R2007 {
            writer.write_code_pair(&CodePair::new_str(9, "$LOFTMAG1"))?;
            writer.write_code_pair(&CodePair::new_f64(40, self.loft_operation_first_magnitude))?;
        }

        // $LOFTMAG2
        if self.version >= AcadVersion::R2007 {
            writer.write_code_pair(&CodePair::new_str(9, "$LOFTMAG2"))?;
            writer.write_code_pair(&CodePair::new_f64(40, self.loft_operation_second_magnitude))?;
        }

        // $LOFTPARAM
        if self.version >= AcadVersion::R2007 {
            writer.write_code_pair(&CodePair::new_str(9, "$LOFTPARAM"))?;
            writer.write_code_pair(&CodePair::new_i16(70, self.loft_flags as i16))?;
        }

        // $LOFTNORMALS
        if self.version >= AcadVersion::R2007 {
            writer.write_code_pair(&CodePair::new_str(9, "$LOFTNORMALS"))?;
            writer.write_code_pair(&CodePair::new_i16(280, self.lofted_object_normal_mode as i16))?;
        }

        // $LATITUDE
        if self.version >= AcadVersion::R2007 {
            writer.write_code_pair(&CodePair::new_str(9, "$LATITUDE"))?;
            writer.write_code_pair(&CodePair::new_f64(40, self.latitude))?;
        }

        // $LONGITUDE
        if self.version >= AcadVersion::R2007 {
            writer.write_code_pair(&CodePair::new_str(9, "$LONGITUDE"))?;
            writer.write_code_pair(&CodePair::new_f64(40, self.longitude))?;
        }

        // $NORTHDIRECTION
        if self.version >= AcadVersion::R2007 {
            writer.write_code_pair(&CodePair::new_str(9, "$NORTHDIRECTION"))?;
            writer.write_code_pair(&CodePair::new_f64(40, self.angle_between_y_axis_and_north))?;
        }

        // $TIMEZONE
        if self.version >= AcadVersion::R2007 {
            writer.write_code_pair(&CodePair::new_str(9, "$TIMEZONE"))?;
            writer.write_code_pair(&CodePair::new_i16(70, self.time_zone as i16))?;
        }

        // $LIGHTGLYPHDISPLAY
        if self.version >= AcadVersion::R2007 {
            writer.write_code_pair(&CodePair::new_str(9, "$LIGHTGLYPHDISPLAY"))?;
            writer.write_code_pair(&CodePair::new_i16(280, as_i16(self.use_light_glyph_display)))?;
        }

        // $TILEMODELIGHTSYNCH
        if self.version >= AcadVersion::R2007 {
            writer.write_code_pair(&CodePair::new_str(9, "$TILEMODELIGHTSYNCH"))?;
            writer.write_code_pair(&CodePair::new_i16(280, as_i16(self.use_tile_mode_light_sync)))?;
        }

        // $CMATERIAL
        if self.version >= AcadVersion::R2007 && self.current_material_handle != Handle::empty() {
            writer.write_code_pair(&CodePair::new_str(9, "$CMATERIAL"))?;
            writer.write_code_pair(&CodePair::new_string(347, &self.current_material_handle.as_string()))?;
        }

        // $SOLIDHIST
        if self.version >= AcadVersion::R2007 {
            writer.write_code_pair(&CodePair::new_str(9, "$SOLIDHIST"))?;
            writer.write_code_pair(&CodePair::new_i16(280, as_i16(self.new_solids_contain_history)))?;
        }

        // $SHOWHIST
        if self.version >= AcadVersion::R2007 {
            writer.write_code_pair(&CodePair::new_str(9, "$SHOWHIST"))?;
            writer.write_code_pair(&CodePair::new_i16(280, self.solid_history_mode as i16))?;
        }

        // $DWFFRAME
        if self.version >= AcadVersion::R2007 {
            writer.write_code_pair(&CodePair::new_str(9, "$DWFFRAME"))?;
            writer.write_code_pair(&CodePair::new_i16(280, self.dwf_underlay_frame_mode as i16))?;
        }

        // $DGNFRAME
        if self.version >= AcadVersion::R2007 {
            writer.write_code_pair(&CodePair::new_str(9, "$DGNFRAME"))?;
            writer.write_code_pair(&CodePair::new_i16(280, self.dgn_underlay_frame_mode as i16))?;
        }

        // $REALWORLDSCALE
        if self.version >= AcadVersion::R2007 {
            writer.write_code_pair(&CodePair::new_str(9, "$REALWORLDSCALE"))?;
            writer.write_code_pair(&CodePair::new_bool(290, self.use_real_world_scale))?;
        }

        // $INTERFERECOLOR
        if self.version >= AcadVersion::R2007 {
            writer.write_code_pair(&CodePair::new_str(9, "$INTERFERECOLOR"))?;
            writer.write_code_pair(&CodePair::new_i16(62, self.interference_object_color.get_raw_value()))?;
        }

        // $INTERFEREOBJVS
        if self.version >= AcadVersion::R2007 && self.interference_object_visual_style_pointer != Handle::empty() {
            writer.write_code_pair(&CodePair::new_str(9, "$INTERFEREOBJVS"))?;
            writer.write_code_pair(&CodePair::new_string(345, &self.interference_object_visual_style_pointer.as_string()))?;
        }

        // $INTERFEREVPVS
        if self.version >= AcadVersion::R2007 && self.interference_view_port_visual_style_pointer != Handle::empty() {
            writer.write_code_pair(&CodePair::new_str(9, "$INTERFEREVPVS"))?;
            writer.write_code_pair(&CodePair::new_string(346, &self.interference_view_port_visual_style_pointer.as_string()))?;
        }

        // $CSHADOW
        if self.version >= AcadVersion::R2007 {
            writer.write_code_pair(&CodePair::new_str(9, "$CSHADOW"))?;
            writer.write_code_pair(&CodePair::new_i16(280, self.shadow_mode as i16))?;
        }

        // $SHADOWPLANELOCATION
        if self.version >= AcadVersion::R2007 {
            writer.write_code_pair(&CodePair::new_str(9, "$SHADOWPLANELOCATION"))?;
            writer.write_code_pair(&CodePair::new_f64(40, self.shadow_plane_z_offset))?;
        }

        // $AXISMODE
        if self.version <= AcadVersion::R10 {
            writer.write_code_pair(&CodePair::new_str(9, "$AXISMODE"))?;
            writer.write_code_pair(&CodePair::new_i16(70, as_i16(self.axis_on)))?;
        }

        // $AXISUNIT
        if self.version <= AcadVersion::R10 {
            writer.write_code_pair(&CodePair::new_str(9, "$AXISUNIT"))?;
            writer.write_code_pair(&CodePair::new_f64(10, self.axis_tick_spacing.x))?;
            writer.write_code_pair(&CodePair::new_f64(20, self.axis_tick_spacing.y))?;
        }

        // $FASTZOOM
        if self.version <= AcadVersion::R10 {
            writer.write_code_pair(&CodePair::new_str(9, "$FASTZOOM"))?;
            writer.write_code_pair(&CodePair::new_i16(70, as_i16(self.fast_zoom)))?;
        }

        // $GRIDMODE
        if self.version <= AcadVersion::R10 {
            writer.write_code_pair(&CodePair::new_str(9, "$GRIDMODE"))?;
            writer.write_code_pair(&CodePair::new_i16(70, as_i16(self.grid_on)))?;
        }

        // $GRIDUNIT
        if self.version <= AcadVersion::R10 {
            writer.write_code_pair(&CodePair::new_str(9, "$GRIDUNIT"))?;
            writer.write_code_pair(&CodePair::new_f64(10, self.grid_spacing.x))?;
            writer.write_code_pair(&CodePair::new_f64(20, self.grid_spacing.y))?;
        }

        // $SNAPANG
        if self.version <= AcadVersion::R10 {
            writer.write_code_pair(&CodePair::new_str(9, "$SNAPANG"))?;
            writer.write_code_pair(&CodePair::new_f64(50, self.snap_rotation_angle))?;
        }

        // $SNAPBASE
        if self.version <= AcadVersion::R10 {
            writer.write_code_pair(&CodePair::new_str(9, "$SNAPBASE"))?;
            writer.write_code_pair(&CodePair::new_f64(10, self.snap_base_point.x))?;
            writer.write_code_pair(&CodePair::new_f64(20, self.snap_base_point.y))?;
        }

        // $SNAPISOPAIR
        if self.version <= AcadVersion::R10 {
            writer.write_code_pair(&CodePair::new_str(9, "$SNAPISOPAIR"))?;
            writer.write_code_pair(&CodePair::new_i16(70, self.snap_isometric_plane as i16))?;
        }

        // $SNAPMODE
        if self.version <= AcadVersion::R10 {
            writer.write_code_pair(&CodePair::new_str(9, "$SNAPMODE"))?;
            writer.write_code_pair(&CodePair::new_i16(70, as_i16(self.snap_on)))?;
        }

        // $SNAPSTYLE
        if self.version <= AcadVersion::R10 {
            writer.write_code_pair(&CodePair::new_str(9, "$SNAPSTYLE"))?;
            writer.write_code_pair(&CodePair::new_i16(70, self.snap_style as i16))?;
        }

        // $SNAPUNIT
        if self.version <= AcadVersion::R10 {
            writer.write_code_pair(&CodePair::new_str(9, "$SNAPUNIT"))?;
            writer.write_code_pair(&CodePair::new_f64(10, self.snap_spacing.x))?;
            writer.write_code_pair(&CodePair::new_f64(20, self.snap_spacing.y))?;
        }

        // $VIEWCTR
        if self.version <= AcadVersion::R10 {
            writer.write_code_pair(&CodePair::new_str(9, "$VIEWCTR"))?;
            writer.write_code_pair(&CodePair::new_f64(10, self.view_center.x))?;
            writer.write_code_pair(&CodePair::new_f64(20, self.view_center.y))?;
        }

        // $VIEWDIR
        if self.version <= AcadVersion::R10 {
            writer.write_code_pair(&CodePair::new_str(9, "$VIEWDIR"))?;
            writer.write_code_pair(&CodePair::new_f64(10, self.view_direction.x))?;
            writer.write_code_pair(&CodePair::new_f64(20, self.view_direction.y))?;
            writer.write_code_pair(&CodePair::new_f64(30, self.view_direction.z))?;
        }

        // $VIEWSIZE
        if self.version <= AcadVersion::R10 {
            writer.write_code_pair(&CodePair::new_str(9, "$VIEWSIZE"))?;
            writer.write_code_pair(&CodePair::new_f64(40, self.view_height))?;
        }

        Ok(())
    }
}