headervars.py 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144
  1. # Copyright (c) 2014-2018, Manfred Moitzi
  2. # License: MIT License
  3. # Just one header var definition for all DXF version needed, because AutoCAD ignores unknown header vars
  4. from functools import partial
  5. from ezdxf.lldxf.hdrvars import SingleValue, Point2D, Point3D
  6. VARMAP = {
  7. '$ACADVER': partial(SingleValue, code=1),
  8. '$ANGBASE': partial(SingleValue, code=50),
  9. '$ANGDIR': partial(SingleValue, code=70),
  10. '$ATTDIA': partial(SingleValue, code=70),
  11. '$ATTMODE': partial(SingleValue, code=70),
  12. '$ATTREQ': partial(SingleValue, code=70),
  13. '$AUNITS': partial(SingleValue, code=70), # 0: decimal degrees; 1: deg/min/sec; 2: grad; 3: radians; 4: surveyor's units
  14. '$AUPREC': partial(SingleValue, code=70),
  15. '$BLIPMODE': partial(SingleValue, code=70),
  16. '$CECOLOR': partial(SingleValue, code=62),
  17. '$CELTYPE': partial(SingleValue, code=6),
  18. '$CHAMFERA': partial(SingleValue, code=40),
  19. '$CHAMFERB': partial(SingleValue, code=40),
  20. '$CLAYER': partial(SingleValue, code=8),
  21. '$COORDS': partial(SingleValue, code=70),
  22. '$DIMALT': partial(SingleValue, code=70),
  23. '$DIMALTD': partial(SingleValue, code=70),
  24. '$DIMALTF': partial(SingleValue, code=40),
  25. '$DIMAPOST': partial(SingleValue, code=1),
  26. '$DIMASO': partial(SingleValue, code=70),
  27. '$DIMASZ': partial(SingleValue, code=40),
  28. '$DIMBLK': partial(SingleValue, code=1),
  29. '$DIMBLK1': partial(SingleValue, code=1),
  30. '$DIMBLK2': partial(SingleValue, code=1),
  31. '$DIMCEN': partial(SingleValue, code=40),
  32. '$DIMCLRD': partial(SingleValue, code=70),
  33. '$DIMCLRE': partial(SingleValue, code=70),
  34. '$DIMCLRT': partial(SingleValue, code=70),
  35. '$DIMDLE': partial(SingleValue, code=40),
  36. '$DIMDLI': partial(SingleValue, code=40),
  37. '$DIMEXE': partial(SingleValue, code=40),
  38. '$DIMEXO': partial(SingleValue, code=40),
  39. '$DIMGAP': partial(SingleValue, code=40),
  40. '$DIMLFAC': partial(SingleValue, code=40),
  41. '$DIMLIM': partial(SingleValue, code=70),
  42. '$DIMPOST': partial(SingleValue, code=1),
  43. '$DIMRND': partial(SingleValue, code=40),
  44. '$DIMSAH': partial(SingleValue, code=70),
  45. '$DIMSCALE': partial(SingleValue, code=40),
  46. '$DIMSE1': partial(SingleValue, code=70),
  47. '$DIMSE2': partial(SingleValue, code=70),
  48. '$DIMSHO': partial(SingleValue, code=70),
  49. '$DIMSOXD': partial(SingleValue, code=70),
  50. '$DIMSTYLE': partial(SingleValue, code=2),
  51. '$DIMTAD': partial(SingleValue, code=70),
  52. '$DIMTFAC': partial(SingleValue, code=40),
  53. '$DIMTIH': partial(SingleValue, code=70),
  54. '$DIMTIX': partial(SingleValue, code=70),
  55. '$DIMTM': partial(SingleValue, code=40),
  56. '$DIMTOFL': partial(SingleValue, code=70),
  57. '$DIMTOH': partial(SingleValue, code=70),
  58. '$DIMTOL': partial(SingleValue, code=70),
  59. '$DIMTP': partial(SingleValue, code=40),
  60. '$DIMTSZ': partial(SingleValue, code=40),
  61. '$DIMTVP': partial(SingleValue, code=40),
  62. '$DIMTXT': partial(SingleValue, code=40),
  63. '$DIMZIN': partial(SingleValue, code=70),
  64. '$DWGCODEPAGE': partial(SingleValue, code=3),
  65. '$DRAGMODE': partial(SingleValue, code=70),
  66. '$ELEVATION': partial(SingleValue, code=40),
  67. '$EXTMAX': Point3D,
  68. '$EXTMIN': Point3D,
  69. '$FILLETRAD': partial(SingleValue, code=40),
  70. '$FILLMODE': partial(SingleValue, code=70),
  71. '$HANDLING': partial(SingleValue, code=70),
  72. '$HANDSEED': partial(SingleValue, code=5),
  73. '$INSBASE': Point3D,
  74. '$LIMCHECK': partial(SingleValue, code=70),
  75. '$LIMMAX': Point2D,
  76. '$LIMMIN': Point2D,
  77. '$LTSCALE': partial(SingleValue, code=40),
  78. '$LUNITS': partial(SingleValue, code=70),
  79. '$LUPREC': partial(SingleValue, code=70),
  80. '$MAXACTVP': partial(SingleValue, code=70),
  81. '$MENU': partial(SingleValue, code=1),
  82. '$MIRRTEXT': partial(SingleValue, code=70),
  83. '$ORTHOMODE': partial(SingleValue, code=70),
  84. '$OSMODE': partial(SingleValue, code=70),
  85. '$PDMODE': partial(SingleValue, code=70),
  86. '$PDSIZE': partial(SingleValue, code=40),
  87. '$PELEVATION': partial(SingleValue, code=40),
  88. '$PEXTMAX': Point3D,
  89. '$PEXTMIN': Point3D,
  90. '$PLIMCHECK': partial(SingleValue, code=70),
  91. '$PLIMMAX': Point2D,
  92. '$PLIMMIN': Point2D,
  93. '$PLINEGEN': partial(SingleValue, code=70),
  94. '$PLINEWID': partial(SingleValue, code=40),
  95. '$PSLTSCALE': partial(SingleValue, code=70),
  96. '$PUCSNAME': partial(SingleValue, code=2),
  97. '$PUCSORG': Point3D,
  98. '$PUCSXDIR': Point3D,
  99. '$PUCSYDIR': Point3D,
  100. '$QTEXTMODE': partial(SingleValue, code=70),
  101. '$REGENMODE': partial(SingleValue, code=70),
  102. '$SHADEDGE': partial(SingleValue, code=70),
  103. '$SHADEDIF': partial(SingleValue, code=70),
  104. '$SKETCHINC': partial(SingleValue, code=40),
  105. '$SKPOLY': partial(SingleValue, code=70),
  106. '$SPLFRAME': partial(SingleValue, code=70),
  107. '$SPLINESEGS': partial(SingleValue, code=70),
  108. '$SPLINETYPE': partial(SingleValue, code=70),
  109. '$SURFTAB1': partial(SingleValue, code=70),
  110. '$SURFTAB2': partial(SingleValue, code=70),
  111. '$SURFTYPE': partial(SingleValue, code=70),
  112. '$SURFU': partial(SingleValue, code=70),
  113. '$SURFV': partial(SingleValue, code=70),
  114. '$TDCREATE': partial(SingleValue, code=40),
  115. '$TDINDWG': partial(SingleValue, code=40),
  116. '$TDUPDATE': partial(SingleValue, code=40),
  117. '$TDUSRTIMER': partial(SingleValue, code=40),
  118. '$TEXTSIZE': partial(SingleValue, code=40),
  119. '$TEXTSTYLE': partial(SingleValue, code=7),
  120. '$THICKNESS': partial(SingleValue, code=40),
  121. '$TILEMODE': partial(SingleValue, code=70),
  122. '$TRACEWID': partial(SingleValue, code=40),
  123. '$UCSNAME': partial(SingleValue, code=2),
  124. '$UCSORG': Point3D,
  125. '$UCSXDIR': Point3D,
  126. '$UCSYDIR': Point3D,
  127. '$UNITMODE': partial(SingleValue, code=70),
  128. '$USERI1': partial(SingleValue, code=70),
  129. '$USERI2': partial(SingleValue, code=70),
  130. '$USERI3': partial(SingleValue, code=70),
  131. '$USERI4': partial(SingleValue, code=70),
  132. '$USERI5': partial(SingleValue, code=70),
  133. '$USERR1': partial(SingleValue, code=40),
  134. '$USERR2': partial(SingleValue, code=40),
  135. '$USERR3': partial(SingleValue, code=40),
  136. '$USERR4': partial(SingleValue, code=40),
  137. '$USERR5': partial(SingleValue, code=40),
  138. '$USRTIMER': partial(SingleValue, code=70),
  139. '$VISRETAIN': partial(SingleValue, code=70),
  140. '$WORLDVIEW': partial(SingleValue, code=70),
  141. }