Import CAD Data

Feature Description

This function is used to import mainstream CAD format files such as AutoCAD DWG, DXF, and MicroStation DGN as CAD datasets or simple datasets, including *.dwg, *.dxf, and *.dgn files, achieving seamless integration between engineering design and GIS data.

Among them, AutoCAD Drawing Exchange Format (*.dxf) is a file format developed by Autodesk for data exchange between AutoCAD and other software. It is an ASCII or binary file format for graphics, used to output graphics to and input graphics from other applications; AutoCAD Drawing (*.dwg) is AutoCAD's graphics file, a standard file format specifically for saving vector graphics. MicroStation DGN (*.dgn) is a vector graphics file format used by MicroStation and its related applications.

The version support for AutoCAD data is as follows:

  • SuperMap iDesktopX 10.1.2 and earlier versions support data from AutoCAD 2015 and earlier;
  • SuperMap iDesktopX 10.2 and later versions support data from AutoCAD 2021 and earlier.

Function Entry

  • Start tab -> Data Processing group -> Data Import -> Vector group -> AutoCAD.
  • In the workspace manager -> Datasource context menu -> Import Dataset....
  • Toolbox -> Data Import -> AutoCAD tools: Import DXF, Import DWG, Import DGN.

Operation Steps

  1. In the Start tab, in the Data Processing group, click the Data Import button.
  2. In the Data Import dialog box, click the Add File button to open the Open dialog box. In this dialog box, locate the path of the data to be imported and open it.
  3. For the target datasource, result dataset, encode type, import schema in the result data, and the parameter description of the source file info, please refer to the Data Import Common Parameters description page.
  4. Result Data
    • Dataset Type: Select the dataset type after import, or simple dataset.
      • CAD: Select this to import the data file as a CAD dataset.
      • Simple Dataset: Select this to import the data file as a simple dataset, i.e., point, line, region, text, attribute, polyline, compound region dataset.
    • Create Spatial Index: Check this to create a spatial index on the dataset according to the index type supported by the dataset, improving spatial query and access efficiency.
    • Import Null Dataset: Check this to import an empty dataset with no objects by default when the imported dataset is empty. Otherwise, the program will prompt that the import failed.
  5. Transformation Parameters
    Notes:
    • When the function entry is opened from the ribbon, the system determines whether the parameters are selectable based on the imported data format. For example, when importing DXF data, the set scale factor is grayed out and cannot be set.
    • When the function entry is opened from the toolbox, some parameters may not be displayed in the tool dialog box depending on the specific import data tool.
    • Curve Fitting Precision: Sets the precision of borders of lines or polygons. 73 is the default. It only takes effect when importing AutoCAD DXF (*.dxf) and AutoCAD Drawing (*.dwg) files, and is ignored for other data formats.
    • Font Library Settings: If the imported source file has associated font files (*.shx), they need to be added here and imported together to avoid missing or incomplete display of fonts in CAD data.
    • Unite Layers: Check this to merge all layers into one layer when importing DWG/DXF files. By default, multiple CAD layers are merged into one layer.
    • Import Symbol Block: This checkbox is used to set whether to import block objects or treat them as point objects when importing DWG/DXF files. By default, symbol blocks are imported.
    • Import Extended Field: Used to import data similar to attribute tables in AutoCAD drafting when importing CAD format graphics data. External extension data is imported as additional fields. This item only takes effect when importing AutoCAD DXF (*.dxf) and AutoCAD Drawing (*.dwg) files. By default, this checkbox is unchecked, meaning external extension data is not imported; if checked, external extension data is appended after the default fields.
    • Import Invisible Layers: Check this to import invisible layers in AutoCAD graphics files when importing DWG/DXF files. In AutoCAD, invisible layers are practical; when multiple layers exist, different layers store different types of objects. When a certain type of object does not need to be displayed, set the layer to invisible, and set it to visible next time it is needed.
    • Import Block Attribute: Check this to import block attributes of the data during import; if unchecked, block attributes are ignored.
    • Import Extended Records: Check this to import custom fields and attribute fields as extension fields; if unchecked, user-definable fields and property fields are not imported.
    • Keep Object Height: When importing CAD data containing 3D objects (e.g., 3D polylines), check this to retain the 3D object height information (Z coordinate value of the object) during import; if unchecked, height information is not retained. After successfully importing DWG/DXF, an Elevation field is generated in the attribute table of the resulting dataset to store object height information.
    • Keep Parametric Object: When importing CAD data containing parametric objects, check this to include compound region or compound line objects with parametric objects in the resulting CAD dataset; if unchecked, parametric objects are not included.
    • Keep Line Width: Check this to retain the width of polylines in AutoCAD graphics files when importing DWG/DXF files. In CAD, polylines are multi-segment lines composed of a series of straight lines and arcs, and each segment can have its own line width. By default, the original polyline width definition is retained.
    • Set Scale Factor: When importing *.dgn data, supports setting scale factor values in the X, Y, and Z directions.
    • Unit Object is Imported as the Point Object: When importing *.dgn data, used to set whether unit objects are imported as point objects. By default, it is unchecked. If checked, the position of an object unit is replaced with a marker.
    • Unite Layers: When importing *.dgn data, used to set whether to merge layers after import. By default, it is unchecked. If checked, all CAD layers of the same type are merged into one dataset for import; if unchecked, each CAD layer is imported as a separate dataset.
    • Closed Line to Face: Used to set whether to convert closed graphics to region objects when importing *.dwg and *.dxf files. Supported types include: Polyline, 2D Polyline, 3D Polyline, Solid, Spline, Circle, Ellipse, ProxyEntity, BlockReference, and Face. This parameter is only available when the import dataset type is simple dataset.
      • Checked: Performs closure check on imported objects. For objects that meet the closure condition, while importing according to the original entity type, corresponding region objects are also generated and stored in a region dataset.
      • Unchecked: Imports according to the original entity type of the imported objects.
    • Object to Point: Used to set whether to convert specific CAD entities to point objects when importing *.dwg and *.dxf files. Including: Hatch, ProxyEntity, and BlockReference. This parameter is only available when the import dataset type is simple dataset.
      • Checked: Hatch objects are imported only as point datasets; while ProxyEntity and BlockReference are converted to points, their internal sub-objects are still imported according to the original entity types (e.g., lines, regions).
      • Unchecked: Hatch objects, BlockReferences, ProxyEntities, and their sub-objects (lines, regions, etc.) are imported according to their original entity types.
        Notes:
        • When the imported object is a BlockReference, the generated point position uses the insertion point coordinates of the block reference, not the geometric center coordinates of the block graphic. Therefore, when the block's insertion point does not coincide with the graphic center, the converted point may be offset from the visual center of the block graphic.
    • Import Invisible Object: Used to set whether to import invisible objects when importing *.dwg and *.dxf files.
      • Checked: Invisible objects are imported together.
      • Unchecked: Only visible objects are imported; invisible objects are ignored.
  6. Styles: Supports adding a style mapping table to set the CAD style after import.

    Style Mapping File: The style mapping table file extension is *.stt. This file contains 7 parts: header of the style mapping table, version of the mapping table, line style mapping, font mapping, fill mapping, symbol mapping, and dxffile file, as shown in the example below:

    SuperMap Style Mapping Table
    Version 6.0

    LineStyleBegin
    (id:Continuous),(id:963867;c:0xff0000;w:1)
    LineStyleEnd

    SymbolBegin
    (id:GROUND),(id:1110;g:RootGroup;c:0x0000ff;a:0; s:1)
    SymbolEnd

    FillStyleBegin
    (id:ANGLE),(id:015;a:60;fc:0xff0000;bc:0x000000)
    FillStyleEnd

    FontBegin
    (id:arial),(id:System;a:0;fc:0x00ff00;bc:0x000000;xs:1;ys:1)
    FontEnd

    dxffile
    Expstyle.dxf

    Where: SuperMap Style Mapping Table is the header of the style mapping table; Version 6.0 is the version of the current mapping table; LineStyleBegin marks the beginning of line style mapping; LineStyleEnd marks the end of line style mapping; SymbolBegin marks the beginning of symbol mapping; SymbolEnd marks the end of symbol mapping; FillStyleBegin marks the beginning of fill mapping; FillStyleEnd marks the end of fill mapping; FontBegin marks the beginning of font mapping; FontEnd marks the end of font mapping; dxffile is a tag indicating the dxf file that saves styles, used for export.

    The dxf file indicated by the dxffile tag is a user-definable file that can save block, line style, and text style definitions.

    All styles for symbols and line style mapping are defined by blocks and line types saved in the dxf; fill style only maps entity fills and the fill pattern scale is always 1; text height and color are consistent with SuperMap, and the rest are consistent with the dxf-defined style.

    When exporting, if a style mapping is set but not defined in the dxf file, default styles are used.

    • Line Style Mapping: The line style mapping part starts with the keyword LineStyleBegin and ends with the keyword LineStyleEnd. Each line between them defines a line style correspondence. The line style correspondence consists of two fields separated by a comma ",". The composition of the fields is as follows:
      Field 1 Field 2
      External data line style name SuperMap data line style name; color; width (unit: mm)
    • Symbol Mapping: The symbol mapping part starts with the keyword SymbolBegin and ends with the keyword SymbolEnd. Each line between them defines a symbol correspondence. The symbol correspondence consists of two fields separated by a comma ",". The composition of the fields is as follows:
      Field 1 Field 2
      AutoCAD block or DGN cell name SuperMap symbol name; symbol group name; color; symbol rotation angle; symbol scaling ratio
      Notice: To ensure that the relative position of AutoCAD blocks remains unchanged during import/export, the block configured in the style mapping table should ensure that its base point coordinates are consistent with the anchor point coordinates of the SuperMap point symbol. If they are inconsistent, the imported/exported block symbols may have a relative offset.
    • Fill Mapping: The fill mapping part starts with the keyword FillStyleBegin and ends with the keyword FillStyleEnd. Each line between them defines a fill correspondence. The fill correspondence consists of two fields separated by a comma ",". The composition of the fields is as follows:
      Field 1 Field 2
      External fill mode name SuperMap fill name; fill rotation angle; fill foreground color; fill background color
    • Font Mapping: The font mapping part starts with the keyword FontBegin and ends with the keyword FontEnd. Each line between them defines a font correspondence. The font correspondence consists of two fields separated by a comma ",". The composition of the fields is as follows:
      Field 1 Field 2
      External font

      SuperMap font; font rotation angle; font foreground color; font background color; font X scaling ratio; font Y scaling ratio

    • dxffile File: The dxffile file is identified by the keyword dxffile, used for exporting dxf and dwg formats. This tag is invalid during import and can be omitted.
  7. After setting, click the Import button to execute the import of the CAD file.
Notes:
  • Currently, the 3D scene rendering engine V2 does not support importing CAD datasets.
  • If the imported data contains parametric objects and the Keep Parametric Object checkbox is checked during import, depending on the selected dataset type, there are two cases:
    • CAD: If the dataset type is selected as CAD during import, the resulting CAD dataset will contain compound region or compound line objects with parametric objects.
    • Simple Dataset: If the dataset type is selected as simple dataset during import, a separate compound region or compound line dataset will be generated to store parametric objects.

Related Topics

Data Import

Import Shape Data

Import Excel Data

Supported Formats for Data Import and Export