headervars.py 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263
  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. '$3DDWFPREC': partial(SingleValue, code=40),
  8. '$ACADMAINTVER': partial(SingleValue, code=70), # AC1032 changed to code=90
  9. '$ACADVER': partial(SingleValue, code=1),
  10. '$ANGBASE': partial(SingleValue, code=50),
  11. '$ANGDIR': partial(SingleValue, code=70),
  12. '$ATTMODE': partial(SingleValue, code=70),
  13. '$AUNITS': partial(SingleValue, code=70),
  14. '$AUPREC': partial(SingleValue, code=70),
  15. '$CAMERADISPLAY': partial(SingleValue, code=290),
  16. '$CAMERAHEIGHT': partial(SingleValue, code=40),
  17. '$CECOLOR': partial(SingleValue, code=62),
  18. '$CELTSCALE': partial(SingleValue, code=40),
  19. '$CELTYPE': partial(SingleValue, code=6),
  20. '$CELWEIGHT': partial(SingleValue, code=370),
  21. '$CEPSNTYPE': partial(SingleValue, code=380),
  22. '$CHAMFERA': partial(SingleValue, code=40),
  23. '$CHAMFERB': partial(SingleValue, code=40),
  24. '$CHAMFERC': partial(SingleValue, code=40),
  25. '$CHAMFERD': partial(SingleValue, code=40),
  26. '$CLAYER': partial(SingleValue, code=8),
  27. '$CMATERIAL': partial(SingleValue, code=347),
  28. '$CMLJUST': partial(SingleValue, code=70),
  29. '$CMLSCALE': partial(SingleValue, code=40),
  30. '$CMLSTYLE': partial(SingleValue, code=2),
  31. '$CSHADOW': partial(SingleValue, code=280),
  32. '$DGNFRAME': partial(SingleValue, code=280),
  33. '$DIMADEC': partial(SingleValue, code=70),
  34. '$DIMALT': partial(SingleValue, code=70),
  35. '$DIMALTD': partial(SingleValue, code=70),
  36. '$DIMALTF': partial(SingleValue, code=40),
  37. '$DIMALTRND': partial(SingleValue, code=40),
  38. '$DIMALTTD': partial(SingleValue, code=70),
  39. '$DIMALTTZ': partial(SingleValue, code=70),
  40. '$DIMALTU': partial(SingleValue, code=70),
  41. '$DIMALTZ': partial(SingleValue, code=70),
  42. '$DIMAPOST': partial(SingleValue, code=1),
  43. '$DIMARCSYM': partial(SingleValue, code=70),
  44. '$DIMASO': partial(SingleValue, code=70),
  45. '$DIMASSOC': partial(SingleValue, code=280),
  46. '$DIMASZ': partial(SingleValue, code=40),
  47. '$DIMATFIT': partial(SingleValue, code=70),
  48. '$DIMAUNIT': partial(SingleValue, code=70),
  49. '$DIMAZIN': partial(SingleValue, code=70),
  50. '$DIMBLK': partial(SingleValue, code=1),
  51. '$DIMBLK1': partial(SingleValue, code=1),
  52. '$DIMBLK2': partial(SingleValue, code=1),
  53. '$DIMCEN': partial(SingleValue, code=40),
  54. '$DIMCLRD': partial(SingleValue, code=70),
  55. '$DIMCLRE': partial(SingleValue, code=70),
  56. '$DIMCLRT': partial(SingleValue, code=70),
  57. '$DIMDEC': partial(SingleValue, code=70),
  58. '$DIMDLE': partial(SingleValue, code=40),
  59. '$DIMDLI': partial(SingleValue, code=40),
  60. '$DIMDSEP': partial(SingleValue, code=70),
  61. '$DIMEXE': partial(SingleValue, code=40),
  62. '$DIMEXO': partial(SingleValue, code=40),
  63. '$DIMFRAC': partial(SingleValue, code=70),
  64. '$DIMFXL': partial(SingleValue, code=40),
  65. '$DIMFXLON': partial(SingleValue, code=70),
  66. '$DIMGAP': partial(SingleValue, code=40),
  67. '$DIMJOGANG': partial(SingleValue, code=40),
  68. '$DIMJUST': partial(SingleValue, code=70),
  69. '$DIMLDRBLK': partial(SingleValue, code=1),
  70. '$DIMLFAC': partial(SingleValue, code=40),
  71. '$DIMLIM': partial(SingleValue, code=70),
  72. '$DIMLTEX1': partial(SingleValue, code=6),
  73. '$DIMLTEX2': partial(SingleValue, code=6),
  74. '$DIMLTYPE': partial(SingleValue, code=6),
  75. '$DIMLUNIT': partial(SingleValue, code=70),
  76. '$DIMLWD': partial(SingleValue, code=70),
  77. '$DIMLWE': partial(SingleValue, code=70),
  78. '$DIMPOST': partial(SingleValue, code=1),
  79. '$DIMRND': partial(SingleValue, code=40),
  80. '$DIMSAH': partial(SingleValue, code=70),
  81. '$DIMSCALE': partial(SingleValue, code=40),
  82. '$DIMSD1': partial(SingleValue, code=70),
  83. '$DIMSD2': partial(SingleValue, code=70),
  84. '$DIMSE1': partial(SingleValue, code=70),
  85. '$DIMSE2': partial(SingleValue, code=70),
  86. '$DIMSHO': partial(SingleValue, code=70),
  87. '$DIMSOXD': partial(SingleValue, code=70),
  88. '$DIMSTYLE': partial(SingleValue, code=2),
  89. '$DIMTAD': partial(SingleValue, code=70),
  90. '$DIMTDEC': partial(SingleValue, code=70),
  91. '$DIMTFAC': partial(SingleValue, code=40),
  92. '$DIMTFILL': partial(SingleValue, code=70),
  93. '$DIMTFILLCLR': partial(SingleValue, code=70),
  94. '$DIMTIH': partial(SingleValue, code=70),
  95. '$DIMTIX': partial(SingleValue, code=70),
  96. '$DIMTM': partial(SingleValue, code=40),
  97. '$DIMTMOVE': partial(SingleValue, code=70),
  98. '$DIMTOFL': partial(SingleValue, code=70),
  99. '$DIMTOH': partial(SingleValue, code=70),
  100. '$DIMTOL': partial(SingleValue, code=70),
  101. '$DIMTOLJ': partial(SingleValue, code=70),
  102. '$DIMTP': partial(SingleValue, code=40),
  103. '$DIMTSZ': partial(SingleValue, code=40),
  104. '$DIMTVP': partial(SingleValue, code=40),
  105. '$DIMTXSTY': partial(SingleValue, code=7),
  106. '$DIMTXT': partial(SingleValue, code=40),
  107. '$DIMTXTDIRECTION': partial(SingleValue, code=70),
  108. '$DIMTZIN': partial(SingleValue, code=70),
  109. '$DIMUPT': partial(SingleValue, code=70),
  110. '$DIMZIN': partial(SingleValue, code=70),
  111. '$DISPSILH': partial(SingleValue, code=70),
  112. '$DWFFRAME': partial(SingleValue, code=280),
  113. '$DWGCODEPAGE': partial(SingleValue, code=3),
  114. '$ELEVATION': partial(SingleValue, code=40),
  115. '$ENDCAPS': partial(SingleValue, code=280),
  116. '$EXTMAX': Point3D,
  117. '$EXTMIN': Point3D,
  118. '$EXTNAMES': partial(SingleValue, code=290),
  119. '$FILLETRAD': partial(SingleValue, code=40),
  120. '$FILLMODE': partial(SingleValue, code=70),
  121. '$FINGERPRINTGUID': partial(SingleValue, code=2),
  122. '$HALOGAP': partial(SingleValue, code=280),
  123. '$HANDSEED': partial(SingleValue, code=5),
  124. '$HIDETEXT': partial(SingleValue, code=280),
  125. '$HYPERLINKBASE': partial(SingleValue, code=1),
  126. '$INDEXCTL': partial(SingleValue, code=280),
  127. '$INSBASE': Point3D,
  128. '$INSUNITS': partial(SingleValue, code=70),
  129. '$INTERFERECOLOR': partial(SingleValue, code=62),
  130. '$INTERFEREOBJVS': partial(SingleValue, code=345),
  131. '$INTERFEREVPVS': partial(SingleValue, code=346),
  132. '$INTERSECTIONCOLOR': partial(SingleValue, code=70),
  133. '$INTERSECTIONDISPLAY': partial(SingleValue, code=280),
  134. '$JOINSTYLE': partial(SingleValue, code=280),
  135. '$LASTSAVEDBY': partial(SingleValue, code=1),
  136. '$LATITUDE': partial(SingleValue, code=40),
  137. '$LENSLENGTH': partial(SingleValue, code=40),
  138. '$LIGHTGLYPHDISPLAY': partial(SingleValue, code=280),
  139. '$LIMCHECK': partial(SingleValue, code=70),
  140. '$LIMMAX': Point2D,
  141. '$LIMMIN': Point2D,
  142. '$LOFTANG1': partial(SingleValue, code=40),
  143. '$LOFTANG2': partial(SingleValue, code=40),
  144. '$LOFTMAG1': partial(SingleValue, code=40),
  145. '$LOFTMAG2': partial(SingleValue, code=40),
  146. '$LOFTNORMALS': partial(SingleValue, code=280),
  147. '$LOFTPARAM': partial(SingleValue, code=70),
  148. '$LONGITUDE': partial(SingleValue, code=40),
  149. '$LTSCALE': partial(SingleValue, code=40),
  150. '$LUNITS': partial(SingleValue, code=70),
  151. '$LUPREC': partial(SingleValue, code=70),
  152. '$LWDISPLAY': partial(SingleValue, code=290),
  153. '$MAXACTVP': partial(SingleValue, code=70),
  154. '$MEASUREMENT': partial(SingleValue, code=70),
  155. '$MENU': partial(SingleValue, code=1),
  156. '$MIRRTEXT': partial(SingleValue, code=70),
  157. '$NORTHDIRECTION': partial(SingleValue, code=40),
  158. '$OBSCOLOR': partial(SingleValue, code=70),
  159. '$OBSLTYPE': partial(SingleValue, code=280),
  160. '$OLESTARTUP': partial(SingleValue, code=290),
  161. '$ORTHOMODE': partial(SingleValue, code=70),
  162. '$PDMODE': partial(SingleValue, code=70),
  163. '$PDSIZE': partial(SingleValue, code=40),
  164. '$PELEVATION': partial(SingleValue, code=40),
  165. '$PEXTMAX': Point3D,
  166. '$PEXTMIN': Point3D,
  167. '$PINSBASE': Point3D,
  168. '$PLIMCHECK': partial(SingleValue, code=70),
  169. '$PLIMMAX': Point2D,
  170. '$PLIMMIN': Point2D,
  171. '$PLINEGEN': partial(SingleValue, code=70),
  172. '$PLINEWID': partial(SingleValue, code=40),
  173. '$PROJECTNAME': partial(SingleValue, code=1),
  174. '$PROXYGRAPHICS': partial(SingleValue, code=70),
  175. '$PSLTSCALE': partial(SingleValue, code=70),
  176. '$PSOLHEIGHT': partial(SingleValue, code=40),
  177. '$PSOLWIDTH': partial(SingleValue, code=40),
  178. '$PSTYLEMODE': partial(SingleValue, code=290),
  179. '$PSVPSCALE': partial(SingleValue, code=40),
  180. '$PUCSBASE': partial(SingleValue, code=2),
  181. '$PUCSNAME': partial(SingleValue, code=2),
  182. '$PUCSORG': Point3D,
  183. '$PUCSORGBACK': Point3D,
  184. '$PUCSORGBOTTOM': Point3D,
  185. '$PUCSORGFRONT': Point3D,
  186. '$PUCSORGLEFT': Point3D,
  187. '$PUCSORGRIGHT': Point3D,
  188. '$PUCSORGTOP': Point3D,
  189. '$PUCSORTHOREF': partial(SingleValue, code=2),
  190. '$PUCSORTHOVIEW': partial(SingleValue, code=70),
  191. '$PUCSXDIR': Point3D,
  192. '$PUCSYDIR': Point3D,
  193. '$QTEXTMODE': partial(SingleValue, code=70),
  194. '$REALWORLDSCALE': partial(SingleValue, code=290),
  195. '$REGENMODE': partial(SingleValue, code=70),
  196. '$REQUIREDVERSIONS': partial(SingleValue, code=160),
  197. '$SHADEDGE': partial(SingleValue, code=70),
  198. '$SHADEDIF': partial(SingleValue, code=70),
  199. '$SHADOWPLANELOCATION': partial(SingleValue, code=40),
  200. '$SHOWHIST': partial(SingleValue, code=280),
  201. '$SKETCHINC': partial(SingleValue, code=40),
  202. '$SKPOLY': partial(SingleValue, code=70),
  203. '$SOLIDHIST': partial(SingleValue, code=280),
  204. '$SORTENTS': partial(SingleValue, code=280),
  205. '$SPLFRAME': partial(SingleValue, code=70),
  206. '$SPLINESEGS': partial(SingleValue, code=70),
  207. '$SPLINETYPE': partial(SingleValue, code=70),
  208. '$STEPSIZE': partial(SingleValue, code=40),
  209. '$STEPSPERSEC': partial(SingleValue, code=40),
  210. '$STYLESHEET': partial(SingleValue, code=1),
  211. '$SURFTAB1': partial(SingleValue, code=70),
  212. '$SURFTAB2': partial(SingleValue, code=70),
  213. '$SURFTYPE': partial(SingleValue, code=70),
  214. '$SURFU': partial(SingleValue, code=70),
  215. '$SURFV': partial(SingleValue, code=70),
  216. '$TDCREATE': partial(SingleValue, code=40),
  217. '$TDINDWG': partial(SingleValue, code=40),
  218. '$TDUCREATE': partial(SingleValue, code=40),
  219. '$TDUPDATE': partial(SingleValue, code=40),
  220. '$TDUSRTIMER': partial(SingleValue, code=40),
  221. '$TDUUPDATE': partial(SingleValue, code=40),
  222. '$TEXTSIZE': partial(SingleValue, code=40),
  223. '$TEXTSTYLE': partial(SingleValue, code=7),
  224. '$THICKNESS': partial(SingleValue, code=40),
  225. '$TILEMODE': partial(SingleValue, code=70),
  226. '$TILEMODELIGHTSYNCH': partial(SingleValue, code=280),
  227. '$TIMEZONE': partial(SingleValue, code=70),
  228. '$TRACEWID': partial(SingleValue, code=40),
  229. '$TREEDEPTH': partial(SingleValue, code=70),
  230. '$UCSBASE': partial(SingleValue, code=2),
  231. '$UCSNAME': partial(SingleValue, code=2),
  232. '$UCSORG': Point3D,
  233. '$UCSORGBACK': Point3D,
  234. '$UCSORGBOTTOM': Point3D,
  235. '$UCSORGFRONT': Point3D,
  236. '$UCSORGLEFT': Point3D,
  237. '$UCSORGRIGHT': Point3D,
  238. '$UCSORGTOP': Point3D,
  239. '$UCSORTHOREF': partial(SingleValue, code=2),
  240. '$UCSORTHOVIEW': partial(SingleValue, code=70),
  241. '$UCSXDIR': Point3D,
  242. '$UCSYDIR': Point3D,
  243. '$UNITMODE': partial(SingleValue, code=70),
  244. '$USERI1': partial(SingleValue, code=70),
  245. '$USERI2': partial(SingleValue, code=70),
  246. '$USERI3': partial(SingleValue, code=70),
  247. '$USERI4': partial(SingleValue, code=70),
  248. '$USERI5': partial(SingleValue, code=70),
  249. '$USERR1': partial(SingleValue, code=40),
  250. '$USERR2': partial(SingleValue, code=40),
  251. '$USERR3': partial(SingleValue, code=40),
  252. '$USERR4': partial(SingleValue, code=40),
  253. '$USERR5': partial(SingleValue, code=40),
  254. '$USRTIMER': partial(SingleValue, code=70),
  255. '$VERSIONGUID': partial(SingleValue, code=2),
  256. '$VISRETAIN': partial(SingleValue, code=70),
  257. '$WORLDVIEW': partial(SingleValue, code=70),
  258. '$XCLIPFRAME': partial(SingleValue, code=280),
  259. '$XEDIT': partial(SingleValue, code=290),
  260. }