dxfpp.js 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173
  1. /* content of dxf2html.js */
  2. TOOLTIPS= [];
  3. function setUp(){
  4. initTooltips();
  5. setDXFTagTooltips();
  6. }
  7. function initTooltips(){
  8. var data = [
  9. [0, 0, "Text string indicating the entity type (fixed)"],
  10. [1, 1, "Primary text value for an entity"],
  11. [2, 2, "Name (attribute tag, block name, and so on)"],
  12. [3, 4, "Other text or name values"],
  13. [5, 5, "Entity handle; text string of up to 16 hexadecimal digits (fixed)"],
  14. [6, 6, "Linetype name (fixed)"],
  15. [7, 7, "Text style name (fixed)"],
  16. [8, 8, "Layer name (fixed)"],
  17. [9, 9, "DXF: variable name identifier (used only in HEADER section of the DXF file)"],
  18. [10, 10, "Primary point; this is the start point of a line or text entity, center of a circle, and so on " +
  19. "DXF: X value of the primary point (followed by Y and Z value codes 20 and 30) " +
  20. "APP: 3D point (list of three reals)"],
  21. [11, 18, "Other points " +
  22. "DXF: X value of other points (followed by Y value codes 21-28 and Z value codes 31-38) " +
  23. "APP: 3D point (list of three reals)"],
  24. [20, 20, "DXF: Y value of the primary point"],
  25. [30, 30, "DXF: Z value of the primary point"],
  26. [21, 28, "DXF: Y values of other points"],
  27. [31, 37, "DXF: Z values of other points"],
  28. [38, 38, "DXF: entity's elevation if nonzero"],
  29. [39, 39, "Entity's thickness if nonzero (fixed)"],
  30. [40, 47, "Double-precision floating-point values (text height, scale factors, and so on)"],
  31. [48, 48, "Linetype scale; default value is defined for all entity types"],
  32. [49, 49, "Multiple 49 groups may appear in one entity for variable-length tables (such as " +
  33. "the dash lengths in the LTYPE table). A 7x group always appears before the first 49 group " +
  34. "to specify the table length"],
  35. [50, 58, "Angles (output in degrees to DXF files and radians through AutoLISP and ObjectARX applications)"],
  36. [60, 60, "Entity visibility; absence or 0 indicates visibility; 1 indicates invisibility"],
  37. [62, 62, "Color number (fixed)"],
  38. [66, 66, "Entities follow flag (fixed)"],
  39. [67, 67, "0 for model space or 1 for paper space (fixed)"],
  40. [68, 68, "APP: identifies whether viewport is on but fully off screen; is not active or is off"],
  41. [69, 69, "APP: viewport identification number"],
  42. [70, 79, "Integer values, such as repeat counts, flag bits, or modes"],
  43. [90, 99, "32-bit integer values"],
  44. [100, 100, "Subclass data marker (with derived class name as a string). Required for all objects and entity " +
  45. "classes that are derived from another concrete class. The subclass data marker segregates data " +
  46. "defined by different classes in the inheritance chain for the same object. " +
  47. "This is in addition to the requirement for DXF names for each distinct concrete class derived " +
  48. "from ObjectARX (see Subclass Markers)"],
  49. [101, 101, "Embedded object marker"],
  50. [102, 102, "Control string, followed by '{arbitrary name' or '}'. " +
  51. "Similar to the xdata 1002 group code, except that when the string begins with '{', " +
  52. "it can be followed by an arbitrary string whose interpretation is up to the application. " +
  53. "The only other control string allowed is "}" as a group terminator. " +
  54. "AutoCAD does not interpret these strings except during drawing audit operations. " +
  55. "They are for application use."],
  56. [105, 105, "Object handle for DIMVAR symbol table entry"],
  57. [110, 110, "UCS origin (appears only if code 72 is set to 1); DXF: X value; APP: 3D point"],
  58. [111, 111, "UCS Y-axis (appears only if code 72 is set to 1); DXF: Y value; APP: 3D vector"],
  59. [112, 112, "UCS Z-axis (appears only if code 72 is set to 1); DXF: Z value; APP: 3D vector"],
  60. [120, 122, "DXF: Y value of UCS origin, UCS X-axis, and UCS Y-axis"],
  61. [130, 132, "DXF: Z value of UCS origin, UCS X-axis, and UCS Y-axis"],
  62. [140, 149, "Double-precision floating-point values (points, elevation, and DIMSTYLE settings, for example)"],
  63. [170, 179, "16-bit integer values, such as flag bits representing DIMSTYLE settings"],
  64. [210, 210, "Extrusion direction (fixed) " +
  65. "DXF: X value of extrusion direction " +
  66. "APP: 3D extrusion direction vector"],
  67. [220, 220, "DXF: Y value of the extrusion direction"],
  68. [230, 230, "DXF: Z value of the extrusion direction"],
  69. [270, 279, "16-bit integer values"],
  70. [280, 289, "16-bit integer value"],
  71. [290, 299, "Boolean flag value; 0 = False; 1 = True"],
  72. [300, 309, "Arbitrary text strings"],
  73. [310, 319, "Arbitrary binary chunks with same representation and limits " +
  74. "as 1004 group codes: hexadecimal strings of up to 254 characters " +
  75. "represent data chunks of up to 127 bytes"],
  76. [320, 329, "Arbitrary object handles; handle values that are taken 'as is'. " +
  77. "They are not translated during INSERT and XREF operations"],
  78. [330, 339, "Soft-pointer handle; arbitrary soft pointers to other objects " +
  79. "within same DXF file or drawing. Translated during INSERT and XREF operations"],
  80. [340, 349, "Hard-pointer handle; arbitrary hard pointers to other objects within " +
  81. "same DXF file or drawing. Translated during INSERT and XREF operations"],
  82. [350, 359, "Soft-owner handle; arbitrary soft ownership links to other objects " +
  83. "within same DXF file or drawing. Translated during INSERT and XREF operations"],
  84. [360, 369, "Hard-owner handle; arbitrary hard ownership links to other objects within " +
  85. "same DXF file or drawing. Translated during INSERT and XREF operations"],
  86. [370, 379, "Lineweight enum value (AcDb::LineWeight). Stored and moved around as a 16-bit integer. " +
  87. "Custom non-entity objects may use the full range, but entity classes only use 371-379 DXF " +
  88. "group codes in their representation, because AutoCAD and AutoLISP both always assume a 370 " +
  89. "group code is the entity's lineweight. This allows 370 to behave like other 'common' entity fields"],
  90. [380, 389, "PlotStyleName type enum (AcDb::PlotStyleNameType). Stored and moved around as a 16-bit integer. " +
  91. "Custom non-entity objects may use the full range, but entity classes only use 381-389 " +
  92. "DXF group codes in their representation, for the same reason as the lineweight range"],
  93. [390, 399, "String representing handle value of the PlotStyleName object, basically a hard pointer, but has " +
  94. "a different range to make backward compatibility easier to deal with. Stored and moved around " +
  95. "as an object ID (a handle in DXF files) and a special type in AutoLISP. Custom non-entity objects " +
  96. "may use the full range, but entity classes only use 391-399 DXF group codes in their representation, " +
  97. "for the same reason as the lineweight range"],
  98. [400, 409, "16-bit integers"],
  99. [410, 419, "String"],
  100. [420, 427, "32-bit integer value. When used with True Color; a 32-bit integer representing a 24-bit color value. " +
  101. "The high-order byte (8 bits) is 0, the low-order byte an unsigned char holding the Blue value (0-255), " +
  102. "then the Green value, and the next-to-high order byte is the Red Value. Converting this integer value to " +
  103. "hexadecimal yields the following bit mask: 0x00RRGGBB. " +
  104. "For example, a true color with Red==200, Green==100 and Blue==50 is 0x00C86432, and in DXF, in decimal, 13132850"],
  105. [430, 437, "String; when used for True Color, a string representing the name of the color"],
  106. [440, 447, "32-bit integer value. When used for True Color, the transparency value"],
  107. [450, 459, "Long"],
  108. [460, 469, "Double-precision floating-point value"],
  109. [470, 479, "String"],
  110. [480, 481, "Hard-pointer handle; arbitrary hard pointers to other objects within same DXF file or drawing. " +
  111. "Translated during INSERT and XREF operations"],
  112. [999, 999, "DXF: The 999 group code indicates that the line following it is a comment string. SAVEAS does " +
  113. "not include such groups in a DXF output file, but OPEN honors them and ignores the comments. " +
  114. "You can use the 999 group to include comments in a DXF file that you have edited"],
  115. [1000, 1000, "ASCII string (up to 255 bytes long) in extended data"],
  116. [1001, 1001, "Registered application name (ASCII string up to 31 bytes long) for extended data"],
  117. [1002, 1002, "Extended data control string ('{' or '}')"],
  118. [1003, 1003, "Extended data layer name"],
  119. [1004, 1004, "Chunk of bytes (up to 127 bytes long) in extended data"],
  120. [1005, 1005, "Entity handle in extended data; text string of up to 16 hexadecimal digits"],
  121. [1010, 1010, "A point in extended data; DXF: X value (followed by 1020 and 1030 groups); APP: 3D point"],
  122. [1020, 1020, "DXF: Y values of a point"],
  123. [1030, 1030, "DXF: Z values of a point"],
  124. [1011, 1011, "A 3D world space position in extended data \n" +
  125. "DXF: X value (followed by 1021 and 1031 groups) \n" +
  126. "APP: 3D point"],
  127. [1021, 1021, "DXF: Y value of a world space position"],
  128. [1031, 1031, "DXF: Z value of a world space position"],
  129. [1012, 1012, "A 3D world space displacement in extended data \n" +
  130. "DXF: X value (followed by 1022 and 1032 groups) \n" +
  131. "APP: 3D vector"],
  132. [1022, 1022, "DXF: Y value of a world space displacement"],
  133. [1032, 1032, "DXF: Z value of a world space displacement"],
  134. [1013, 1013, "A 3D world space direction in extended data \n" +
  135. "DXF: X value (followed by 1022 and 1032 groups) \n" +
  136. "APP: 3D vector"],
  137. [1023, 1023, "DXF: Y value of a world space direction"],
  138. [1033, 1033, "DXF: Z value of a world space direction"],
  139. [1040, 1040, "Extended data double-precision floating-point value"],
  140. [1041, 1041, "Extended data distance value"],
  141. [1042, 1042, "Extended data scale factor"],
  142. [1070, 1070, "Extended data 16-bit signed integer"],
  143. [1071, 1071, "Extended data 32-bit signed long"]
  144. ];
  145. var startIndex, endIndex, text;
  146. for (var i=0; i<data.length; i++){
  147. var row = data[i];
  148. startIndex = row[0];
  149. endIndex = row[1];
  150. text = row[2];
  151. for(var j=startIndex; j<=endIndex; j++){
  152. TOOLTIPS[j] = text;
  153. }
  154. }
  155. }
  156. function getCode(node){
  157. return parseInt(node.firstChild.textContent);
  158. }
  159. function setDXFTagTooltips() {
  160. var tags = document.getElementsByClassName("dxf-tag");
  161. var tag, code;
  162. for (var i = 0; i < tags.length; i++) {
  163. tag = tags[i];
  164. code = getCode(tag);
  165. tag.title = TOOLTIPS[code];
  166. }
  167. }