home *** CD-ROM | disk | FTP | other *** search
/ Encyclopedia of Graphics File Formats Companion / GFF_CD.ISO / formats / autodxf / spec / dxf.txt
Encoding:
Text File  |  1994-06-17  |  98.9 KB  |  2,394 lines

  1. Drawing Interchange and File Formats 
  2. Release 12 
  3. Copyright (c) 1982-1990, 1992, Autodesk, Inc.  
  4. All Rights Reserved 
  5.  
  6.  
  7.  
  8.  
  9. Chapter 11
  10.  
  11. Drawing Interchange and File Formats
  12.  
  13.  
  14. AutoCAD can be used by itself as a complete drawing editor. In
  15. some applications, however, other programs must examine drawings
  16. created by AutoCAD or generate drawings to be viewed, modified,
  17. or plotted with AutoCAD.
  18.  
  19. For example, if you've made an architectural drawing with
  20. AutoCAD, using inserted parts to represent windows, doors, and so
  21. on, you can process the drawing file and produce a bill of
  22. materials of all items used in the drawing or even make
  23. energy-use calculations based on the area and the number and type
  24. of windows used. Another possible application is to use AutoCAD
  25. to describe structures and then send the descriptions to a more
  26. powerful computer for finite-element structural analysis. You can
  27. compute stresses and displacements and send back information to
  28. display the deformed structure as an AutoCAD drawing.
  29.  
  30. Since the AutoCAD drawing database (.dwg file) is written in a
  31. compact format that changes significantly as new features are
  32. added to AutoCAD, we do not document its format and do not
  33. recommend that you attempt to write programs to read it directly.
  34. To assist in interchanging drawings between AutoCAD and other
  35. programs, a Drawing Interchange file format (DXF) has been
  36. defined. All implementations of AutoCAD accept this format and
  37. are able to convert it to and from their internal drawing file
  38. representation.
  39.  
  40. AutoCAD also supports the Initial Graphics Exchange Specification
  41. (IGES) file format. The information comprising an AutoCAD drawing
  42. can be written out in IGES format, and IGES files can be read and
  43. converted to the AutoCAD internal format.
  44.  
  45.  
  46. ASCII Drawing Interchange (DXF) Files
  47.  
  48. This section describes the AutoCAD DXF (drawing interchange file)
  49. format and the commands provided to read and write these files.
  50. DXF files are standard ASCII text files. They can easily be
  51. translated to the formats of other CAD systems or submitted to
  52. other programs for specialized analysis. AutoCAD can also produce
  53. or read a binary form of the full DXF file. This feature is
  54. described in detail later in this chapter.
  55.  
  56. DXFOUT Command-Writing a DXF File
  57.  
  58. You can generate a drawing interchange file from an existing
  59. drawing by means of the DXFOUT command:
  60.  
  61.      Command: dxfout
  62.  
  63.  
  64. When AutoCAD prompts you, respond with a filename or press to
  65. accept the default.
  66.  
  67. The default name for the output file is the same as that of the
  68. current drawing but with a file type of dxf. If you specify an
  69. explicit filename, you do not need to include a file type; dxf is
  70. assumed. If a file with the same name already exists, the
  71. existing file is deleted. If you specify the file using a file
  72. dialogue box, and a file with the same name already exists,
  73. AutoCAD tells you; allowing you to OK or cancel the deletion.
  74. Next, DXFOUT asks what precision you want for floating-point
  75. numbers and permits output of a partial DXF file containing only
  76. selected objects.
  77.  
  78.      Enter decimal places of accuracy (0 to 16)/Entities/Binary
  79.      <6>:
  80.  
  81. The Binary option is described later in this chapter.
  82.  
  83. If you respond with entities (or just e), DXFOUT asks you to
  84. select the objects you want written to the DXF file. Only the
  85. objects you select are included in the output file-symbol tables
  86. (including Block Definitions) will not be included. Once you've
  87. selected the desired objects, AutoCAD again prompts you for the
  88. numeric precision:
  89.  
  90.      Enter decimal places of accuracy (0 to 16)/Binary <6>:
  91.  
  92.  
  93. DXFIN Command-Loading a DXF File
  94.  
  95. A drawing interchange file can be converted into an AutoCAD
  96. drawing by means of the DXFIN command:
  97.  
  98.      Command: dxfin
  99.  
  100. When AutoCAD prompts you, respond with the name of the drawing
  101. interchange file to be loaded.
  102.  
  103.  
  104. Full DXFIN
  105.  
  106. To load a complete DXF file, you must use DXFIN in an empty
  107. drawing, before any entities have been drawn and before any
  108. additional Block definitions, layers, linetypes, text styles,
  109. dimension styles, named views, named coordinate systems, or named
  110. viewport configurations have been created.
  111.  
  112. Note: If the drawing you are using as a prototype is not empty,
  113. you might find it helpful to open a new drawing using the No
  114. Prototype ... button of the Create New Drawing dialogue box, as
  115. described in chapter 4 of the AutoCAD Reference Manual. You
  116. should also be aware that some third-party applications include
  117. an acad.lsp or .mnl file that modifies your drawing upon startup.
  118.  
  119. If any errors are detected during the input, the new drawing is
  120. discarded. Otherwise, an automatic ZOOM All is performed to set
  121. the drawing extents.
  122.  
  123.  
  124. Partial DXFIN
  125.  
  126. If the current drawing is not empty, DXFIN loads only the
  127. ENTITIES section of the DXF file, adding the entities found there
  128. to the current drawing. In this case, DXFIN displays the message:
  129.  
  130.      Not a new drawing - only ENTITIES section will be input.
  131.  
  132. If errors are detected during such partial DXF input, the drawing
  133. is returned to the state it was in before the DXFIN command.
  134. Otherwise, the newly added entities are drawn.
  135.  
  136.  
  137. Auditing DXF Files
  138.  
  139. To ensure that corrupt data is not imported into your drawing,
  140. you can instruct AutoCAD to perform an audit after importing DXF
  141. files into your drawing with DXFIN. When you use DXFIN, the
  142. default action is to perform no automatic auditing. To activate
  143. automatic auditing, use the CONFIG command:
  144.  
  145.      Command: config
  146.  
  147. Your current AutoCAD configuration appears. Press [ENTER] to
  148. continue. From the Configuration menu select this option:
  149.  
  150.      7. Configure operating parameters
  151.  
  152. From the Operating parameter menu select this option:
  153.  
  154.      9. Automatic Audit after IGESIN, DXFIN, or DXBIN
  155.  
  156. Answer Y to this question:
  157.  
  158. Do you want an automatic audit after IGESIN, DXFIN, or DXBIN?
  159. <N>: y
  160.  
  161. Return to the graphics screen by pressing [ENTER] three times.
  162.  
  163. Note. This kind of audit only displays the errors AutoCAD finds;
  164. it does not correct them. To correct problems, use the AUDIT
  165. command on the drawing while you are in AutoCAD, or manually edit
  166. the DXF file.
  167.  
  168.  
  169. DXF File Format
  170.  
  171. This section describes the format of a DXF file in detail. It
  172. contains technical information that you need only if you write
  173. your own programs to process DXF files or work with entity
  174. information obtained by certain AutoLISP and ADS functions.
  175.  
  176. It would probably be helpful to produce a DXF file from a small
  177. drawing, print it out, and refer to it occasionally while reading
  178. the information presented next.
  179.  
  180.  
  181. General File Structure
  182.  
  183. A Drawing Interchange File is simply an ASCII text file with a
  184. file type of .dxf and specially formatted text. The overall
  185. organization of a DXF file is as follows:
  186.  
  187. 1. HEADER section--General information about the drawing is found
  188.    in this section of the DXF file. Each parameter has a variable
  189.    name and an associated value (see table 11-3 for a list of the
  190.    header variables).
  191.  
  192. 2. TABLES section--This section contains definitions of named
  193.    items.
  194.  
  195.    * Linetype table (LTYPE)
  196.  
  197.    * Layer table (LAYER)
  198.  
  199.    * Text Style table (STYLE)
  200.  
  201.    * View table (VIEW)
  202.  
  203.    * User Coordinate System table (UCS)
  204.  
  205.    * Viewport configuration table (VPORT)
  206.  
  207.    * Dimension Style table (DIMSTYLE)
  208.  
  209.    * Application Identification table (APPID)
  210.  
  211. 3. BLOCKS section--This section contains Block Definition
  212.    entities describing the entities that make up each Block in
  213.    the drawing.
  214.  
  215. 4. ENTITIES section--This section contains the drawing entities,
  216.    including any Block References.
  217.  
  218. 5. END OF FILE
  219.  
  220. If you use DXFOUT's Entities option, the resulting DXF file
  221. contains only the ENTITIES section and the END OF FILE marker,
  222. and the ENTITIES section reflects only the objects you select for
  223. output.
  224.  
  225. Note: If you select an INSERT entity, the corresponding Block
  226. definition is not included in the output file.
  227.  
  228. A DXF file is composed of many groups, each of which occupies two
  229. lines in the DXF file. The first line of a group is a group code,
  230. which is a positive nonzero integer output in FORTRAN 13--that
  231. is, right-justified and blank filled in a three-character field
  232. (the exception to this is the four-digit extended entity data
  233. group codes, which are output in FORTRAN 14). The second line of
  234. the group is the group value, in a format that depends on the
  235. type of group specified by the group code. Although DXFOUT output
  236. has a fixed format, the DXFIN format is free.
  237.  
  238. The specific assignment of group codes depends on the item being
  239. described in the file. However, the type of the value this group
  240. supplies is derived from the group code in the following war.
  241.  
  242.  
  243. Table 11-1. Group code ranges
  244.  
  245. Group Code Range                     Following Value
  246.  
  247. 0-9                                  String
  248. 10-59                                Floating-point
  249. 60-79                                Integer
  250. 140-147                              Floating-point
  251. 170-175                              Integer
  252. 210-239                              Floating-point
  253. 999                                  Comment (string)
  254. 1000-1009                          String
  255. 1010-1059                            Floating-point
  256. 1060-1079                            Integer
  257.  
  258. Thus a program can easily read the value following a group code
  259. without knowing the particular use of this group in an item in
  260. the file. The appearance of values in the DXF file is not
  261. affected by the setting of the UNITS command: coordinates are
  262. always represented as decimal (or possibly scientific notation if
  263. very large) numbers, and angles are always represented in decimal
  264. degrees with zero degrees to the east of origin.
  265.  
  266. Variables, table entries, and entities are described by a group
  267. that introduces the item, giving its type and/or name, followed
  268. by multiple groups that supply the values associated with the
  269. item. In addition, special groups are used for file separators
  270. such as markers for the beginning and end of sections, tables,
  271. and the file itself.
  272.  
  273. Entities, table entries, and file separators are always
  274. introduced with a 0 group code that is followed by a name
  275. describing the item.
  276.  
  277. Note: The maximum DXF file string length is 256 characters. If
  278. your AutoCAD drawing contains strings that exceed this number,
  279. those strings are truncated during DXFOUT. If your DXF file
  280. contains strings that exceed this number, DXFIN will fail.
  281.  
  282.  
  283. Group Codes
  284.  
  285. Group codes are used both to indicate the type of the value of
  286. the group, as explained earlier, and to indicate the general use
  287. of the group. The specific function of the group code depends on
  288. the actual variable, table item, or entity description. This
  289. section indicates the general use of groups, noting as "(fixed)"
  290. any that always have the same function.
  291.  
  292.  
  293. Table 11-2. AutoCAD entity group codes (by number)
  294.  
  295. Group code      Value Type
  296.  
  297. 0               identifies the start of an entity, table entry,
  298. or
  299.                 file separator. The type of entity is given by
  300.                 the text value that follows this group
  301.  
  302. 1               The primary text value for an entity
  303.  
  304. 2               A name: Attribute tag, Block name, and so on.
  305.                 Also used to identify a DXF section or table name
  306.  
  307. 3-4             Other textual or name values
  308.  
  309. 5               Entity handle expressed as a hexadecimal string
  310.                 (fixed)
  311.  
  312. 6               Line type name (fixed)
  313.  
  314. 7               Text style name (fixed)
  315.  
  316. 8               Layer name (fixed)
  317.  
  318. 9               Variable name identifier (used only in HEADER
  319.                 section of the DXF file)
  320.  
  321. 10              Primary X coordinate (start point of a Line or
  322.                 Text entity, center of a Circle, etc.)
  323.  
  324. 11-18           Other X coordinates
  325.  
  326. 20              Primary Y coordinate. 2n values always correspond
  327.                 to 1n values and immediately follow them in the
  328.                 file
  329.  
  330. 21-28           Other Y coordinates
  331.  
  332. 30              Primary Z coordinate. 3n values always correspond
  333.                 to 1n and 2n values and immediately follow them
  334.                 in the file
  335.  
  336. 31-37           Other Z coordinates
  337.  
  338. 38              This entity's elevation if nonzero (fixed).
  339.                 Exists only in output from versions prior to R11
  340.  
  341. 39              This entity's thickness if nonzero (fixed)
  342.  
  343. 40-48           Floating-point values (text height, scale
  344.                 factors, etc.)
  345.  
  346. 49              Repeated value-multiple 49 groups may appear in
  347.                 one entity for variable length tables (such as
  348.                 the dash lengths in the LTYPE table). A 7x group
  349.                 always appears before the first 49 group to
  350.                 specify the table length
  351.  
  352. 50-58           Angles
  353.  
  354. 62              Color number (fixed)
  355.  
  356. 66              "Entities follow" flag (fixed)
  357.  
  358. 67              Identifies whether entity is in model space or
  359.                 paper space
  360.  
  361. 68              Identifies whether viewport is on but fully off
  362.                 screen, is not active, or is off
  363.  
  364. 69              Viewport identification number
  365.  
  366. 70-78           Integer values such as repeat counts, flag bits,
  367.                 or modes
  368.  
  369. 210, 220. 230   X, Y, and Z components of extrusion direction
  370.                 (fixed)
  371.  
  372. 999             Comments
  373.  
  374. 1000            An ASCII string (up to 255 bytes long) in
  375.                 extended entity data
  376.  
  377. 1001            Registered application name (ASCII string up to
  378.                 31 bytes long) for XDATA (fixed)
  379.  
  380. 1002            Extended entity data control string ("{" or "}
  381.                 ");(fixed)
  382.  
  383. 1003            Extended entity data Layer name
  384.  
  385. 1004            Chunk of bytes (up to 127 bytes long) in extended
  386.                 entity data
  387.  
  388. 1005            Extended entity data database handle
  389.  
  390. 1010,1020,1030  Extended entity data X, Y, and Z coordinates
  391.  
  392. 1011,1021,1031  Extended entity data X, Y, and Z coordinates of
  393.                 3D world space position
  394.  
  395. 1012,1022,1032  Extended entity data X, Y, and Z components of 3D
  396.                 world space displacement
  397.  
  398. 1013,1023,1033  Extended entity data X, Y, and Z components of 3D
  399.                 world space direction
  400.  
  401. 1040            Extended entity data Floating-point value
  402.  
  403. 1041            Extended entity data distance value
  404.  
  405. 1042            Extended entity data scale factor
  406.  
  407. 1070            Extended entity data 16-bit signed integer
  408.  
  409. 1071            Extended entity data 32-bit signed long
  410.  
  411.  
  412. Comments
  413.  
  414. The 999 group code indicates that the following line is a comment
  415. string. DXFOUT does not currently include such groups in a DXF
  416. output file, but DXFIN honors them and ignores the comments.
  417. Thus, you can use the 999 group to include comments in a DXF file
  418. you've edited. For example:
  419.  
  420. 999
  421. This is a comment.
  422. 999
  423. This is another comment.
  424.  
  425.  
  426. File Sections
  427.  
  428. The DXF file is subdivided into four editable sections, plus the
  429. END OF FILE marker. File separator groups are used to delimit
  430. these file sections. The following is an example of a void DXF
  431. file with only the section markers and table headers present:
  432.  
  433. 0               (Begin HEADER section)
  434. SECTION
  435. 2
  436. HEADER
  437.                 <<<<Header variable items go here>>>>
  438. 0
  439. ENDSEC          (End HEADER section)
  440.  0              (Begin TABLES section)
  441. SECTION
  442.  2
  443. TABLES
  444.  0
  445. TABLE
  446.  2
  447. VPORT
  448.  70
  449. (viewport table maximum item count)
  450.                 <<<<viewport table items go here>>>>
  451. 0
  452. ENDTAB
  453. 0
  454. TABLE
  455. 2
  456. APPID, DIMSTYLE, LTYPE, LAYER, STYLE, UCS, VIEW, or VPORT
  457. 70
  458. (Table maximum item count)
  459.                 <<<<Table items go here>>>>
  460. 0
  461. ENDTAB
  462. 0
  463. ENDSEC          (End TABLES section)
  464. 0               (Begin BLOCKS section)
  465. SECTION
  466. 2
  467. BLOCKS
  468.                 <<<<Block definition entities go here>>>>
  469. 0
  470. ENDSEC          (End BLOCKS section)
  471. 0               (Begin ENTITIES section)
  472. SECTION
  473. 2
  474. ENTITIES
  475.                 <<<<Drawing entities go here>>>>
  476. 0
  477. ENDSEC          (End ENTITIES section)
  478. 0
  479. EOF             (End of file)
  480.  
  481.  
  482. HEADER Section
  483.  
  484. The HEADER section of the DXF file contains settings of variables
  485. associated with the drawing. These variables are set with various
  486. commands and are the type of information displayed by the STATUS
  487. command. Each variable is specified in the header section by a 9
  488. group giving the variable's name, followed by groups that supply
  489. the variable's value. The following list shows the header
  490. variables and their meanings.
  491.  
  492. Although this list is very similar to the list of system
  493. variables in Appendix A of this manual, the two lists are not
  494. identical. Be sure you're referring to the proper list.
  495.  
  496. Note: $AXISMODE and $AXISUNIT are no longer functional in Release
  497.       12.
  498.  
  499.  
  500. Table 11-3. DXF system variables
  501.  
  502. Variable           Type       Description
  503.  
  504. $ACADVER           1          The AutoCAD drawing database
  505.                               version number, AC1006 = R10,
  506.                               AC1009 = R11 and R12
  507. $ANGBASE           50         Angle 0 direction
  508. $ANGDIR            70         1 = clockwise angles, 0 =
  509.                               counterclockwise
  510. $ATTDIA            70         Attribute entry dialogs, 1 = on, 0
  511.                               = off
  512. $ATTMODE           70         Attribute Visibility: 0 = none, 1 =
  513.                               normal, 2 = all
  514. $ATTREQ            70         Attribute prompting during INSERT,
  515.                               1 = on, 0 = off
  516. $AUNITS            70         Units format for angles
  517. $AUPREC            70         Units precision for angles
  518.  
  519. $AXISMODE          70         Axis on if nonzero (not functional
  520.                               in Release 12)
  521. $AXISUNIT          10,20      Axis X and Y tick spacing
  522.                               (not functional in Release 12)
  523. $BLIPMODE          70         Blip mode on if nonzero
  524. $CECOLOR           62         Entity color number, 0 = BYBLOCK,
  525.                               256 = BYLAYER
  526. $CELTYPE           6          Entity linetype name, or BYBLOCK or
  527.                               BYLAYER
  528. $CHAMFERA          40         First chamfer distance
  529. $CHAMFERB          40         Second chamfer distance
  530. $CLAYER            8          Current layer name
  531. $COORDS            70         0 = static coordinate display, 1 =
  532.                               continuous update, 2 = "d<a" format
  533. $DIMALT            70         Alternate unit dimensioning
  534.                               performed if nonzero
  535. $DIMALTD           70         Alternate unit decimal places
  536. $DIMALTF           40         Alternate unit scale factor
  537. $DIMAPOST          1          Alternate dimensioning suffix
  538. $DIMASO            70         1 = create associative
  539.                               dimensioning, draw individual
  540.                               entities
  541. $DIMASZ            40         Dimensioning arrow size
  542. $DIMBLK            2          Arrow block name
  543. $DIMBLK1           1          First arrow block name
  544. $DIMBLK2           1          Second arrow block name
  545. $DIMCEN            40         Size of center mark/lines
  546. $DIMCLRD           70         Dimension line color, range is 0 =
  547.                               BYBLOCK, 256 = BYLAYER
  548. $DIMCLRE           70         Dimension extension line color,
  549.                               range is 0 = BYBLOCK, 256 = BYLAYER
  550. $DIMCLRT           70         Dimension text color, range is 0 =
  551.                               BYBLOCK, 256 = BYLAYER
  552. $DIMDLE            40         Dimension line extension
  553. $DIMDLI            40         Dimension line increment
  554. $DIMEXE            40         Extension line extension
  555. $DIMEXO            40         Extension line offset
  556. $DIMGAP            40         Dimension line gap
  557. $DIMLFAC           40         Linear measurements scale factor
  558. $DIMLIM            70         Dimension limits generated if
  559.                               nonzero
  560. $DIMPOST           1          General dimensioning suffix
  561. $DIMRND            40         Rounding value for dimension
  562.                               distances
  563. $DIMSAH            70         Use separate arrow blocks d nonzero
  564. $DIMSCALE          40         Overall dimensioning scale factor
  565. $DIMSE1            70         First extension line suppressed if
  566.                               nonzero
  567. $DIMSE2            70         Second extension line suppressed if
  568.                               nonzero
  569. $DIMSHO            70         1 = Recompute dimensions while
  570.                               dragging, 0 = drag original image
  571. $DIMSOXD           70         Suppress outside-extensions
  572.                               dimension lines if nonzero
  573. $DIMSTYLE          2          Dimension style name
  574. $DIMTAD            70         Text above dimension line if
  575.                               nonzero
  576. $DIMTFAC           40         Dimension tolerance display scale
  577.                               factor
  578. $DIMTIH            70         Text inside horizontal if nonzero
  579. $DIMTIX            70         Force text inside extensions if
  580.                               nonzero
  581. $DIMTM             40         Minus tolerance
  582. $DIMTOFL           70         If text outside extensions, force
  583.                               line extensions between extensions
  584.                               if nonzero
  585. SDIMTOH            70         Text outside horizontal if nonzero
  586. $DIMTOL            70         Dimension tolerances generated if
  587.                               nonzero
  588. $DIMTP             40         Plus tolerance
  589. $DIMTSZ            40         Dimensioning tick size: 0 = no
  590.                               ticks
  591. $DIMTVP            40         Text vertical position
  592. $DIMTXT            40         Dimensioning text height
  593. $DIMZIN            70         Zero suppression for "feet & inch"
  594.                               dimensions
  595. $DWGCODEPAGE       70         Drawing code page. Set to the
  596.                               system code page when a new drawing
  597.                               is created, but not otherwise
  598.                               maintained by AutoCAD
  599. $DRAGMODE          70         0 = off, 1 = on, 2 = auto
  600. $ELEVATION         40         Current elevation set by ELEV
  601.                               command
  602. $EXTMAX            10,20,30   X, Y, and Z drawing extents
  603.                               upper-right corner (in WCS)
  604. $EXTMIN            10,20,30   X, Y, and Z drawing extents
  605.                               lower-left corner (in WCS)
  606. $FILLETRAD         40         Fillet radius
  607. $FILLMODE          70         Fill mode on if nonzero
  608. $HANDLING          70         Handles enabled if nonzero
  609. $HANDSEED          5          Next available handle
  610. $INSBASE           10,20,30   Insertion base set by BASE command
  611.                               (in WCS)
  612. $LIMCHECK          70         Nonzero if limits checking is on
  613. $LIMMAX            10,20      XY drawing limits upper-right
  614.                               corner (in WCS)
  615. $LIMMIN            10,20      XY drawing limits lower-left corner
  616.                               (in WCS)
  617. $LTSCALE           40         Global linetype scale
  618.  
  619.  
  620. $LUNITS            70         Units format for coordinates and
  621.                               distances
  622. $LUPREC            70         Units precision for coordinates and
  623.                               distances
  624. $MAXACTVP          70         Sets maximum number of viewports to
  625.                               be regenerated
  626. $MENU              1          Name of menu file
  627. $MIRRTEXT          70         Mirror text if nonzero
  628. $ORTHOMODE         70         Ortho mode on if nonzero
  629. $OSMODE            70         Running object snap modes
  630. $PDMODE            70         Point display mode
  631. $PDSIZE            40         Point display size
  632. $PELEVATION        40         Current paper space elevation
  633. $PEXTMAX           10,20,30   Maximum X, Y, and Z extents for
  634.                               paper space
  635. $PEXTMIN           10,20,30   Minimum X, Y, and Z extents for
  636.                               paper space
  637. $PLIMCHECK         70         Limits checking in paper space when
  638.                               nonzero
  639. $PLIMMAX           10,20      Maximum X and Y limits in paper
  640.                               space
  641. $PLIMMIN           10,20      Minimum X and Y limits in paper
  642.                               space
  643. $PLINEGEN          70         Governs the generation of linetype
  644.                               patterns around the vertices of a
  645.                               2D Polyline
  646.                               1 = linetype is generated in a
  647.                               continuous pattern around vertices
  648.                               of the Polyline
  649.                               0 = each segment of the Polyline
  650.                               starts and ends with a dash
  651. $PLINEWID          40         Default Polyline width
  652. $PSLTSCALE         70         Controls paper space linetype
  653.                               scaling
  654.                               1 = no special linetype scaling
  655.                               0 = viewport scaling governs
  656.                               linetype scaling
  657. $PUCSNAME          2          Current paper space UCS name
  658.  
  659. $PUCSORG           10,20,30   Current paper space UCS origin
  660. $PUCSXDIR          10,20,30   Current paper space UCS X axis
  661. $PUCSYDIR          10,20,30   Current paper space UCS Y axis
  662. $QTEXTMODE         70         Quick text mode on if nonzero
  663. $REGENMODE         70         REGENAUTO mode on if nonzero
  664. $SHADEDGE          70         0 = faces shaded, edges not
  665.                               highlighted
  666.                               1 = faces shaded, edges highlighted
  667.                               in black
  668.                               2 = faces not filled, edges in
  669.                               entity color
  670.                               3 = faces in entity color, edges in
  671.                               black
  672. $SHADEDIF          70         Percent ambient/diffuse light,
  673.                               range 1 - 100, default 70
  674. $SKETCHINC         40         Sketch record increment
  675. $SKPOLY            70         0 = sketch lines, 1 = sketch
  676.                               polylines
  677. $SPLFRAME          70         Spline control polygon display, 1 =
  678.                               on, 0 = off
  679. $SPLINESEGS        70         Number of line segments per spline
  680.                               patch
  681. $SPLINETYPE        70         Spline curve type for PEDIT Spline
  682.                               (See your AutoCAD Reference Manual)
  683. $SURFTAB1          70         Number of mesh tabulations in first
  684.                               direction
  685. $SURFTAB2          70         Number of mesh tabulations in
  686.                               second direction
  687. $SURFTYPE          70         Surface type for PEDIT Smooth
  688.                               (See your AutoCAD Reference Manual)
  689. $SURFU             70         Surface density (for PEDIT Smooth)
  690.                               in M direction
  691. $SURFV             70         Surface density (for PEDIT Smooth)
  692.                               in N direction
  693. $TDCREATE          40         Date/time of drawing creation
  694. $TDINDWG           40         Cumulative editing time for this
  695.                               drawing
  696. $TDUPDATE          40         Date/time of last drawing update
  697. $TDUSRTIMER        40         User elapsed timer
  698. $TEXTSIZE          40         Default text height
  699. $TEXTSTYLE         7          Current text style name
  700. $THICKNESS         40         Current thickness set by ELEV
  701.                               command
  702. $TILEMODE          70         1 for previous release
  703.                               compatibility mode, 0 otherwise
  704. $TRACEWID          40         Default Trace width
  705. $UCSNAME           2          Name of current UCS
  706. $UCSORG            10,20,30   Origin of current UCS (in WCS)
  707. $UCSXDIR           10,20,30   Direction of current UCS's X axis
  708.                               (in World coordinates)
  709. $UCSYDIR           10,20,30   Direction of current UCSs Yaxis (in
  710.                               World coordinates)
  711. $UNITMODE          70         Low bit set = display fractions,
  712.                               feet-and-inches, and surveyor's
  713.                               angles in input format
  714. $USERI1 - 5        70         Five integer variables intended for
  715.                               use by third-party developers
  716. $USERR1 - 5        40         Five real variables intended for
  717.                               use by third-party developers
  718. $USRTIMER          70         0 = timer off, 1 = timer on
  719. $VISRETAIN         70         0 = don't retain Xref-dependent
  720.                               visibility settings,
  721.                               1 = retain Xref-dependent
  722.                               visibility settings
  723. $WORLDVIEW         70         1 = set UCS to WCS during
  724.                               DVIEW/VPOINT,
  725.                               0 = don't change UCS
  726.  
  727.  
  728. The following header variables existed prior to AutoCAD Release
  729. 11 but now have independent settings for each active viewport.
  730. DXFIN honors these variables when read from DXF files, but if a
  731. VPORT symbol table with *ACTIVE entries is present (as is true
  732. for any DXF file produced by Release 11 or higher), the values in
  733. the VPORT table entries override the values of these header
  734. variables.
  735.  
  736.  
  737. Table 11-4. Revised VPORT header variables
  738.  
  739. Variable           Type       Description
  740.      
  741. $FASTZOOM          70         Fast zoom enabled if nonzero
  742. $GRIDMODE          70         Grid mode on if nonzero
  743. $GRIDUNIT          10,20      Grid X and Y spacing
  744. $SNAPANG           50         Snap grid rotation angle
  745. $SNAPBASE          10,20      Snap/grid base point (in UCS)
  746. $SNAPISOPAIR       70         Isometric plane: 0 = left, 1 = top,
  747.                               2 = right
  748. $SNAPMODE          70         Snap mode on if nonzero
  749. $SNAPSTYLE         70         Snap style: 0 = standard,
  750.                               1 = isometric
  751. $SNAPUNIT          10,20      Snap grid X and Y spacing
  752. $VIEWCTR           10,20      XY center of current view on screen
  753. $VIEWDIR           10,20,30   Viewing direction (direction from
  754.                               target, in WCS)
  755. $VIEWSIZE          40         Height of view
  756.  
  757. The date/time variables ($TDCREATE and $TDUPDATE) are output as
  758. real numbers in the following format:
  759.  
  760.      <Julian date>.<Fraction>
  761.  
  762. The elapsed time variables ($TDINDWG and $TDUSRTIMER) have a
  763. similar format:
  764.  
  765.      <Number of days>.<Fraction>
  766.  
  767. The date and time variables are described on page 297.
  768.  
  769.  
  770. TABLES Section
  771.  
  772. The TABLES section contains several tables, each of which
  773. contains a variable number of table entries.
  774.  
  775. The order of the tables may change, but the LTYPE table will
  776. always precede the LAYER table. Each table is introduced with a 0
  777. group with the label TABLE. This is followed by a 2 group
  778. identifying the particular table (VPORT, LTYPE, LAYER, STYLE,
  779. VIEW, DIMSTYLE, UCS or APPID) and a 70 group that specifies the
  780. maximum number of table entries that may follow. Table names are
  781. always output in uppercase characters.
  782.  
  783. The tables in a drawing can contain deleted items, but these are
  784. not written to the DXF file. Thus, fewer table entries may follow
  785. the table header than are indicated by the 70 group, so don't use
  786. the count in the 70 group as an index to read in the table. This
  787. group is provided so that a program which reads DXF files can
  788. allocate an array large enough to hold all the table entries that
  789. follow.
  790.  
  791. Following this header for each table are the table entries. Each
  792. table item consists of a 0 group identifying the item type (same
  793. as table name, e.g., LTYPE or LAYER), a 2 group giving the name
  794. of the table entry, a 70 group specifying flags relevant to the
  795. table entry (defined for each following table), and additional
  796. groups that give the value of the table entry. The end of each
  797. table is indicated by a 0 group with the value ENDTAB.
  798.  
  799. The 70 group flag bit values that apply to all table entries are
  800. described in the following chart. Additional 70 group values that
  801. apply to LAYER, STYLE, and VIEW table entries are described in
  802. the appropriate sections below.
  803.  
  804.  
  805. Table 11-5. Group 70 bit codes that apply to all table entries
  806.  
  807. Flag bit value     Meaning
  808.  
  809. 16                 If set, table entry is externally dependent on
  810.                    an Xref
  811. 32                 If this bit and bit 16 are both set, the
  812.                    externally dependent Xref has been
  813.                    successfully resolved
  814. 64                 If set, the table entry was referenced by at
  815.                    least one entity in the drawing the last time
  816.                    the drawing was edited. (This flag is for the
  817.                    benefit of AutoCAD commands; it can be ignored
  818.                    by most programs that read DXF files, and need
  819.                    not be set by programs that write DXF files)
  820.  
  821. The following are the groups used for each type of table item.
  822. All groups are present for each table item.
  823.  
  824. APPID     2 (user-supplied application name), 70 (standard flag
  825.           values).
  826.  
  827.           These table entries maintain a set of names for all
  828.           applications registered with a drawing.
  829.  
  830. DIMSTYLE  2 (dimension style name), 70 (standard flag values),
  831.           and the following, described by dimension variable
  832.           name: 3 (dimpost), 4 (dimapost), 5 (dimblk), 6
  833.           (dimblk1), 7 (dimblk2), 40 (dimscale), 41 (dimasz), 42
  834.           (dimexo), 43 (dimdli), 44 (dimexe), 45 (dimmd), 46
  835.           (dimdle), 47 (dimtp), 48 (dimtm), 140 (dimtxt), 141
  836.           (dimcen), 142 (dimtsz), 143 (dimaltf), 144 (dimifac),
  837.           145 (dimtvp), 146 (dimtfac), 147 (dimgap), 71 (dimtol),
  838.           72 (dimlim), 73 (dimtih), 74 (dimtoh), 75 (dimsel), 76
  839.           (dimse2), 77 (dimtad), 78 (dimzin), 170 (dimalt), 171
  840.           (dimaltd), 172 (dimtofl), 173 (dimsah), 174 (dimtix),
  841.           175 (dimsoxd), 176 (dimcird), 177 (dimcire), 178
  842.           (dimclrt).
  843.  
  844. LTYPE     2 (linetype name), 70 (standard flag values), 3
  845.           (descriptive text for linetype), 72 (alignment code;
  846.           value is always 65, the ASCII code for 'A'), 73 (number
  847.           of dash length items), 40 (total pattern length), and
  848.           optionally: 49 (dash length 1), 49 (dash length 2), and
  849.           so on.
  850.  
  851. LAYER     2 (layer name), 70 (standard flag values), 62 (color
  852.           number, negative if layer is off), 6 (linetype name).
  853.  
  854.           In addition to the standard flags, the 70 group flag is
  855.           bit coded as follows:
  856.  
  857.  
  858. Table 11-6. Group 70 bit codes for LAYER table
  859.  
  860. Flag bit value     Meaning
  861.  
  862. 1                  If set, layer is frozen
  863. 2                  If set, layer is frozen by default in new
  864.                    Viewports
  865. 3                  If set, layer is locked
  866.  
  867.           If no value (0) is set, the layer is on and thawed. The
  868.           fourth bit (8) and the eighth bit (128) are not used.
  869.  
  870.           Xref-dependent layers are output during DXFOUT. For
  871.           these layers, the associated linetype name in the DXF
  872.           file is always CONTINUOUS.
  873.  
  874. STYLE     2 (style name), 70 (standard flag values), 40 (fixed
  875.           text height; 0 if not fixed), 41 (width factor), 50
  876.           (oblique angle), 71 (text generation flags), 42 (last
  877.           height used), 3 (primary font filename), 4 (big-font
  878.           file name; blank if none).
  879.  
  880.           If the third bit (4) is set in the 70 group flags, this
  881.           is a vertically oriented text style.
  882.  
  883.           A STYLE table item is used to record shape file LOAD
  884.           requests also. In this case the first bit (1) is set in
  885.           the 70 group flags and only the 3 group (shape
  886.           filename) is meaningful (all the other groups are
  887.           output, however).
  888.  
  889.           The text generation flags are a bit-coded field with
  890.           the following bit meanings:
  891.  
  892. Table 11-7. Group 71 bit codes for STYLE table
  893.  
  894. Flag bit value     Meaning
  895.  
  896. 2                  Text is backward (mirrored in X)
  897. 4                  Text is upside down (mirrored in Y)
  898.  
  899.  
  900. UCS       2 (UCS name), 70 (standard flag values), 10, 20, 30
  901.           (origin), 11, 21, 31 (X axis direction), 12, 22, 32 (Y
  902.           axis direction). All in World coordinates.
  903.  
  904. VIEW      2 (name of view), 70 (standard flag values), 40 and 41
  905.           (view height and width, in DCS), 10 and 20 (view center
  906.           point, in DCS), 11, 21, 31 (view direction from target,
  907.           in WCS), 12, 22, 32 (target point, in WCS), 42 (lens
  908.           length), 43 and 44 (front and back clipping
  909.           planes-offsets from target point), 50 (twist angle), 71
  910.           view mode (see VIEWMODE system variable in appendix A).
  911.  
  912.           If the first bit (1) is set in the 70 group flags, this
  913.           is a paper space view.
  914.  
  915.           (See chapter 2 of the AutoLISP Programmer's Reference
  916.           for information on DCS, the Display Coordinate System.)
  917.  
  918. VPORT     2 (viewport name), 70 (standard flag values), 10 and 20
  919.           (lowerleft corner of viewport; 0.0 to 1.0), 11 and 21
  920.           (upper-right corner), 12 and 22 (view center point, in
  921.           WCS), 13 and 23 (snap base point), 14 and 24 (snap
  922.           spacing, X and Y), 15 and 25 (grid spacing, X and Y),
  923.           16, 26, 36 (view direction from target point), 17, 27,
  924.           37 (view target point), 40 (view height), 41 (viewport
  925.           aspect ratio), 42 (lens length), 43 and 44 (front and
  926.           back clipping planes; offsets from target point), 50
  927.           (snap rotation angle), 51 (view twist angle), 68
  928.           (status field), 69 (ID), 71 (view mode; see VIEWMODE
  929.           system variable in appendix A), 72 (circle zoom
  930.           percent), 73 (fast zoom setting), 74 (UCSICON setting),
  931.           75 (snap on/off), 76 (grid on/off), 77 (snap style), 78
  932.           (snap isopair).
  933.  
  934.           The VPORT table is unique in that it may contain
  935.           several entries with the same name (indicating a
  936.           multiple-viewport configuration). The entries
  937.           corresponding to the active viewport configuration all
  938.           have the name *ACTIVE. The first such entry describes
  939.           the current viewport.
  940.  
  941.  
  942. BLOCKS Section
  943.  
  944. The Blocks section of the DXF file contains all the Block
  945. Definitions. This section contains the entities that make up the
  946. Blocks used in the drawing, including anonymous Blocks generated
  947. by the HATCH command and by associative dimensioning. The format
  948. of the entities in this section is identical to those in the
  949. Entities section described later, so see that section for
  950. details. All entities in the Blocks section appear between Block
  951. and Endblk entities. Block and Endblk entities appear only in the
  952. Blocks section. Block definitions are never nested (that is, no
  953. Block or Endblk entity ever appears within another Block-Endblk
  954. pair), although a Block definition can contain an INSERT entity.
  955.  
  956. External References are written in the DXF file as any Block
  957. Definition, except they also include a text string (group code 1)
  958. of the path and filename of the External Reference. This is the
  959. text string format:
  960.  
  961.      Xref filename
  962.  
  963.  
  964. ENTITIES Section
  965.  
  966. Entity items appear in both the BLOCK and ENTITIES sections of
  967. the
  968. DXF file. The appearance of entities in the two sections is
  969. identical.
  970.  
  971. The following gives the format of each entity as it appears in
  972. the file. Some groups that define an entity always appear, and
  973. some are optional and appear only if they differ from their
  974. default values. In the following discussion, groups that always
  975. occur are given by their group number and function, while
  976. optional groups are indicated by -optional N following the group
  977. description. N is the default value if the group is omitted.
  978.  
  979. Programs that read DXF files should not assume that the groups
  980. describing an entity occur in the order given here. The end of
  981. the groups that make up an entity is indicated by the next 0
  982. group, beginning the next entity or indicating the end of the
  983. section.
  984.  
  985. Remember that a DXF file is a complete representation of the
  986. drawing database, and that as AutoCAD is further enhanced, new
  987. groups will be added to entities to accommodate additional
  988. features. Accommodating DXF files from future releases of AutoCAD
  989. will be easier if you write your DXF processing program in a
  990. table-driven way, ignoring any groups not presently defined, and
  991. making no assumptions about the order of groups in an entity.
  992.  
  993. Each entity begins with a 0 group identifying the entity type.
  994. The names used for the entities are given on the following pages.
  995. Every entity contains an 8 group that gives the name of the layer
  996. on which the entity resides. Each entity may have elevation,
  997. thickness, linetype, or color information associated with it.
  998.  
  999. If handles are enabled, every entity has a 5 group containing its
  1000. handle (as a string representing a hexadecimal number).
  1001.  
  1002. The following groups are included only if the entity has
  1003. nondefault values for these properties. When a group is omitted,
  1004. its default value upon input (when using DXFIN) is indicated in
  1005. the third column. ff the value of a group is equal to the
  1006. default, it is omitted upon output (when using DXFOUT).
  1007.  
  1008. Table 11-8. Group codes common to all entities
  1009.  
  1010. Group Meaning                                     If omitted
  1011. code                                              defaults to ...
  1012.  
  1013. 6     Linetype name (if not BYLAYER). The special 
  1014.       name BYBLOCK indicates a floating linetype  BYLAYER
  1015.  
  1016. 38    Elevation (if nonzero). Exists only in output
  1017.       from versions prior to R11. Otherwise, Z 
  1018.       coordinates are supplied as 3x-groups as part 
  1019.       of each of the entity's defining points     0
  1020.  
  1021. 39    Thickness (if nonzero)                      0
  1022.  
  1023. 62    Color number (if not BYLAYER). Zero indicates
  1024.       the BYBLOCK (floating) color. 256 indicates
  1025.       the BYLAYER color                           BYLAYER
  1026.  
  1027. 67    Absent or zero indicates entity is in model
  1028.       space. One indicates entity is in paper space,
  1029.       other values are reserved                   0
  1030.  
  1031. 210,  These groups are included for each Line, Point,
  1032. 220,  Circle, Shape, Text, Arc, Trace, Solid, Block
  1033. 230   Reference, Polyline, Dimension, Attribute, and Attribute
  1034.       Definition entity if its extrusion direction is
  1035.       not parallel to the World Z axis. They indicate the
  1036.       X, Y, and Z components of the entity's extrusion
  1037.       direction                                   0,0,1
  1038.  
  1039. The rest of the groups that make up an entity item are described
  1040. next. Many of the entities include "flag" groups. These are
  1041. integer codes (6x or 7x groups) that encode various pieces of
  1042. information regarding the entity, and are specific to the
  1043. particular entity type. In the following descriptions, the term
  1044. bit-coded means that the flag contains various true/false values
  1045. coded as the sum of the bit values given. Any bits not defined in
  1046. the following section should be ignored in these fields and set
  1047. to zero when constructing a DXF file.
  1048.  
  1049.  
  1050. LINE     10, 20, 30 (start point), 11, 21, 31 (endpoint).
  1051.  
  1052. POINT    10, 20, 30 (point).
  1053.  
  1054.          Point entities have an optional 50 group that determines
  1055.          the orientation of PDMODE images. The group value is the
  1056.          negative of the Entity Coordinate Systems (ECS) angle of
  1057.          the UCS X axis in effect when the point was drawn. The X
  1058.          axis of the UCS in effect when the point was drawn is
  1059.          always parallel to the XY plane for the point's ECS, and
  1060.          the angle between the UCS X axis and the ECS X axis is a
  1061.          single 2D angle. The value in group 50 is the angle from
  1062.          horizontal (the effective X axis) to the ECS X axis.
  1063.          Entity Coordinate Systems (ECS) are described later in
  1064.          this section.
  1065.  
  1066. CIRCLE   10, 20, 30 (center), 40 (radius).
  1067.  
  1068. ARC      10, 20, 30 (center), 40 (radius), 50 (start angle), 51
  1069.          (end angle).
  1070.  
  1071. TRACE    Four points defining the corners of the trace: (10, 20,
  1072.          30), (11, 21, 31), (12, 22, 32), and (13, 23, 33).
  1073.  
  1074. SOLID    Four points defining the corners of the solid: (10, 20,
  1075.          30), (11, 21, 31), (12, 22, 32), and (13, 23, 33). If
  1076.          only three points were entered (forming a triangular
  1077.          solid), the third and fourth points will be the same.
  1078.  
  1079. TEXT     10, 20, 30 (insertion point), 40 (height), 1 (text
  1080.          value), 50 (rotation angle -optional 0), 41 (relative
  1081.          X-scale factor -optional 1), 51 (oblique angle -optional
  1082.          0), 7 (text style name optional STANDARD), 71 (text
  1083.          generation flags -optional 0), 72 (horizontal
  1084.          justification type -optional 0), 73 (vertical
  1085.          justification type -optional 0) 11, 21, 31 (alignment
  1086.          point -optional, appears only if 72 or 73 group is
  1087.          present and nonzero).
  1088.  
  1089.          The "text generation flags" are a bit-coded field with
  1090.          meanings as follows:
  1091.  
  1092. Table 11-9. Group 71 bit codes for Text entity
  1093.  
  1094. Flag bit value     Meaning
  1095.  
  1096. 2                  Text is backward (mirrored in X)
  1097. 4                  Text is upside down (mirrored in Y)
  1098.  
  1099. The justification-type value (group codes 72 and 73, not
  1100. bitcoded) indicates the text-justification style used on the
  1101. text, as shown in the following table:
  1102.  
  1103.  
  1104.  
  1105. Table 11-10. Group 72 & 73 bit codes for Text entity
  1106.  
  1107. Group 73           Group 72 (horizontal alignment)
  1108. (vertical
  1109. alignment)     0       1       2       3       4       5
  1110.  
  1111. 3 (Top)        TLeft   TCenter TRight
  1112. 2 (Middle)     MLeft   MCenter MRight
  1113. 1 (Bottom)     BLeft   BCenter BRight
  1114. 0 (Baseline)   Left    Center  Right   Aligned Middle  Fit
  1115.  
  1116. If the justification is anything other than baseline/left (groups
  1117. 72 and 73 both 0), group codes 11, 21, and 31 specify the
  1118. alignment point (or the second alignment point for Align or Fit).
  1119.  
  1120. DXFOUT handles ASCII control characters in text strings by
  1121. expanding the character into a ^ (caret) followed by the
  1122. appropriate letter. For example, an ASCII Control-G (BEL, decimal
  1123. code 7) is output as ^G. If the text itself contains a caret
  1124. character, it is expanded to ^ (caret, space). DXFIN performs the
  1125. complementary conversion.
  1126.  
  1127. SHAPE     10, 20, 30 (insertion point), 40 (size), 2 (shape
  1128.           name), 50 (rotation angle -optional 0), 41 (relative
  1129.           X-scale factor -optional 1), 51 (oblique angle
  1130.           -optional 0).
  1131.  
  1132. BLOCK     2 (Block name), 3 (this is also the Block name), 70
  1133.           (Block type flag), 10, 20, 30 (Block base point), and
  1134.           if the Block is an Xref Block it will also contain
  1135.           group code 1 (Xref pathname). Block entities appear
  1136.           only in the BLOCKS section, not in the ENTITIES
  1137.           section. The "Block type flag" (group 70) is bit-coded,
  1138.           with the following bit meanings:
  1139.  
  1140.  
  1141.  
  1142. Table 11-11. Group 70 bit codes for Block table
  1143.  
  1144. Flag bit value     Meaning
  1145.  
  1146. 1                  This is an anonymous Block generated by
  1147.                    hatching, associative dimensioning, other
  1148.                    internal operations, or an application
  1149. 2                  This Block has Attributes
  1150. 4                  This Block is an external reference (Xref)
  1151. 8                  not used
  1152. 16                 This Block is externally dependent
  1153. 32                 This is a resolved external reference, or
  1154.                    dependent of an external reference
  1155. 64                 This definition is referenced
  1156.  
  1157.  
  1158. ENDBLK    No groups. Appears only in BLOCKS section.
  1159.  
  1160. INSERT    66 (Attributes follow flag -optional 0), 2 (Block
  1161.           name), 10, 20, 30 (insertion point), 41 (X- scale
  1162.           factor -optional 1), 42 (Yscale factor -optional 1), 43
  1163.           (Z- scale factor -optional 1), 50 (rotation angle
  1164.           -optional 0), 70 and 71 (column and row counts
  1165.           -optional 1), 44 and 45 (column and row spacing
  1166.           -optional 0).
  1167.  
  1168.           If the value of the "Attributes follow" Bag is 1, a
  1169.           series of Attribute (Attrib) entities is expected to
  1170.           follow the Insert, terminated by a sequence end
  1171.           (Seqend) entity.
  1172.  
  1173. ATTDEF    10, 20, 30 (text start), 40 (text height), 1 (default
  1174.           value, see "Text" on page 258 for handling of ASCII
  1175.           control characters), 3 (prompt string), 2 (tag string),
  1176.           70 (Attribute flags), 73 (field length -optional 0), 50
  1177.           (text rotation, -optional 0), 41 (relative X scale
  1178.           factor -optional 1), 51 (oblique angle -optional 0), 7
  1179.           (text style name -optional STANDARD), 71 (text
  1180.           generation flags -optional 0, see "Text" on page 258),
  1181.           72 (horizontal text justification type -optional 0, see
  1182.           "Text" on page 258), 74 (vertical text justification
  1183.           type -optional 0 see group 73 in "Text" on page 258),
  1184.           11, 21, 31 (alignment point -optional, appears only if
  1185.           72 or 74 group is present and nonzero).
  1186.  
  1187.           The "Attribute flags" (group code 70) are a bit-coded
  1188.           field in which the bits have the following meanings:
  1189.  
  1190. Table 11- 12. Group 70 bit codes for Attdef entity
  1191.  
  1192.  
  1193.  
  1194.  
  1195.  
  1196. Flag bit value     Meaning
  1197.  
  1198. 1                  Attribute is invisible (does not display)
  1199. 2                  This is a constant Attribute
  1200. 4                  Verification is required on input of this
  1201.                    Attribute
  1202. 8                  Attribute is preset (no prompt during
  1203.                    insertion)
  1204.  
  1205. ATTRIB    10, 20, 30 (text start), 40 (text height), 1 (value,
  1206.           see "Text" on page 258 for handling ASCII control
  1207.           characters), 2 (Attribute tag), 70 (Attribute flags;
  1208.           see Attdef), 73 (field length -optional 0), 50 (text
  1209.           rotation -optional 0), 41 (relative X scale factor
  1210.           -optional 1), 51 (oblique angle -optional 0), 7 (text
  1211.           style name -optional STANDARD), 71 (text generation
  1212.           flags -optional 0, see "Text" on page 258), 72
  1213.           (horizontal text justification type -optional 0, see
  1214.           "Text" on page 258), 74 (vertical text justification
  1215.           type -optional 0, see group 73 in "Text" on page 258),
  1216.           11, 21, 31 (alignment point -optional, appears only if
  1217.           72 or 74 group is present and nonzero).
  1218.  
  1219. POLYLINE  66 (vertices-follow flag), 10, 20, 30 (polyline
  1220.           elevation-30 supplies elevation, 10 and 20 are always
  1221.           set to zero), 70 (Polyline flag -optional 0), 40
  1222.           (default starting width -optional 0), 41 (default
  1223.           ending width -optional 0), 71 and 72 (polygon mesh M
  1224.           and N vertex counts -optional 0), 73 and 74 (smooth
  1225.           surface M and N densities -optional 0), 75 (curves and
  1226.           smooth surface type -optional 0). The default widths
  1227.           apply to any vertex that doesn't supply widths (see
  1228.           later).
  1229.  
  1230.           The "vertices follow" flag is always 1, indicating that
  1231.           a series of Vertex entities is expected to follow the
  1232.           Polyline, terminated by a sequence end (Seqend) entity.
  1233.           The polyline flag (group code 70) is a bit-coded field
  1234.           with bits defined as follows:
  1235.  
  1236. Table 11-13. Group 70 bit codes for Polyline entity
  1237.  
  1238. Flag bit value     Meaning
  1239.  
  1240. 1                  This is a closed Polyline (or a polygon mesh
  1241.                    closed in the M direction)
  1242. 2                  Curve-fit vertices have been added
  1243. 4                  Spline-fit vertices have been added
  1244. 8                  This is a 3D Polyline
  1245. 16                 This is a 3D polygon mesh.
  1246.                    Group 75 indicates the smooth surface type as
  1247.                    follows:
  1248.                    0 = no smooth surface fitted
  1249.                    5 = quadratic B-spline surface
  1250.                    6 = cubic B-spline surface
  1251.                    8 = Bezier surface
  1252. 32                 The polygon mesh is closed in the N direction
  1253. 64                 This Polyline is a polyface mesh
  1254. 128                The linetype pattern is generated continuously
  1255.                    around the vertices of this Polyline
  1256.  
  1257.           A polyface mesh is represented in DXF as a variant of a
  1258.           Polyline entity. The Polyline header is identified as
  1259.           introducing a polyface mesh by the presence of the 64
  1260.           bit in the Polyline flags (70) group. The 71 group
  1261.           specifies the number of vertices in the mesh, and the
  1262.           72 group, the number of faces. While these counts are
  1263.           correct for all meshes created with the PFACE command,
  1264.           applications are not required to place correct values
  1265.           in these fields, and AutoCAD actually never relies upon
  1266.           their accuracy.
  1267.  
  1268.           Following the Polyline header is a sequence of Vertex
  1269.           entities that specify the vertex coordinates and faces
  1270.           that compose the mesh. Vertices such as these are
  1271.           described in the following subsection on Vertex.
  1272.  
  1273.           Applications might want to represent polygons with an
  1274.           arbitrarily large number of sides in polyface meshes.
  1275.           However, the AutoCAD entity structure imposes a limit
  1276.           on the number of vertices that a given face entity can
  1277.           specify. You can represent more complex polygons by
  1278.           decomposing them into triangular wedges. Their edges
  1279.           should be made invisible to prevent visible artifacts
  1280.           of this subdivision from being drawn. The PFACE command
  1281.           performs this subdivision automatically, but when
  1282.           applications generate polyface meshes directly, the
  1283.           applications must do this themselves.
  1284.  
  1285.           The number of vertices per face is the key parameter in
  1286.           this subdivision process. The PFACEVMAX system variable
  1287.           provides an application with the number of vertices per
  1288.           face entity. This value is read-only, and is set to 4.
  1289.  
  1290.           Polyface meshes created with the PFACE command are
  1291.           always generated with all the vertex coordinate
  1292.           entities first, followed by the face definition
  1293.           entities. The code within AutoCAD that processes
  1294.           polyface meshes does not, at present, require this
  1295.           ordering; it works even with interleaved vertex
  1296.           coordinates and face definitions as long as no face
  1297.           specifies a vertex with an index that appears after it
  1298.           in the database. Programs that read polyface meshes
  1299.           from DXF would be wise to be as tolerant of odd vertex
  1300.           and face ordering as AutoCAD is.
  1301.  
  1302.  
  1303.  
  1304.  
  1305. VERTEX    10, 20, 30 (location), 40 (starting width -optional,
  1306.           see earlier), 41 (ending width -optional, see above),
  1307.           42 (bulge -optional 0), 70 (vertex flags -optional 0),
  1308.           50 (curve fit tangent direction optional). The bulge is
  1309.           the tangent of 1/4 the included angle for an arc
  1310.           segment, made negative if the arc goes clockwise from
  1311.           the start point to the endpoint; a bulge of 0 indicates
  1312.           a straight segment, and a bulge of 1 is a semicircle.
  1313.           The meaning of the bit-coded Vertex flag (group code
  1314.           70) is shown in the following table
  1315.  
  1316. Table 11-14. Group 70 bit codes for Vertex entity
  1317.  
  1318. Flag bit value     Meaning
  1319.  
  1320. 1                  Extra vertex created by curve-fitting
  1321. 2                  Curve-fit tangent defined for this vertex. A
  1322.                    curve-fit tangent direction of 0 may be
  1323.                    omitted from the DXF output, but is
  1324.                    significant if this bit is set
  1325. 4                  Unused (never set in DXF files)
  1326. 8                  Spline vertex created by spline-fitting
  1327. 16                 Spline frame control point
  1328. 32                 3D Polyline vertex
  1329. 64                 3D polygon mesh vertex
  1330. 128                Polyface mesh vertex
  1331.  
  1332.           Every Vertex that is part of a polyface mesh has the
  1333.           128 bit set in its Vertex flags (70) group. If the
  1334.           entity specifies the coordinates of a vertex of the
  1335.           mesh, the 64 bit is set as well and the 10, 20, and 30
  1336.           groups give the vertex coordinates. The vertex indexes
  1337.           are determined by the order in which the Vertex
  1338.           entities appear within the Polyline, with the first
  1339.           numbered 1.
  1340.  
  1341.           If the Vertex defines a face of the mesh, its Vertex
  1342.           flags (70) group has the 128 bit set but not the 64
  1343.           bit. The 10, 20, and 30 (location) groups of the face
  1344.           entity are irrelevant and are always written as zero in
  1345.           a DXF file. The vertex indexes that define the mesh are
  1346.           given by 71, 72, 73, and 74 groups, the values of which
  1347.           are integers specifying one of the previously defined
  1348.           vertices by index. If the index is negative, the edge
  1349.           that begins with that vertex is invisible. The first
  1350.           zero vertex marks the end of the vertices of the face.
  1351.           Since the 71 through 74 groups are optional fields with
  1352.           default values of zero, they are present in DXF only if
  1353.           nonzero.
  1354.  
  1355. SEQEND    No fields. This entity marks the end of vertices
  1356.           (Vertex type name) for a Polyline, or the end of
  1357.           Attribute entities (Attrib type name) for an Insert
  1358.           entity that has Attributes (indicated by 66 group
  1359.           present and nonzero in Insert entity).
  1360.  
  1361. 3DFACE    Four points defining the corners of the face: (10, 20,
  1362.           30), (11, 21, 31), (12, 22, 32), and (13, 23, 33). 70
  1363.           (invisible edge flags optional 0). If only three points
  1364.           are entered (forming a triangular face), the third and
  1365.           fourth points will be the same. The meanings of the
  1366.           bit-coded "Invisible edge flags" are shown in the
  1367.           following table:
  1368.  
  1369. Table 11-15. Group 70 bit codes for 3D Face entity
  1370.  
  1371. Flag bit value     Meaning
  1372.  
  1373. 1                  First edge is invisible
  1374. 2                  Second edge is invisible
  1375. 4                  Third edge is invisible
  1376. 8                  Fourth edge is invisible
  1377.  
  1378. VIEWPORT  10,20,30 (center point of entity in paper space
  1379.           coordinates), 40 (width in paper space units), 41
  1380.           (height in paper space units), 68 (viewport status
  1381.           field), 69 (viewport ID, permanent during editing
  1382.           sessions, but mutable between sessions; the paper space
  1383.           viewport entity always has an ID of 1).
  1384.  
  1385.           The value of the viewport status field (68) is
  1386.           interpreted as follows:
  1387.  
  1388. -1                  On, but is fully off-screen or is one of the
  1389.                     viewports not active because the $MAXACTVP
  1390.                     count is currently being exceeded.
  1391.  
  1392. 0                   Off.
  1393.  
  1394. <positive value>    On, active and the value indicates the
  1395.                     order of "stacking" for the viewports, with 1
  1396.                     applying to the active viewport, which is
  1397.                     also the highest, 2 applying to the next
  1398.                     viewport in the stack, and so on.
  1399.  
  1400.           In addition, the extended entity data groups in the
  1401.           following table apply to viewports.
  1402.  
  1403.           Note. In contrast to normal entity data, the same
  1404.           extended entity group code can appear multiple times,
  1405.           and order is important.
  1406.  
  1407. Table 11-16. Extended entity group codes for Viewports
  1408.  
  1409. Group  Description
  1410.  
  1411. 1001   Application name. This field will always be the string
  1412.        "ACAD"
  1413. 1000   Begin viewport data. This field will always be the string
  1414.        "MVIEW". Other data groups may appear in the future
  1415. 1002   Begin window descriptor data. This field will always be
  1416.        the string "{"
  1417. 1070   Extended entity data version number. For Releases 11 and
  1418.        12, this field will always be the integer 16
  1419. 1010   View target point X value
  1420. 1020   View target point Y value
  1421. 1030   View target point Z value
  1422. 1010   View direction vector X value
  1423. 1020   View direction vector Y value
  1424. 1030   View direction vector Z value
  1425. 1040   View twist angle
  1426. 1040   View height
  1427. 1040   View center point X value
  1428. 1040   View center point Y value
  1429. 1040   Perspective lens length
  1430. 1040   Front clip plane Z value
  1431. 1040   Back clip plane Z value
  1432. 1070   View mode
  1433. 1070   Circle zoom
  1434. 1070   Fast zoom setting
  1435. 1070   UCSICON setting
  1436. 1070   Snap ON/OFF
  1437. 1070   Grid ON/OFF
  1438. 1070   Snap style
  1439. 1070   Snap ISOPAIR
  1440. 1040   Snap angle
  1441. 1040   Snap base point UCS X coordinate
  1442. 1040   Snap base point UCS Y coordinate
  1443. 1040   Snap X spacing
  1444. 1040   Snap Y spacing
  1445. 1040   Grid X spacing
  1446. 1040   Grid Y spacing
  1447. 1070   Hidden in plot flag
  1448. 1002   Begin frozen layer list (possibly empty). This field will
  1449.        always be the string "{"
  1450. 1003...The names of layers frozen in this viewport. This list may
  1451.        include Xref-dependent layers. Any number of 1003 groups
  1452.        may appear here
  1453. 1002   End frozen layer list. This field will always be the
  1454.        string "}"
  1455. 1002   End Viewport data. This field will always be the string
  1456.        "}"
  1457.  
  1458. DIMENSION 2 (name of pseudo-Block containing the current
  1459.           dimension entity geometry), 3 (dimension style name),
  1460.           10, 20, 30 (definition point for all dimension types),
  1461.           11, 21, 31 (middle point of dimension text), 12, 22, 32
  1462.           (dimension block translation vector), 70 (Dimension
  1463.           type), 1 (dimension text explicitly entered by the
  1464.           user. If null or "<>', the dimension measurement is
  1465.           drawn as the text, if " " [one blank space], the text
  1466.           is suppressed. Anything else is drawn as the text). 13,
  1467.           23, 33 (definition point for linear and angular
  1468.           dimensions), 14, 24, 34 (definition point for linear
  1469.           and angular dimensions), 15, 25, 35 (definition point
  1470.           for diameter, radius, and angular dimensions), 16, 26,
  1471.           36 (point defining dimension arc for angular
  1472.           dimensions), 40 (leader length for radius and diameter
  1473.           dimensions), 50 (angle of rotated, horizontal, or
  1474.           vertical linear dimensions).
  1475.  
  1476.           The dimension type (group code 70) is an integer-coded
  1477.           field with the following values:
  1478.  
  1479. Table 11-17. Group 70 integer codes for Dimension entity
  1480.  
  1481. Value     Meaning
  1482.  
  1483. 0         Rotated, horizontal, or vertical
  1484. 1         Aligned
  1485. 2         Angular
  1486. 3         Diameter
  1487. 4         Radius
  1488. 5         Angular 3-point
  1489. 6         Ordinate
  1490. 64        Ordinate type. This is a bit value (bit 7) used only
  1491.           with integer value 6. if set, ordinate is X-type, if
  1492.           not set, ordinate is Y-type
  1493. 128       This is a bit value (bit 8) added to the other group 70
  1494.           values if the dimension text has been positioned at a
  1495.           user-defined location rather than at the default
  1496.           location
  1497.  
  1498.           In addition, all dimension types have an optional group
  1499.           (code 51) that indicates the horizontal direction for
  1500.           the Dimension entity. This determines the orientation
  1501.           of-dimension text and dimension lines for horizontal,
  1502.           vertical, and rotated linear dimensions. The group
  1503.           value is the negative of the Entity Coordinate Systems
  1504.           (ECS) angle of the UCS X axis in effect when the
  1505.           Dimension was drawn. The X axis of the UCS in effect
  1506.           when the Dimension was drawn is always parallel to the
  1507.           XY plane for the Dimension's ECS, and the angle between
  1508.           the UCS X axis and the ECS X axis is a single 2D angle.
  1509.           The value in group 51 is the angle from horizontal (the
  1510.           effective X axis) to the ECS X axis. Entity Coordinate
  1511.           Systems (ECS) are described later in this section.
  1512.  
  1513.           Linear dimension types with an oblique angle have an
  1514.           optional group (code 52). When added to the rotation
  1515.           angle of the linear dimension (group code 50) this
  1516.           gives the angle of the extension lines. The optional
  1517.           group code 53 is the rotation angle of the dimension
  1518.           text away from its default orientation (the direction
  1519.           of the dimension line).
  1520.  
  1521.           For all dimension types, the following groups represent
  1522.           3D WCS points:
  1523.  
  1524.             10, 20, 30
  1525.             13, 23, 33
  1526.             14, 24, 34
  1527.             15, 25, 35
  1528.  
  1529.           For all dimension types, the following groups represent
  1530.           3D ECS points:
  1531.  
  1532.             11, 21, 31
  1533.             12, 22, 32
  1534.             16, 26, 36
  1535.  
  1536. Linear    (13,23,33) The point used to specify the first
  1537.           extension line.
  1538.           (14,24,34) The point used to specify the second
  1539.           extension line.
  1540.           (10,20,30) The point used to specify the dimension
  1541.           line.
  1542.  
  1543.  
  1544. Figure 11-1. Linear dimensioning coordinate group codes
  1545.  
  1546. Angular   (13,23,33) and (14,24,34)     The endpoints of the
  1547.                                         first extension line.
  1548.           (10,20,30) and (15,25,35)     The endpoints of the
  1549.                                         second extension line.
  1550.           (16,26,36)                    The point used to specify
  1551.                                         the dimension line arc.
  1552.  
  1553. Figure 11-2. Angular dimensioning coordinate group codes
  1554.  
  1555. Angular   (15,25,35)                    The vertex of the angle.
  1556. (3-point) (13,23,33)                    The endpoints of the
  1557.                                         first extension line.
  1558.           (14,24,34)                    The endpoints of the
  1559.                                         second extension line.
  1560.           (10,20,30)                    The point used to specify
  1561.                                         the dimension line arc.
  1562.  
  1563. Figure 11-3. Angular (3-point) dimensioning coordinate group
  1564.              codes
  1565.  
  1566. Diameter  (15,25,35)                    The point used to pick
  1567.                                         the circle/arc to
  1568.                                         dimension.
  1569.           (10,20,30)                    The point on that circle
  1570.                                         directly across from the
  1571.                                         pick point.
  1572.  
  1573. Figure 11-4. Diameter dimensioning coordinate group codes
  1574.  
  1575. Radius    (15,25,35)                    The point used to pick
  1576.                                         the circle/arc to
  1577.                                         dimension.
  1578.           (10,20,30)                    The center of that
  1579.                                         circle.
  1580.  
  1581. Figure 11-5. Radius dimensioning coordinate group codes
  1582.  
  1583. Ordinate  (13,23,33)                    The point used to select
  1584.                                         the feature.
  1585.           (14,24,34)                    The point used to locate
  1586.                                         the leader end point.
  1587.  
  1588. Figure 11-6. Ordinate dimensioning coordinate group codes
  1589.  
  1590.  
  1591. Entity Coordinate Systems (ECS)
  1592.  
  1593. To save space in the drawing database (and in the DXF file), the
  1594. points associated with each entity are expressed in terms of the
  1595. entity's own Entity Coordinate System (ECS). The Entity
  1596. Coordinate System allows AutoCAD to use a much more compact means
  1597. of representation for entities. With ECS, the only additional
  1598. information needed to describe the entity's position in 3D space
  1599. is the 3D vector describing the Z axis of the ECS, and the
  1600. elevation value.
  1601.  
  1602. For a given Z axis (or extrusion) direction, there are an
  1603. infinite number of coordinate systems, defined by translating the
  1604. origin in 3D space and by rotating the X and Y axes around the Z
  1605. axis. However, for the same Z axis direction, there is only one
  1606. Entity Coordinate System. It has the following properties:
  1607.  
  1608. *    Its origin coincides with the WCS origin.
  1609.  
  1610. *    The orientation of the X and Y axes within the XY plane are
  1611.      calculated in an arbitrary, but consistent manner. AutoCAD
  1612.      performs this calculation using the arbitrary axis algorithm
  1613.      (described later).
  1614.  
  1615. For some entities, the ECS is equivalent to the World Coordinate
  1616. System and all points (DXF groups 10 - 37) are expressed in World
  1617. coordinates. See the following table.
  1618.  
  1619. Table 11-18. Coordinate systems associated with an entity type
  1620.  
  1621. Entities                      Notes
  1622.  
  1623. Line, Point, 3DFace, 3D       These entities do not lie in a
  1624. Polyline, 3d vertex, 3D      particular plane. All points are
  1625. Mesh, 3D Mesh vertex          expressed in World coordinates. Of
  1626.                               these entities, only Lines and
  1627.                               Points can be extruded; their
  1628.                               extrusion direction can differ from
  1629.                               the World Z axis
  1630.  
  1631. Circle, Arc, Solid, Trace,    These entities are planar in
  1632. Text, Attrib, Attdef, Shape,  nature. All points are expressed in
  1633. Insert, 2D Polyline, 2D       Entity coordinates. All of these
  1634. Vertex                        entities can be extruded; their
  1635.                               extrusion direction can differ from
  1636.                               the World Z axis
  1637.  
  1638. Dimension                     Some of a Dimension's points are
  1639.                               expressed in WCS, and some in ECS
  1640.  
  1641. Viewport                      Expressed in World coordinates
  1642.  
  1643. Others                        The remaining entities have no
  1644.                               point data and their coordinate
  1645.                               systems are therefore irrelevant
  1646.  
  1647. Once AutoCAD has established the ECS for a given entity, here's
  1648. how it works:
  1649.  
  1650. *     The elevation value stored with an entity indicates how far
  1651.       along the Z axis to shift the XY plane from the WCS origin
  1652.       to make it coincide with the plane that the entity is in.
  1653.       How much of this is the user-defined elevation is
  1654.       unimportant.
  1655.  
  1656. *     Any 2D points describing the entity that were entered
  1657.       through the UCS are transformed into the corresponding 2D
  1658.       points in the ECS, which (more often than not) is shifted
  1659.       and rotated with respect to the UCS.
  1660.  
  1661. These are a few ramifications of this process:
  1662.  
  1663. *     You cannot reliably find out what UCS was in effect when an
  1664.       entity was acquired.
  1665.  
  1666. *     When you enter the XY coordinates of an entity in a given
  1667.       UCS and then do a DXFOUT, you probably won't recognize
  1668.       those XY coordinates in the DXF file. You'll have to know
  1669.       the method by which AutoCAD calculates the X and Y axes in
  1670.       order to work with these values.
  1671.  
  1672. *     The elevation value stored with an entity and output in DXF
  1673.       files will be a sum of the Z-coordinate difference between
  1674.       the UCS XY plane and the ECS XY plane, and the elevation
  1675.       value that the user specified at the time the entity was
  1676.       drawn.
  1677.  
  1678.  
  1679. Arbitrary Axis Algorithm
  1680.  
  1681. The arbitrary axis algorithm is used by AutoCAD internally to
  1682. implement the arbitrary but consistent generation of Entity
  1683. Coordinate Systems for all entities except Lines, Points, 3D
  1684. Faces, and 3D Polylines, which contain points in World
  1685. coordinates.
  1686.  
  1687. Given a unit-length vector to be used as the Z axis of a
  1688. coordinate system, the arbitrary axis algorithm generates a
  1689. corresponding X axis for the coordinate system. The Y axis
  1690. follows by application of the right-hand rule.
  1691.  
  1692. The method is to examine the given Z axis (also called the
  1693. normal vector) and see if it is close to the positive or
  1694. negative World Z axis. If it is, cross the World Y axis with the
  1695. given Z axis to arrive at the arbitrary X axis. If not, cross the
  1696. World Z axis with the given Z axis to arrive at the arbitrary X
  1697. axis. The boundary at which the decision is made was chosen to be
  1698. both inexpensive to calculate and completely portable across
  1699. machines. This is achieved by having a sort of "square" polar
  1700. cap, the bounds of which is 1/64, which is precisely specifiable
  1701. in 6 decimal fraction digits and in 6 binary fraction bits.
  1702.  
  1703. In mathematical terms, the algorithm does the following (all
  1704. vectors are assumed to be in 3D space, specified in the World
  1705. Coordinate System):
  1706.  
  1707.      Let the given normal vector be called N.
  1708.      Let the World Y axis be called Wy, which is always (0, 1, 0)
  1709.      Let the World Z axis be called Wz, which is always (0, 0, 1)
  1710.  
  1711. We are looking for the arbitrary X and Y axes to go with the
  1712. normal N. They'll be called Ax and Ay. N could also be called Az
  1713. (the arbitrary Z axis):
  1714.  
  1715.      If (abs (Nx) < 1/64) and (abs (N ) < 1/64) then
  1716.          Ax = Wy x N (where "x" is the cross-product operator).
  1717.      Otherwise,
  1718.          Ax = Wz X N.
  1719.      Scale Ax to unit length.
  1720.  
  1721. The method of getting the Ay vector would be:
  1722.      Ay = N x Ax. Scale Ay to unit length.
  1723.  
  1724. Extended Entity Data
  1725.  
  1726. Extended entity data is created by applications such as the
  1727. Advanced Modeling Extension (AME), or by routines written with
  1728. AutoLISP or ADS. Extended entity data is also produced by
  1729. creating PostScript output with PSOUT. If an entity contains
  1730. extended data, it follows the entity's normal definition data.
  1731.  
  1732. The group codes 1000 through 1071 describe extended entity data.
  1733. The following is an example of an entity containing extended
  1734. entity data in DXF format.
  1735.  
  1736.  
  1737. Figure 11-7. Example of extended entity data
  1738.  
  1739. *** INSERT FIGURE HERE ***
  1740.  
  1741. Organization of Extended Entity Data
  1742.  
  1743. As you can see in the above example, group code 1001 indicates
  1744. the beginning of extended entity data. This is followed by one or
  1745. more 1000 group codes. Application names are string values (in
  1746. the example, the application name is AME_SOL). In contrast to
  1747. normal entity data, the same group code can appear multiple
  1748. times, and order is important.
  1749.  
  1750. Extended entity data are grouped by registered application name,
  1751. and each registered application's group begins with a 1001 group
  1752. code with the registered application name as the string value.
  1753. Registered application names correspond to APPID symbol table
  1754. entries, which are essentially placeholders for registered
  1755. application names.
  1756.  
  1757. An application can use as many APPID names as needed, although
  1758. one will often suffice. APPID names are permanent, although they
  1759. can be purged if they aren't currently used in the drawing.
  1760.  
  1761. Each APPID name can have no more than one data group attached to
  1762. each entity. Within an application's group, the sequence of
  1763. extended entity data groups and their meaning is defined by the
  1764. application.
  1765.  
  1766. Note. PostScript images and PostScript fill requests for
  1767. Polylines are stored in the AutoCAD database as extended entity
  1768. data belonging to the AUTOCAD_POSTSCRIPT_FIGURE application.
  1769.  
  1770. As the example in the previous figure shows, the group codes for
  1771. extended entity data begin at 1000 and currently extend to 1071.
  1772. The following list of extended entity data group codes are
  1773. supported by AutoCAD, which maintains and manipulates their
  1774. values as described:
  1775.  
  1776. Table 11-19. extended entity data group codes and descriptions
  1777.  
  1778. Entity Name    Group      Description
  1779.                code
  1780.  
  1781. String         1000       Strings in extended entity data can be
  1782.                           up to 255 bytes long (with the 256th
  1783.                           byte reserved for the null character)
  1784.  
  1785. Application    1001       Application names can be up to 31 bytes
  1786.                           long (the 32d byte is reserved for the
  1787.                           null character). Use of application
  1788.                           names is described in more detail later
  1789.                           in this section
  1790.                           Caution: Do not add a 1001 group into
  1791.                           your extended entity data, as AutoCAD
  1792.                           will assume it is the beginning of a
  1793.                           new application extended entity data
  1794.                           group
  1795.  
  1796. Control        1002       An extended data control string can be
  1797. string                    either "{" or "}"; these braces enable
  1798.                           applications to organize their data by
  1799.                           subdividing the data into lists. The
  1800.                           left brace begins a list, and a right
  1801.                           brace terminates the most recent list;
  1802.                           lists can be nested When AutoCAD reads
  1803.                           the extended entity data for a
  1804.                           particular application, it checks to
  1805.                           ensure that braces are balanced
  1806.                           correctly
  1807.  
  1808. Layer name     1003       Name of the layer associated with the
  1809.                           extended entity data
  1810.  
  1811. Binary data    1004       Binary data is organized into
  1812.                           variable-length chunks.The
  1813.                           maximum length of each chunk is 127
  1814.                           bytes. Binary data is represented as a
  1815.                           string of hexadecimal digits, two per
  1816.                           binary byte, in ASCII DXF files
  1817.  
  1818. Database       1005       Handles of entities in the drawing
  1819. handle                    database
  1820.                           Note. When a drawing with handles and
  1821.                           extended entity data handles is
  1822. imported
  1823.                           into another drawing using INSERT,
  1824. INSERT
  1825.                           *, XREF Bind, XBIND, or partial DXFIN,
  1826.                           the extended entity data handles are
  1827.                           translated in the same manner as their
  1828.                           corresponding entity handles, thus
  1829.                           maintaining their binding. This is also
  1830.                           done in the EXPLODE Block operation, or
  1831.                           for any other AutoCAD operation. When
  1832.                           AUDIT detects an extended entity data
  1833.                           handle that doesn't match the handle of
  1834.                           an entity in the drawing file, it is
  1835.                           considered an error. If AUDIT is fixing
  1836.                           entities, it sets the handle to 0.
  1837.  
  1838. 3 reals        1010,      Three real values, in the order X, Y,
  1839. Z.
  1840.                1020,      They can be used as a point or vector
  1841.                1030       record. AutoCAD never alters their
  1842.                           value
  1843.  
  1844. World space    1011,      Unlike a simple 3D point, the World
  1845. space
  1846. position       1021,      coordinates are moved, scaled, rotated,
  1847.                1031       and mirrored along with the parent
  1848.                           entity to which the extended data
  1849.                           belongs. The world space position is
  1850. also
  1851.                           stretched when the STRETCH command is
  1852.                           applied to the parent entity and this
  1853.                           point lies within the select window
  1854.  
  1855. World space    1012,      Also a 3D point that is scaled,
  1856. rotated,
  1857. displacement   1022,      and mirrored along with the parent (but
  1858.                1032       not moved or stretched)
  1859.  
  1860. World          1013,      Also a 3D point that is rotated and
  1861. direction      1023,      mirrored along with the parent (but not
  1862.                           moved, scaled, or stretched).
  1863.  
  1864. Real           1040       A real value
  1865.  
  1866. Distance       1041       A real value that is scaled along with
  1867.                           the parent entity
  1868.  
  1869. Scale factor   1042       Also a real value that is scaled along
  1870.                           with the parent. The difference between
  1871.                           a distance and a scale factor is
  1872.                           application-defined
  1873.  
  1874. Integer        1070       A 16-bit integer (signed or unsigned)
  1875.  
  1876. Long           1071       A 32-bit signed (long) integer
  1877.  
  1878. For more information on extended entity data and the APPID table,
  1879. refer to the AutoCAD Development System Programmer's Reference
  1880. and the AutoLISP Programmer's Reference.
  1881.  
  1882.  
  1883. Writing DXF Interface Programs
  1884.  
  1885. Writing a program that communicates with AutoCAD via the DXF
  1886. mechanism often appears far more difficult than it really is. The
  1887. DXF file contains a seemingly overwhelming amount of information,
  1888. and examining a DXF file manually may lead to the conclusion that
  1889. the task is hopeless.
  1890.  
  1891. However, the DXF file has been designed to be easy to process by
  1892. program, not manually. The format was intentionally constructed
  1893. to make it easy to ignore information you don't need while easily
  1894. reading the information you do need. Just remember to handle the
  1895. groups in any order and ignore any group you don't care about.
  1896.  
  1897. As an example, the following is a Microsoft BASIC(TM) program
  1898. that reads a DXF file and extracts all the Line entities from the
  1899. drawing (ignoring lines that appear inside Blocks). It prints the
  1900. endpoints of these lines on the screen. As an exercise you might
  1901. try entering this program into your computer, running it on a DXF
  1902. file from one of your drawings, then enhancing it to print the
  1903. center point and radius of any circles it encounters. This
  1904. program is not put forward as an example of clean programming
  1905. technique nor the way a general DXF processor should be written;
  1906. it is presented as an example of just how simple a DXF-reading
  1907. program can be.
  1908.  
  1909. 1000      REM
  1910. 1010      REM Extract lines from DXF file
  1911. 1020      REM
  1912. 1030      G1% = 0
  1913. 1040      LINE INPUT "DXF file name: "; A$
  1914. 1050      OPEN "i", 1, A$ + ".dxf"
  1915. 1060      REM
  1916. 1070      REM Ignore until section start encountered
  1917. 1080      REM
  1918. 1090      GOSUB 2000
  1919. 1100      IF G% <> 0 THEN 1090
  1920. 1110      IF S$ <> "SECTION" THEN 1090
  1921. 1120      GOSUB 2000
  1922. 1130      REM
  1923. 1140      REM Skip unless ENTITIES section
  1924. 1150      REM
  1925. 1160      IF S$ <> "ENTITIES" THEN 1090
  1926. 1170      REM
  1927. 1180      REM Scan until end of section, processing LINEs
  1928. 1190      REM
  1929. 1200      GOSUB 2000
  1930. 1210      IF G% = 0 AND S$ = "ENDSEC" THEN 2200
  1931. 1220      IF G% = 0 AND S$ = "LINE" THEN GOSUB 1400 : GOTO 1210
  1932. 1230      GOTO 1200
  1933. 1400      REM
  1934. 1410      REM Accumulate LINE entity groups
  1935. 1420      REM
  1936. 1430      GOSUB 2000
  1937. 1440      IF G% = 10 THEN X1 = X : Y1 = Y : Z1 = Z
  1938. 1450      IF G% = 11 THEN X2 = X : Y2 = Y : Z2 = Z
  1939. 1460      IF G% = 0 THEN PRINT "Line from
  1940. (";X1;",";Y1;",";Z1;") to (";X2;",";Y2;",";Z2;")":RETURN
  1941. 1470      GOTO 1430
  1942. 2000      REM
  1943. 2010      REM Read group code and following value
  1944. 2020      REM For X coordinates, read Y and possibly Z also
  1945. 2030      REM
  1946. 2040      IF G1% < 0 THEN G% = -G1% : G1% = 0 ELSE INPUT #1, G%
  1947. 2050      IF G% < 10 OR G% = 999 THEN LINE INPUT #1, S$ : RETURN
  1948. 2060      IF G% >= 38 AND G% <= 49 THEN INPUT #1, V : RETURN
  1949. 2080      IF G% >= 50 AND G% <= 59 THEN INPUT #1, A : RETURN
  1950. 2090      IF G% >= 60 AND G% <= 69 THEN INPUT #1, P% : RETURN
  1951. 2100      IF G% >= 70 AND G% <= 79 THEN INPUT #1, F% : RETURN
  1952. 2110      IF G% >= 210 AND G% <= 219 THEN 2130
  1953. 2115      IF G% >= 1000 THEN LINE INPUT #1, T$ : RETURN
  1954. 2120      IF G% >= 20 THEN PRINT "Invalid group code";G% : STOP
  1955. 2130      INPUT #1, X
  1956. 2140      INPUT #1, G1%
  1957. 2150      IF G1% <> (G%+10) THEN PRINT "Invalid Y coord code";
  1958.           Gl% : STOP
  1959. 2160      INPUT #1, Y
  1960. 2170      INPUT #1, G1%
  1961. 2180      IF G1% <> (G%+20) THEN G1% = -G1% ELSE INPUT #1, Z
  1962. 2190      RETURN
  1963. 2200      CLOSE 1
  1964.  
  1965. Writing a program that constructs a DXF file is more difficult,
  1966. because you must maintain consistency within the drawing in order
  1967. for AutoCAD to find the file acceptable. AutoCAD lets you omit
  1968. many items in a DXF file and still obtain a usable drawing. The
  1969. entire HEADER section can be omitted if you don't need to set any
  1970. header variables. Any of the tables in the TABLES section can be
  1971. omitted if you don't need to make any entries, and the entire
  1972. TABLES section can be dropped if nothing in it is required. If
  1973. you define any linetypes in the LTYPE table, this table must
  1974. appear before the LAYER table. If no Block Definitions are used
  1975. in the drawing, the BLOCKS section can be omitted. If present,
  1976. however, the BLOCKS section must appear before the ENTITIES
  1977. section. Within the ENTITIES section, you can reference layer
  1978. names even though you haven't defined them in the LAYER table.
  1979. Such layers are automatically created with color 7 and the
  1980. CONTINUOUS linetype. The EOF item must be present at the
  1981. end-of-file.
  1982.  
  1983. The following Microsoft BASIC program constructs a DXF file
  1984. representing a polygon with a specified number of sides, leftmost
  1985. origin point, and side length. This program supplies only the
  1986. ENTITIES section of the DXF file, and places all entities
  1987. generated on the default layer 0. This may be taken as an example
  1988. of a minimum DXF generation program. Since this program doesn't
  1989. create the drawing header, the drawing limits, extents, and
  1990. current view will be invalid after performing a DXFIN on the
  1991. drawing generated by this program. You can do a ZOOM E to fill
  1992. the screen with the drawing generated. Then adjust the limits
  1993. manually.
  1994.  
  1995. 1000      REM
  1996. 1010      REM Polygon generator
  1997. 1020      REM
  1998. 1030      LINE INPUT "Drawing (DXF) file name: "; A$
  1999. 1040      OPEN "o", 1, A$ + ".dxf"
  2000. 1050      PRINT #1, 0
  2001. 1060      PRINT #1, "SECTION"
  2002. 1070      PRINT #1, 2
  2003. 1080      PRINT #1, "ENTITIES"
  2004. 1090      PI = ATN(1) * 4
  2005. 1100      INPUT "Number of sides for polygon: "; S%
  2006. 1110      INPUT "Starting point (X,Y):"; X, Y
  2007. 1120      INPUT "Polygon side: "; D
  2008. 1130      A1 = (2 * PI) / S%
  2009. 1140      A = PI / 2
  2010. 1150      FORI% = 1 TO S%
  2011. 1160      PRINT #1, 0
  2012. 1170      PRINT #1, "LINE"
  2013. 1180      PRINT #1, 8
  2014. 1190      PRINT #1, "0"
  2015. 1200      PRINT #1, 10
  2016. 1210      PRINT #1, X
  2017. 1220      PRINT #1, 20
  2018. 1230      PRINT #1, Y
  2019. 1240      PRINT #1, 30
  2020. 1250      PRINT #1, 0.0
  2021. 1260      NX = D * COS(A) + X
  2022. 1270      NY = D * SIN(A) + Y
  2023. 1280      PRINT #1, 11
  2024. 1290      PRINT #1, NX
  2025. 1300      PRINT #1, 21
  2026. 1310      PRINT #1, NY
  2027. 1320      PRINT #1, 31
  2028. 1330      PRINT #1, 0.0
  2029. 1340      X = NX
  2030. 1350      Y = NY
  2031. 1360      A = A + A1
  2032. 1370      NEXT I%
  2033. 1380      PRINT #1, 0
  2034. 1390      PRINT #1, "ENDSEC"
  2035. 1400      PRINT #1, 0
  2036. 1410      PRINT #1, "EOF"
  2037. 1420      CLOSE 1
  2038.  
  2039. The DXFIN command is relatively forgiving with respect to the
  2040. format of data items. As long as a properly formatted item
  2041. appears on the line on which the data is expected, DXFIN will
  2042. accept it (of course, string items should not have leading spaces
  2043. unless these are intended to be part of the string). This program
  2044. takes advantage of this flexibility in input format, and does not
  2045. try to generate a file appearing exactly like one generated by
  2046. AutoCAD.
  2047.  
  2048. In the case of error loading a DXF file using DXFIN, AutoCAD
  2049. reports the error with a message indicating the nature of the
  2050. error and the last line processed in the DXF file before the
  2051. error was detected. This may not be the line on which the error
  2052. occurred, especially in the case of errors such as omission of
  2053. required groups.
  2054.  
  2055. Binary Drawing Interchange Files
  2056.  
  2057. The ASCII DXF file format described in the preceding sections of
  2058. this chapter is a complete representation of an AutoCAD drawing
  2059. in an ASCII text form easily processed by other programs. In
  2060. addition, AutoCAD can produce or read a binary form of the full
  2061. DXF file, and accepts limited input in another binary file
  2062. format. These binary files are described in the following
  2063. sections.
  2064.  
  2065.  
  2066. Binary DXF Files
  2067.  
  2068. The DXFOUT command provides a Binary option that writes binary
  2069. DXF files. Such a file contains all of the information present in
  2070. an ASCII DXF file, but in a more compact form that takes,
  2071. typically, 25% less file space and can be read and written more
  2072. quickly (typically 5 times faster) by AutoCAD. Unlike ASCII DXF
  2073. files, which entail a trade-off between size and floating-point
  2074. accuracy, binary DXF files preserve all of the accuracy in the
  2075. drawing database. AutoCAD Release 10 was the first version to
  2076. support this form of DXF file; it cannot be read by older
  2077. versions.
  2078.  
  2079. A binary DXF file begins with a 22-byte sentinel consisting of:
  2080.  
  2081.      AutoCAD Binary DXF<CR><LF><SUB><NUL>
  2082.  
  2083. Following the sentinel are (group, value) pairs as in an ASCII
  2084. DXF file, but represented in binary form. The group code is a
  2085. single-byte binary value, and the value that follows is one of
  2086. the following:
  2087.  
  2088. *    A two-byte integer with the least-significant byte first and
  2089.      the most-significant byte last.
  2090.  
  2091. *    An eight-byte IEEE double precision floating-point number
  2092.      stored with the least-significant byte first and the
  2093.      most-significant byte last.
  2094.  
  2095. *    An ASCII string terminated by a zero (NUL) byte.
  2096.  
  2097. The type of the datum following a group is determined from the
  2098. group code according to the same rules used in decoding ASCII DXF
  2099. files. Translation of angles to degrees, and dates to fractional
  2100. Julian date representation, is performed for binary files as well
  2101. as for ASCII DXF files. The comment group, 999, is not used in
  2102. binary DXF files.
  2103.  
  2104. Extended entity data group codes are represented in Binary DXF as
  2105. a single byte with the value 255, followed by a 2-byte integer
  2106. value containing the actual group code, followed by the actual
  2107. value.
  2108.  
  2109. Extended entity data long (group code 1071) values occupy 4 bytes
  2110. of data. Extended entity data binary chunks (group code 1004) are
  2111. represented as a single-byte, unsigned integer length, followed
  2112. by the specified number of bytes of chunk data. For example, to
  2113. transfer an extended entity data long group, the following values
  2114. would appear, occupying 1, 2, and 4 bytes respectively:
  2115.  
  2116. 255       Escape group code.
  2117. 1071      True group code.
  2118. 999999    Value for the 1071 group code.
  2119.  
  2120. DXFOUT writes binary DXF files with the same file type (.dxf) as
  2121. for ASCII DXF files. The DXFIN command automatically recognizes a
  2122. binary file (by means of its sentinel string) and loads the file.
  2123. There is no need for you to identify it as a binary file.
  2124.  
  2125. If DXFIN encounters an error in a binary DXF file, it reports the
  2126. byte address within the file where the error was detected.
  2127.  
  2128.  
  2129. Binary Drawing Interchange (DXB) Files
  2130.  
  2131. The DXF file formats described earlier in this chapter are
  2132. complete representations of an AutoCAD drawing that can be
  2133. written and read by AutoCAD and other programs. However,
  2134. AutoShade and programs executed via the external commands
  2135. facility (chapter 3) often need to supply simple geometric input
  2136. to AutoCAD. For these purposes, another file format even more
  2137. compact than the binary DXF format is supported. This format,
  2138. called DXB (for drawing interchange binary) is limited in the
  2139. entities it can represent.
  2140.  
  2141. DXBIN Command
  2142.  
  2143. To load a DXB file produced by a program such as AutoShade, enter
  2144. the DXBIN command:
  2145.  
  2146.           Command: dxbin
  2147.  
  2148. When AutoCAD prompts you, respond with the name of the file you
  2149. want to load. You don't need to include a file type; dxb is
  2150. assumed.
  2151.  
  2152.  
  2153. DXB File Format
  2154.  
  2155. Important. This information is for experienced programmers and is
  2156. subject to change without notice.
  2157.  
  2158. The format of a DXB file is as follows:
  2159.  
  2160.           Header: "AutoCAD DXB 1.0" CR LF ^Z NUL    (19bytes)
  2161.           Data: ...Zero or more data records...
  2162.           Terminator: NUL                           (1 byte)
  2163.  
  2164. Each data record begins with a single byte identifying the record
  2165. type, followed by data items. The data items have various forms
  2166. of representation and encoding. In the descriptions following,
  2167. each data item is prefixed with a letter and a hyphen. The
  2168. meaning of the letter codes is as follows:
  2169.  
  2170. w-        16-bit integer, byte reversed in the standard 8Ox86
  2171.           style (least significant byte first, most-significant
  2172.           byte second).
  2173.  
  2174. f-        IEEE 64-bit floating-point value stored with lsb first,
  2175.           msb last (as stored by an 8Ox87).
  2176.  
  2177. l-        32-bit integer with the bytes reversed 8Ox86 style.
  2178.  
  2179. n-        Number which may be either a 16-bit integer or a
  2180.           floating-point number depending on the most recent
  2181.           setting of the number mode data item. The number mode
  2182.           defaults to 0, signifying integers. If set to 1, all n-
  2183.           items will be read as floating-point.
  2184.  
  2185. u-        Item which is either a 32-bit integer or a
  2186.           floating-point number depending on the most recent
  2187.           number mode setting. If a 32-bit integer, the value is
  2188.           scaled by multiplying it by 65536 (2^16). If a
  2189.           floating-point value, no scaling is applied.
  2190.  
  2191. a-        Item representing an angle. If number mode is integer,
  2192.           this is a 32-bit integer representing an angle in units
  2193.           of millionths of a degree (range 0 to 360,000,000). If
  2194.           a floating-point number, represents degrees.
  2195.  
  2196. In the following table, the lengths anteed the item-type byte and
  2197. assume the number mode is set to zero (integer mode). If number
  2198. mode is floating-point, add 6 bytes to the length for each n-
  2199. item present and 4 bytes for each a-, or u- item present.
  2200.  
  2201.  
  2202. Table 11-20. Byte length for item types
  2203.  
  2204. Item type    Code      Data Items                    Length
  2205.              (decimal)                               (bytes)
  2206.  
  2207. Line         1         n-fromx n-fromy               13
  2208.                        n-tox n-toy
  2209.                        n-fromx n-fromy n-fromz
  2210.                        n-tox n-toy n-toz
  2211.  
  2212. Point        2         n-x n-y                       5
  2213.  
  2214. Circle       3         n-ctrx n-ctry n-rad           7
  2215.  
  2216. Arc          8         n-ctrx n-ctry n-rad           19
  2217.                        a-starta a-enda
  2218.  
  2219. Trace        9         n-x1 n-y1 n-x2 n-y2           17
  2220.                        n-x3 n-y3 n-x4 n-y4
  2221.  
  2222. Solid        11        n-x1 n-y1 n-x2 n-y2           17
  2223.                        n-x3 n-y3 n-x4 n-y4
  2224.  
  2225. Seqend       17        (none)                        1
  2226.  
  2227. Polyline     19        w-closureflag                 3
  2228.  
  2229. Vertex       20        n-x n-y                       5
  2230.  
  2231. 3Dface       22        n-x1 n-y1 n-z1                25
  2232.                        n-x2 n-y2 n-z2
  2233.                        n-x3 n-y3 n-z3
  2234.                        n-x4 n-y4 n-z4
  2235.  
  2236. Scale Factor 128       f-scalefac                    9
  2237.  
  2238. New Layer    129       "layername" NUL               layername
  2239.                                                      length + 2
  2240.  
  2241. Line         130       n-tox n-toy                   5
  2242. Extension
  2243.  
  2244. Trace        131       n-x3 n-y3 n-x4 n-y4           9
  2245. Extension
  2246.  
  2247. Block Base   132       n-bx n-by                     5
  2248.  
  2249. Bulge        133       u-2h/d                        5
  2250.  
  2251. Width        134       n-startw n-endw               5
  2252.  
  2253. Number Mode  135       w-mode                        3
  2254.  
  2255. New Color    136       w-colomum                     3
  2256.  
  2257. 3Dline       137       n-tox n-toy n-toz             7
  2258. Extension
  2259.  
  2260. The Line Extension item extends the last line or line extension
  2261. from its To point to a new To point:. The Trace Extension item
  2262. similarly extends the last trace solid, or Trace Extension from
  2263. its x3,y3-x4,y4 ending line to a new x3,y3--x4,y4 line.
  2264.  
  2265. The Scale Factor is a floating-point value by which all integer
  2266. coordinates are multiplied to obtain the floating-point
  2267. coordinates used by the actual entities. The initial scale
  2268. factor when a file is read is 1.0. The New Layer item creates a
  2269. layer if none exists, giving the new layer the same defaults as
  2270. the LAYER New command, and sets that layer as the current layer
  2271. for subsequent entities. At the end of the DXB file load, the
  2272. layer in effect before the command is restored.
  2273.  
  2274. The Block Base item specifies the base (origin) point of a
  2275. created Block. The Block base must be defined before the first
  2276. entity record is encountered. If DXB is not defining a Block,
  2277. this specification will be ignored.
  2278.  
  2279. A Polyline consists of straight segments of fixed width
  2280. connecting the vertices, except as overridden by the Bulge and
  2281. Width items described below. The closure flag should be 0 or 1;
  2282. if it is 1, then there is an implicit segment from the last
  2283. vertex (immediately before the Seqend) to the first vertex.
  2284.  
  2285. A Bulge item, encountered between two Vertex items (or after the
  2286. last Vertex of a closed Polyline), indicates that the two
  2287. vertices are connected by an arc rather than a straight segment.
  2288. If the line segment connecting the vertices would have length d,
  2289. and the perpendicular distance from the midpoint of that segment
  2290. to the arc is h, then the magnitude of the Bulge is (2 * h / d).
  2291. The sign is negative if the arc from the first vertex to the
  2292. second is clockwise. A semicircle thus has a bulge of 1 (or -1).
  2293. If the number mode is 0 (integer), Bulge items are scaled by 2
  2294. 16. If the number mode has been set to floating-point, then the
  2295. floating-point value supplied is just 2*h/d (not scaled).
  2296.  
  2297. The Width item indicates the starting and ending widths of the
  2298. segment (straight or curved) connecting two vertices. This width
  2299. stays in effect until the next width item or the Seqend. If there
  2300. is a Width item between the Polyline item and the first Vertex,
  2301. it is stored as a default width for the Polyline; this saves
  2302. considerable database space if the Polyline has several segments
  2303. of this width.
  2304.  
  2305. The Number Mode item controls the mode of items with types given
  2306. in the table above as n-, a-, or u-. If the value supplied is
  2307. zero, these values will be integers, otherwise floating-point.
  2308. The storage and implicit scaling conventions for these values in
  2309. both modes are described earlier.
  2310.  
  2311. Lines share the same cells to remember the last to-point, so you
  2312. shouldn't mix extension groups for the two entities without an
  2313. initial group before the extension. There is no extension group
  2314. for 3Dfaces, as there's no obvious edge to extend from.
  2315.  
  2316. The New Color group specifies the color for subsequent entities
  2317. in the DXB file. The w-colomum word argument is in the range from
  2318. 0 to 256. 0 means color by block, 1-255 are the standard AutoCAD
  2319. colors, and 256 means color by layer. A color outside the range
  2320. from 0 to 256 sets the color back to the current entity color
  2321. (you can do this deliberately, and it can be quite handy). The
  2322. initial entity color of material added by DXBIN is the current
  2323. entity color.
  2324.  
  2325. All points specified in the DXB file are interpreted in terms of
  2326. the current UCS at the time the DXBIN command is executed.
  2327.  
  2328.  
  2329. Writing DXB Files
  2330.  
  2331. There is no direct AutoCAD command to write a DXB file, but the
  2332. special ADI plotter driver can write such a file. If you want to
  2333. create a DXB file from an AutoCAD drawing, configure the ADI
  2334. plotter and select its DXB file output option.
  2335.  
  2336.  
  2337. Initial Graphics Exchange Specification (IGES) Files
  2338.  
  2339. Using the commands described in this section, you can instruct
  2340. AutoCAD to read and write IGES-format interchange files.
  2341.  
  2342. Note: The format of IGES files and the mapping performed to
  2343. translate between AutoCAD drawing information and IGES are
  2344. described in the separate AutoCAD/IGES Interface Specifications
  2345. document.
  2346.  
  2347.  
  2348. IGESOUT Command
  2349.  
  2350. You can generate an Initial Graphics Exchange Specification
  2351. (IGES) interchange file from an existing AutoCAD drawing by means
  2352. of the IGESOUT command:
  2353.  
  2354.      Command: igesout
  2355.  
  2356. When AutoCAD prompts you, respond with a filename or press
  2357. (ENTER) to accept the default.
  2358.  
  2359. The default name for the output file is the same as that of the
  2360. current drawing but with a file type of igs. If you specify an
  2361. explicit filename without including a file type, igs is assumed.
  2362. If a file with the same name already exists, it is deleted. If
  2363. FILEDIA is on, and a file with the same name already exists,
  2364. AutoCAD tells you; allowing you to OK or cancel the deletion.
  2365.  
  2366. IGESIN Command
  2367.  
  2368. An IGES interchange file can be converted into an AutoCAD drawing
  2369. by means of the IGESIN command:
  2370.  
  2371.      Command: igesin
  2372.  
  2373. When AutoCAD prompts you, respond with the name of the IGES file
  2374. to be loaded.
  2375.  
  2376. To load a complete IGES file, you must use IGESIN in an empty
  2377. drawing before any entities have been drawn and before any
  2378. additional Block definitions, layers, linetypes, text styles,
  2379. named views, named coordinate systems, or named viewport
  2380. configurations have been created.
  2381.  
  2382. Note. If the drawing you are using as a prototype is not empty,
  2383. you might find it helpful to open a new drawing using the No
  2384. Prototype... button of the Create New Drawing dialogue box, as
  2385. described in chapter 4 of the AutoCAD Reference Manual. You
  2386. should also be aware that some third-party applications include
  2387. an
  2388. acad.lsp or .mnl file that modifies your drawing upon startup.
  2389.  
  2390. If a serious error is encountered, the input process stops and an
  2391. error message is displayed reporting where the error was found.
  2392. The partial drawing is not discarded.
  2393.  
  2394.