0 28 DWG and DXF
Overview
DWG and DXF are bidirectional data translators that 
let you easily move data between CADKEY and AutoCAD*. 
The DWG format is an unpublished binary file format 
from AutoCAD; .dwg and .dxf files are equivalent to a 
CADKEY part (.prt) file. DXF is the acronym for 
drawing exchange format. You can import an AutoCAD 
drawing into CADKEY and then work with that 
file as a part file or as an AutoCAD drawing file. 
Also, you can export a CADKEY part file, or an 
imported AutoCAD DWG or DXF file to AutoCAD, and then
work with the file in AutoCAD.
The DWG and DXF translators are transparent 
translations between CADKEY and AutoCAD. There are a
few limitations about how DWG and DXF translate or 
support some entities. See 
                            and 
                            in this chapter for 
more information on supported entities and limitations.

Supported Versions
The DWG and DXF translators support the following 
versions of CADKEY, and AutoCAD.
You can import drawings created with AutoCAD, Releases
10, 11, or 12 into CADKEY.
You can export part files created with CADKEY, 
versions 5 or 6 to AutoCAD, Release 10, 11, or 12.

2
16 0 1 # Importing DWG and DXF Files
17 0 2 # Exporting DWG and DXF Files
1 20 Importing DWG and DXF Files
IMPORT
IMPORT brings an AutoCAD drawing into        CADKEY.
You can work with the file as a CADKEY part file or as
default directory for DXF files is dxf. CADKEY adds
an AutoCAD drawing. CADKEY 
                         into the dwg or dxf 
directory you specified when you setup the program. 
The default directory for DWG files is dwg, and the
default directory for DXF files is dxf. CADKEY adds
the dwg or dxf extension automatically. You can 
import one DWG or DXF file at a time.
Also, IMPORT gives you some file management options 
that let you sort, copy, move, delete, view read or 
write attributes, or rename a selected file. 
When you choose IMPORT, the File Import dialog box 
appears. You use the this dialog box to select the 
file to import or on which to use the file 
management options.

 
2
1 38 4 # Mapped
5 0 11 # imports the DWG/DXF file
2 8 Exporting DWG and DXF Files
EXPORT
EXPORT lets you convert a CADKEY part file to 
       AutoCAD Release 10, 11, or 12 format. The 
default directory for DWG is dwg; the default 
directory for DXF is dxf. CADKEY adds the filename 
extension automatically. You can export one DWG or 
DXF file at a time.

1
2 0 4 # Mapped
3 16 OPTIONS
OPTION lets you set DWG or DXF import or export options. 
1. To set DWG options, choose DWG, OPTION.
   To set DXF options, choose DXF, OPTION.

   The DWG/DXF Options dialog box appears. 
   For DWG, a Choose DWG option prompt appears. 
   For DXF, a Choose DXF option prompt appears.
 
2. Choose the                or               
   you want. 
   Click on    to set the options and return to 
   the DWG or DXF menu. 
   Click on        to close the dialog box without 
   changing the settings. 
   Click on      for Help to Options
   
5
8 14 31 # Import Options
8 32 32 # Export Options
10 12 33 # OK
12 12 34 # Cancel
14 12 35 # Help
4 5 Mappings
 Efforts have been to made to do a minimum of Mapping 
 of                            or {AutoCAD to 
 CADKEY Entities}#42 but to preserve the format as 
 much as possible.

1
1 4 41 # CADKEY to AutoCAD entities
11 15 Import the DWG/DXF file
To import a DWG or DXF file, follow these steps: 
1. Load a blank part file.
2. To change the import         for DWG, 
   choose DWG, OPTION.
   To change the import options for DXF, 
   choose DXF, OPTION.
3. To import the file using the defaults, choose IMPORT.
   For DWG, a Choose DWG file to IMPORT prompt appears. 
   For DXF, a Choose DWG file to IMPORT prompt appears. 
4. Select the file you want to import, then click on OK.
   Click on Cancel to close the dialog box without 
   importing the file. 
5. Import another DWG or DXF file or press (Esc) to 
   return to the Main Menu.

1
2 24 3 # options
21 16 Export DWG/DXF file
To export a DWG or DXF file, follow these steps: 
1. Before you begin, make sure you load the file or
   files you want to export. 
2. To change DWG file export        , 
   choose DWG, OPTION.
   To change DXF file export options, 
   choose DXF, OPTION.
   The DWG/DXF Options dialog box appears. 
3. To export the file with the defaults, choose EXPORT.
   DWG and DXF file export defaults are:
4. Type the name of the file you want to export. 
   Click on OK to export the file. Click on Cancel
   to close the dialog box without exporting the file.
5. Export another DWG or DXF file or press (Esc) to 
   return to the Main Menu.

1
3 29 3 # options
31 9 Import Options
   These are the Parameters used to Import a DWG 
   or DXF file :
                    : For Unsupported linetype Only
                 : For Text Fonts
                : Preserve AUTOCAD format or NOT
              : If More than 255 Levels
            :Dimension as CADKEY or Generic 
   Dimension

5
2 3 311 # Default Line Type
3 3 312 # Default Font #
4 3 313 # Entity Format
5 3 314 # Levels 255+
6 3 315 # Dimension
32 7 Export Options:
   These are the Parameters used to Export a DWG 
   or DXF file :
                  : Version for OUTPUT File
                    : Text Font Name 
                         : For Splines and Conics
               :To export External References
 
4
2 3 321 # AutoCAD Version
3 3 322 # Default Font Name
4 3 323 # Chord Height Tolerance
5 3 324 # Export XRefs
33 3 OK
  Click on OK to execute the changes you made in 
  option settings and return to the DWG or DXF menu. 

0
34 3 Cancel 
  Click on Cancel to close the dialog box without 
  making changes and return to the DWG or DXF menu.

0
35 3 Help
 Click on Help to see a help article about DWG or DXF
 import and export options. 

0
41 178 CADKEY to AutoCAD Entities 

CADKEY entity   Exported to AutoCAD as

Arc             Arc.

Arrow           Style1 as solid (outline) 
                Style2 as solid (filled) 
                Style 3 as line (tick) and 
                Style4 as circle.

Circle          Circle

Collectives     Block and insert with a special name
                (CK_COLL). If you export the part 
                file to AutoCAD and then import the
                same file into CADKEY, you may 
                experience some data loss.
Conic           Conics are not directly supported by
                AutoCAD. Exported as curve-fit 
                polyline-a polyline with the best 
                fit between two vertices.

Copius Data     Cannot export.

Cross-Hatch     Block and Instance. Block will 
                contain several lines with 
                appropriate line styles.

Dimension       Dimension. The translator exports 
                Generic dimensions as a Block and 
                Instance. Dimension information 
                structure for each dimension entity 
                is not exported. The Generic 
                Dimension entity will be exported 
                as a block and instance with a 
                "GEMDIM" prefix in the name.

Drawing Layout  Not exported.

Drawing Layout  Not exported.
Instance

File Note       Block and Instance. The Block 
                contains several text entities for 
                each line.

Font            User-defined. See the DWG/DXF 
                Options dialog box in        
                for more information.

Label           Block and Instance with a block 
                name of "GENDIMxxx" with xxx 
                representing some unique 
                identification number. 

Leader          Block and Instance with a block 
                name of "GENARRxxx" with xxx 
                representing some unique 
                identification number. 

Level           Layer. The layer name can be up 
                to 30 characters long. See the 
                DWG/DXF Options dialog box in 
                       for more information.

Line            Line.

Note            Text. The style is fixed for all 
                text entities. The style name is 
                defined in the Options dialog box.
                When a note has multiple lines, 
                each line will be a separate text 
                entity.

Point           Point.

Polygon         3DFace (if not filled). 
                Solid (if filled).

Polyline        Polyline. 

Subgroup        Not supported.

Spline          Not directly supported by AutoCAD. 
                Exported as a polyline with a 
                user-defined chord height tolerance 
                which is defined in the Options 
                dialog box. The translator does not
                export a spline as a B-spline.

View            Entity Coordinate. System Vector.

Viewport        Not supported.

Witness         Block and Instance.

Supported CADKEY entity attributes
CADKEY entity   Exported to AutoCAD as 
attribute

Color number    Color. Mapped to approximate AutoCAD
                color match.

Fill color      If applicable, mapped to approximate
                AutoCAD fill color match.

Group number    Not supported.

Level number    Mapped to approximate AutoCAD layer 
                number match. When a level does not 
                contain a descriptor, a prefix is 
                assigned (CK_LEVEL_) before the level 
                number. The level descriptor is 
                exported to layer name. Any space 
                character is replaced with an 
                underscore during export.

Line type       Mapped to approximate AutoCAD line 
                type. Imported as one of four CADKEY
                line types: solid, dashed, center, or 
                phantom. If the line type cannot be 
                mapped to any of these four line 
                types it translates to the default 
                line style defined in the DWG/DXF 
                Options dialog box.

Line width      Not supported.

Pen number      Not supported.

Subgroup number Not supported.

View number     Mapped to ECS vector.

Supported CADKEY text attributes
CADKEY text     Exported to AutoCAD as 
attribute

Angle           Rotation.

Aspect          Xscale.

Filled flag     Not supported.

Font number     User-defined. See DWG/DXF Options 
                dialog box in        for more 
                information.

Height          Height.

Line space      Not supported.

Mirror          Mirrored text.

Slant           Oblique.

Underline text  Not supported.

Supported CADKEY text information 
CADKEY text     Exported to AutoCAD as
information

Horizontal
alignment       Left.

Proportional 
spacing         Not supported.

Path            Right to left (CK_PATH_RIGHT).

Style           CK_STY_LEFT.

Vertical 
alignment       Bottom.

View_only       Not supported.


3
47 38 3 # OPTION
63 16 3 # OPTION
145 30 3 # OPTION
42 127 AutoCAD to CADKEY Entities 
AutoCAD entity  Imported into CADKEY as

3D Face         Polygon.

Arc             Arc. The translator imports an 
                extruded arc as two arcs and some
                lines (down connect).

Attdef          Not supported.

Attrib          Not supported.

Block           Collection of entities (collectives).
                If a block is cross-hatched, then any
                lines inside the block are imported as
                witness lines.

Circle          Circle. The translator imports the 
                extruded circle (thick circle) as two 
                circles and some lines (down connect).

Color           Mapped to the appropriate CADKEY  
                color match.

Dimension       The translator supports linear, 
                circular (radial and diametric), aligned,
                and ordinate dimension. If GENDIM is not 
                the prefered dimension type, then it skips 
                associated blocks. The translator supports
                all attached attributes, as well as some 
                special characters in the text, such as 
                +/-,*, and the radius or diameter symbol. 

Elevation/      All entities with thickness are mapped as 
Thickness       collectives. For each AutoCAD entity with
                thickness, CADKEY adds four entities to 
                its database.

EED             Not currently supported.
(external entity data)

Handle (Entity ID)  Not currently supported.

Insert          Collection of entities (collectives). 
                Each insert results in a collective and 
                in an additional number of entities in  
                the corresponding block.

Layer           Level. The translator maps the first 255
                layers to Levels 1 to 255 in CADKEY. The
                translator keeps these names. 
                Using the DWG/DXF Options dialog box, 
                you can configure layer mapping. See 
                       in this chapter for more 
                information. 

Line            A 2-D or 3-D line in space with optional
                extrusion; the translator imports line
                extrusion as four lines.

Paper Space     Not supported.

Point           As a 3-D point in space with optional 
                extrusion; the translator imports 
                extruded points as a collective of one
                line and two points-one at each end.

Polyface Mesh   Collective (Polygon Mesh).

Polyline        Polyline.
2D Polyline     The translator does not support 
                variable widths. The translator 
                imports a polyline with a bulge as
                collective of lines and arcs.

Polyline+Vertex Polyline. The translator does not 
                support widths. As an entity with 
                multiple vertices, the translator 
                connects each vertex to its adjacent
                vertex by a linear, quadratic, 
                or cubic curve.

3D Mesh         Several 3-D polylines. Translator 
                imports as individual polylines, 
                not as a mesh.

3D Polyline     3-D polylines.

B-Spline        Polylines.

Bulge           Collective of arcs and lines. 

Shape           Not supported.

Solid           Filled polygon. Fill color mapped 
                to its approximate match in CADKEY.
                The translator does not import the 
                invisible edge. If you import the 
                solid from AutoCAD to CADKEY, then
                export from CADKEY to AutoCAD, you 
                may experience some data loss. 

Text            Note with user-defined font. The 
                text string can be up to 1024 
                characters in length. The translator
                imports the text in one CADKEY 
                font type.

Trace           Polyline. If filled, the translator
                maps fill colors to their approximate
                color matches in CADKEY. 
Vertex          A vertex usually follows a polyline.
                The translator embeds the vertex 
                inside the polyline.

View-3D         Not supported.

Viewport        Not supported

XREF            Collectives and references. XREF will 
                be imported as collective and preserved
                as XREF, when the Entity Format is set
                to AutoCAD format.  
                When Entity Format is set to CADKEY 
                format, entities will be added with 
                data explosion, as many CADKEY entities.

1
53 16 3 # OPTION
311 7 Default Linetype:
 This option imports AutoCAD line types as the 
 specified CADKEY line type. Choose a line type 
 from the combo list box. You can choose from 
 solid, dashed, center, or phantom. Solid is the 
 default. If CADKEY cannot translate an AutoCAD 
 line type, CADKEY uses the default line type.

0
312 6 Default Font #:
 This option imports all text in the AutoCAD 
 drawing as the specified CADKEY font. You can 
 import text in one CADKEY font. The default is 1. 
 To change the default, type the CADKEY font 
 number in the text box. 

0
313 9 Entity Format:
 This option lets you choose whether you want
 to import the entities as AutoCAD entities 
 or convert them to CADKEY entities. CADKEY is 
 the default. 
 To work with the drawing in CADKEY and then 
 export it to AutoCAD, choose AutoCAD. To work 
 with the drawing in CADKEY and keep it in 
 CADKEY, choose CADKEY.

0
314 12 Levels 255+
 Click on this radio button to indicate how you 
 want to import a drawing with more than 255 
 layers. 

 Restart at Level 1
 Setting this option restarts the level count 
 at level 1. Restart at 1 is the default.

 255 only
 Setting this option stores all levels above 
 254 on level 255.

0
315 12 Dimension
 Set this option to Fit for dimensions to 
 import as the closest CADKEY dimension type. 
 These dimensions will be easier to modify, but
 may not always look the same as they do in 
 AutoCAD. Dimensions imported as GENDIM retain 
 their AutoCAD look, but are harder to modify 
 and cannot be exported as a Dimension entity.
 When Arc, Line, and Point are imported with 
 Dimension set to GENDIM, these entities will 
 be generic dimension entities.


0
321 5 AutoCAD Version:
 This option lets you choose which AutoCAD 
 Release file format you want to use to export 
 the file. You can choose from R10, or R11 (12);
 Release 11 is the default.

0
322 5 Default Font Name: 
 This option lets you export all fonts as only 
 one AutoCAD text font; CKSTANDARD is the 
 default. To change to a different font name, 
 type a new font name in the text box.

0
323 10 Chord Height Tol:
 This option lets you set the chord height 
 tolerance for exported entities. 0.005 is the 
 default. To change the default, type a new 
 number in the text box. The minimum chord 
 height tolerance is 0.0005; there is no maximum
 chord height tolerance.

 When exporting a large spline, use a higher 
 chord height tolerance of 0.127.

0
324 9 External Reference (XREF)
 This option lets you export any XREFs attached
 to the block you imported with the drawing. The
 default is to exclude XREFs.
 You can import up to 20 XREFs with a drawing. If
 you import the drawing with an attached XREF and
 then export the drawing with the XREF attached, 
 you may experience some data loss. The XREF 
 remains as a collective with the value of Entity
 Format as AutoCAD when you import it.
0
