22.1 Description
The DXF tools offer a bidirectional translation between Drawing Exchange Format (DXF) files and STEP DXF files. The dxf2step tool reads a DXF file and writes a STEP DXF file. The step2dxf tool reads a STEP DXF file and writes a DXF file. The converter supports AutoCAD Release 11 ASCII DXF format. For more information on this format, refer to the AutoCAD Release 11 Reference Manual, Appendix C.
22.2 Command Line (All Platforms)
dxf2step [options] filename
step2dxf [options] filename
Both of these forms are wrappers that invoke the dxf_cvt executable.
-o <output_filename>- If this option is used, the output file is written with this name and the appropriate extension. Otherwise the input filename is used with the proper extension. The tool retains only that part of a filename given to it up to, but not including the first `.' It then appends the proper extension when creating the output file.
-v- Verbose mode, each group's code and data will be printed. Since DXF files can be thousands of lines long, this may produce a large amount of data. For a translation from STEP back to DXF, verbose mode reports every entity, table, or header item that is written.
When converting from DXF to STEP, the tool issues a running count of lines translated, warning and error messages, and a final count of the number of header section items, tables, entities, and blocks translated. When converting from STEP to DXF, the tool reports as it begins to write each section of the file and then how many items it wrote in each section. For more detailed reporting in either mode, use the -v option.
The translator will translate all groups supported by AutoCAD Release 11. Optional groups which are not present in the DXF file are assigned their default values in the STEP file. These groups are not written when converting back to DXF if they are set to the default.
Extended Entity Data is supported for every entity. If these groups are present, they are placed, in order, into a list attached to the entity in the extendHook attribute. The group code and the data are preserved. No attempt is made to decode the data.
Comments (group code 999) are reported but not saved. There is no way to maintain their context in the STEP database.
22.3 Control Panel (Windows Only)
The DXF/STEP Converter Control Panel is shown in Figure 22.1. To use this tool, click DXF/STEP Converter in the ST-Developer Control Panel window. Specify the file(s) to convert, the output directory to place the converted files to, and select the direction of the conversion.
Click the OK button to convert the file(s).
If you wish to include multiple files in the process, you have to enclose each file name in double quotes, and separate the file names with spaces. If you use the [...] button and the Open File dialog this is done automatically.
Control Panel Options
DXF/STEP Converter Control Panel has the following elements.
File name(s)
Provides a space to type the name of the file(s) to convert. The [...] button displays the Open File dialog box that can be used to browse the file system and locate the file(s).
Output directory
Provides a space to type the name of the directory where the converted file(s) should be placed. If no output directory is specified, the converted file(s) will be placed in the same directory(ies) that the original file(s).
Direction
Select one of the directions to conver the files either from DXF to STEP or vice versa.
Verbose output
If selected, the tool produces a detailed report of its operation: each group's code and data will be printed. Since DXF files can be thousand of lines long, this may produce a large amount of data.
Option settings are saved in the system registry when you click the OK button, and will be reloaded from the registry next time you open the control panel. Settings are not saved if you click the Cancel button.
22.4 Notes
Some assumptions needed to be made during the development of the converter. These assumptions are listed below:
- VERTEX and ATTRIB entities -- In general, these should only follow POLYLINE and INSERT entities, respectively. However, it isn't specified whether they may stand alone or not. Currently the tool supports them as free-standing entities, if they should occur, by not attaching them to a POLYLINE or INSERT entity.
- Undocumented Group Codes -- The groups for the DIMENSION table numbered 145 and up are undocumented (ref. chart on page 530 of AutoCAD Release 11 Reference Manual). Currently they represent the types that the codes 100 less represent.
- Optional Groups -- Those groups listed as optional are either assigned their default values, or, in the case of a pointer, left pointing to NULL, unless explicitly set by the input file. For Mode 2 translations, the groups are not written if they are set to their default or NULL. This can result in output files being a different size than those originally read in, i.e. if the original CAD program chose to include optional groups which were default.
- Precision -- Floating point values are now set to write to 8 places. Occasional precision errors occur in the conversion process, as the input usually contains varying field widths. The errors are primarily in the eighth decimal place.