The purpose of IMPORT to CAD is to establish a staging geodatabase of highly normalized tables and feature classes for the purpose of assembling geoprocessing models and scripts to perform complex data mining of CAD data. For simple viewing and importing of CAD data, it can be easier to use a CAD file as a feature source without using Import CAD. The advantages to Import CAD include multiple document input, the handling of AutoCAD extended entity data, more extensive support for Microstation user data, better geometric data support, access to text properties, and document properties.
When one or more CAD drawing files are imported using the Import CAD geoprocessing function, a geodatabase feature dataset is created to store a series of tables and feature classes that reformats the CAD data into predefined highly normalized tables and feature classes. This staging geodatabase feature dataset is an optimized representation of the CAD drawing file(s) as a geodatabase. Converting CAD drawings into a geodatabase facilitates further data translation in ArcGIS using other geoprocessing tools.
CAD drawing translation
The process of converting CAD drawings into geodatabase feature classes is a multistep process made possible by other geoprocessing tools and the geoprocessing framework of ArcGIS. It is profitable to consider the task of moving data from one or more CAD drawings into a geodatabase feature class as a pulling rather than pushing operation. By conceptualizing the process as starting with an existing geodatabase feature class with its own particular table schema, CAD translation becomes a process of defining what candidates in the staging geodatabase feature classes will qualify as new target features.
There is not always a one-to-one correspondence between CAD objects in a drawing file and GIS features. It is therefore often necessary to aggregate or split objects during the translation process to obtain the necessary candidate objects. For example, oftentimes the information necessary to construct the target GIS feature may come from two different CAD objects in the drawing file. With the case of extended attribution of CAD objects, the relationships between objects and their extended attributes can be rather complex. Using the Pivot Table tool, for example, can build a new table from an existing table. Where the various column values can become column headings in the process of building a new table where a combination of values define a new table. The use of Pivot Table will often be the first step for extracting AutoCAD Xdata or cell attributes in Microstation or block attributes in from AutoCAD data.
The concept of Spatial aggregation would be a linear GIS feature that has been represented in a CAD drawing file as a line entity and a corresponding text entity near that line that describes the identity of the line. The text entity functions as a form of attribution that will be a column value in the target geodatabase feature class. Before the two objects can be considered a viable candidate for the linear feature and its identity attribute, one must perform a type of spatial join linking the two CAD candidate objects into a single object (i.e., the Identity_analysis tool), which can then be appended to the target geodatabase feature class.
The translation process may include several of these data manipulation and database modification functions in a geoprocessing script or ModelBuilder model that has as its final step the creation or appending of data to a geodatabase feature class. Leveraging the geoprocessing framework, sophisticated translation tasks can be saved and reused, thus automating the process for future translations.
Import CAD's output schema
An ArcGIS Feature Dataset with the following feature class names are generated as output of the Import CAD function:
- POINT: Is a point feature class containing the point geometry of the filtered input CAD objects that are by default interpreted as GIS point features. The AutoCAD entities that are interpreted as ArcGIS points are as follows: POINT, SHAPE, INSERT, ATTRIBUTE, TEXT, MTEXT, DIMENSION. The following are Microstation elements that are interpreted by default as ArcGIS point features: TEXT, POINT, CELL, and so on.
- LINE: Is a line feature class containing all of the filtered input CAD objects that are by default interpreted as ArcGIS line features. The AutoCAD entities that are interpreted as GIS points are as follows: LWPOLYLINE, POLYLINE, 3DPOLY, CIRCLE, ARC, TRACE, LEADER, LINE. The following are Microstation elements that are interpreted by default as GIS line features: LINE, LINESTRING, COMPLEXLINESTRING, and so on.
- POLYGON: Is a polygon feature class containing all of the filtered input CAD objects that are by default interpreted as ArcGIS polygon features. The AutoCAD entities that are interpreted as GIS points are as follows: CIRCLE, (closed) POLYLINE, SOLID, HATCH, 3DFACE, POLYLINE(mesh). The following are Microstation elements that are interpreted by default as GIS polygon features: (closed) LINESTRING, (closed) COMPLEXLINESTRING, and so on.
- CADDOC:The CADDoc feature class contains the document properties and a rectangle that represents the spatial extent of the objects contained within the given CAD file. This feature class's attribute table contains an area shape and a unique identifier called the DOC_ID. The DOC feature class also contains the following attributes:
ObjectID |
Unique Identifier, recorded in ENTITY table as DocID foreign key. |
Shape |
ArcGIS area shape representing the spatial extent of the CAD file. |
DocName |
Name of CAD file where features originated. |
DocPath |
Location of CAD file where features originated. |
DocType |
Type of CAD file by extension. |
DocVer |
Software Version of CAD program. |
Shape_Length |
ArcGIS-generated boundary length value. |
Shape_Area |
ArcGIS-generated boundary length value. |
An ArcGIS Feature Dataset with the following tables that are are generated as output of the Import CAD function:
- ENTITIES TABLE: This table contains all of the standard entity-specific CAD properties. There is only a single table record for each CAD entity. There may be more than one geometric object that references an entity record in this table. This occurs for area features that have both an area and line feature representation. There may be two or more different geometric representations or interpretations of the CAD geometry, but just a single entity record.
- The entity table contains all the entity-specific symbolic properties. It is common in CAD to assign symbology by CAD layer rather than individually by entity. In such cases the symbology is defined with a special integer or value (BYLAYER) that indicates the property is inherited from the CAD Layer properties upon which the object resides (see the CADLayer table).
- If the user chooses to explode the sub-geometries of a complex object, such as a cell or block insert, then those objects will have their own entity properties and reference the parent entity by OwnerID to EntID. The Entity table contains the following tabular attributes:
ObjectID |
Unique Identifier, recorded in ENTITY table as DocID foreign key. |
EntID |
Unique entity identifier and foreign key create by ArcGIS |
DocID |
ArcGIS-generated unique identifier that corresponds to records in the CadDoc table. |
OwnerID |
The EntID of a parent entity. |
CADType |
The CAD entity type. |
Level |
The Microstation level number. |
Color |
The Entity-specific color property (may be 256 or BYLAYER—see the CADLayer table). |
LineWt |
The CAD line weight property (generally used for plotting). |
Layer |
The CAD layer string name. |
Handle |
The unique CAD entity identifier (file position value for Microstation V7). |
RefName |
The complex object name (block name, cell name, or raster entity name). |
Class |
Microstation class property (Integer 0–256). Entity class designation |
Linetype |
CAD line style name. |
LTScale |
CAD line scale factor. |
Width |
Width of the entity. |
Thickness |
The extrusion distance of an entity |
CADAngle |
The CAD rotation angle in degrees. |
CADModel |
Microstation V8 CAD Model document reference. |
EntX |
AutoCAD extrusion vector X component. |
EntY |
AutoCAD extrusion vector Y component. |
EntZ |
AutoCAD extrusion vector Z component. |
ScaleX |
AutoCAD X coordinate scale value. |
ScaleY |
AutoCAD Y coordinate scale value |
ScaleZ |
AutoCAD Z coordinate scale value |
QrotW |
Microstation quaterion W value (used for CAD transformations). |
QrotX |
Microstation quaterion X value (used for CAD transformations). |
QrotY |
Microstation quaterion Y value (used for CAD transformations). |
QrotZ |
Microstation quaterion Z value (used for CAD transformations). |
Elevation |
The z coordinate value of an entity. In cases where the z coordinate values of entity's vertices vary, the z coordinate value of the first vertex encountered will be used. |
FillColor |
The color value of the fill pattern. |
GGroup |
A permanent grouping of elements (primitive or complex). |
- CADLayers TABLE: This table contains the various CAD Layer symbolic properties. These properties are used as default symbology for CAD entities that reside on the layer and do not have their own entity-specific symbolic properties. CAD objects can have their own symbolic properties, or they can inherit the symbolic properties of the layer on which they reside. The CAD layer can be joined to the entity table based on LYRName in the CADLayer table and LayerName in the Entity table.
ObjectID |
Unique Identifier, recorded in ENTITY table as DocID foreign key. |
DocID |
ArcGIS-generated unique identifier that corresponds to records in the CadDoc table. |
LyrName |
A logical grouping of data in a drawing. Layers can contain a mixture of feature types. |
LynNum |
A logical grouping of data in a design by level number. Specific to MicroStation design files. |
LvlDesc |
The CAD description of the level. Specific to MicroStation V7 or earlier versions. |
LyrColor |
The CAD default color of the layer. |
LyrLineWt |
The CAD default lineweight of the layer. |
LyrLnType |
The CAD default linetype of the layer. |
LyrFrzn |
CAD frozen status of the layer. Frozen layers are t displayed. |
LyrLock |
The CAD locked status of the layer. Locked layers are displayed. |
LyrOn |
The CAD display status of the layer. |
LyrVPFrzn |
The CAD frozen status of the layer's viewport. Frozen layers are t displayed. |
lvlPlot |
The CAD plotting order of the drawing's levels. |
LyrHandle |
The CAD maintained internal identifier for a layer |
- MSLinks TABLE: This table models the many-to-one relationship of Microstation MSLinks and DRMS data collections found on the elements of the input Microstation CAD files. The MSLink table can be joined to other tables based on EntID.
ObjectID |
Unique Identifier, recorded in ENTITY table as DocID foreign key. |
EntID |
Unique entity identifier and foreign key create by ArcGIS |
Linktype |
The MSLink type value. |
DBType |
The Database type. |
MSCatID |
Microstation Catalog table record number that contains the name of the table that the MSLink value points to. |
MSLink |
Microstation record number of attached data or other coded value |
MSLink2 |
Microstation Catalog table record number that contains the name of the table that the MSLink value points to. |
MSValue |
Microstation record number of attached data or other coded value as a string |
- TXTProps TABLE: This table contains the text style properties and text values for TEXT and ATTRIBUTE objects found in the input CAD file(s). Import from CAD does not automatically convert text or attributes to geodatabase annotation or coverage style annotation (like the CAD feature datasets). TEXT and ATTRIBUTE are recorded as points. ATTRIBUTE objects have their own insertion point separate from the CELL or INSERT's insertion point. Joining the TXTProps table to the POINT feature class, based on EntID, provides the information necessary to use the TXTValue as an attribute or for labeling of the point.
ObjectID |
Unique Identifier, recorded in ENTITY table as DocID foreign key. |
EntID |
Unique entity identifier and foreign key create by ArcGIS. |
TxtValue |
Text String value up to 254 characters. |
TxtMemo |
Entire CAD text String even if greater than 254 characters. |
TxtHt |
Height of the text entity. |
TxtRotation |
Rotation of the text entity. |
TxtWidth |
Width of the text entity. |
TxtOblique |
Oblique angular value of the text entity. |
TxtGenType |
Generation type controls the orientation of the text entity. For example backwards, Right to left. |
TxtJust |
Justification of the text entity. |
VertAlign |
Verticle alignment of the text entity. |
TxtStyle |
Style type of the text entity. |
TxtFont |
Font id of the text entity. |
TxtBoxHt |
Bounding box height of the text entity. |
TxtBoxWd |
Bounding box width of the text entity. |
TxtRefWd |
Multiline text width factor of the text entity. |
TxtAttach |
Multiline attachedd parameters of the text entity. |
TxtDir |
Multiline text direction for the text entity. |
LnSpace |
Line spacing value of a multiline text entity. |
SpaceFact |
Spacing factor of a multiline text entity. |
- Attrib TABLE: This table models the many-to-one relationship of CAD attribute sub-entities to SETNAMEs, Cells, or AutoCAD Block Inserts. To make use of this table, it must generally be pivoted using the Pivot Table tool and then joined to the Entities table and/or to one or more geometry features. One or more attribute entities can be organized into a SETNAME, Shared Cell, or BLOCK INSERT. When looked at in this way the SETNAME is like a table onto itself with its columns being the individual tags. The PIVOT TABLE tool will take the records of a table and generate a new table where the records of one table are used to build the columns of another table.
ObjectID |
Unique Identifier, recorded in ENTITY table as DocID foreign key. |
EntID |
Unique entity identifier and foreign key create by ArcGIS. |
OwnerID |
The EntID of a parent entity. |
AttrFlag |
Tag and Attribute visibility flag. |
SetName |
AutoCAD blockname microstation set name. |
AttrTag |
Tag or attribute name. |
AttrHndl |
AutoCAD internal identifier. |
AttrType |
Microstation tag field type, AutoCAD is always a string. |
AttrStr |
An attribute's value converted to a string. |
AttrLong |
An attribute's value converted to a long integer. |
AttrDbl |
An Attribute's value converted to a real number. |
- Each of the attributes for all of the SETNAMEs will be written to the single Attrib table. It is therefore generally required that before the Attrib table is pivoted it be filtered for the appropriate set of attributes. Most common would be to pre-select the Attrib table based on a given SETNAME name. Then only the attribute records that correspond to a given SETNAME will be used to build the new table. The resulting table will have just the columns of attributes that belong to the given SETNAME. This is different than the ArcGIS CAD feature class view of CAD data with attributes, where all the attributes of all the SETNAMEs are included on every object regardless of the actual definition of the objects in the CAD file. Although there is added complexity in selecting the SETNAME and pivoting the table, the end result can be a cleaner more useful version of the data as GIS content.
- The Attrib table should be pivoted retaining the OwnerID field and based on the AttrTag column with a value field of AttrStr. The resulting table can then be joined to other tables based on the OwnerID and the other table's EntID field.
- The Attrib table contains the following tabular attributes:
- EntID—CAD Attributes are themselves entities and are assigned a unique entity identifier.
- OwnerID—CAD Attributes are combined into collections and can belong to other objects. The OwnerID is the EntID of the parent object.
- AttrFlag—Attribute flags: (This is a bitwise value.)
- 1 = Attribute is invisible (does not appear).
- 2 = This is a constant attribute.
- 4 = Verification is required on input of this attribute.
- 8 = Attribute is preset (no prompt during insertion).
- SetName—The logical name of the CELL, TagSet, or INSERT to which the attribute belongs.
- AttrTag—The logical name of the CAD Attribute.
- AttrHndl—(Microstation only) A tag element stores a handle to its related element. The AttrHndl is the XID of that related element. The ID of all elements is stored in the entity table as "handle". Therefore, you can use the tag's AttrHndl to find the element originally related to the tag.
- AttrType—In Microstation attribute tags have a value type. In AutoCAD all values are strings but may be evaluated to different types:
- DGN_TAGTYPE_STG 1
- DGN_TAGTYPE_SHORT 2
- DGN_TAGTYPE_INT 3
- DGN_TAGTYPE_DOUBLE 4
- DGN_TAGTYPE_BINARY 5
- AttrStr—The value of the attribute as a string.
- AttrLong—The value of the attribute as a long integer.
- AttrDbl—The value of the attribute as a long integer.
- XData TABLE: This table contains the extended entity data found on the entities of the input AutoCAD drawing files. The AutoCAD Extended Entity Data (EED) is encoded into an XML string in the XDList field. The table is not usable as is. It is provided mainly for export compatibility. The XML string format of the data used by the Export To CAD tool is the same format as the data in the XData table created by Import From CAD. The usable form of the data is found in the XTRProps table.
ObjectID |
Unique Identifier, recorded in ENTITY table as DocID foreign key. |
EntID |
Unique entity identifier and foreign key create by ArcGIS. |
XDList |
XML string of coded AutoCAD Extended Entity Data (Xdata) values and their types |
- XtrProp TABLE: This table is derived from the XData table and is a more usable form of any EED that is found on the entities of the input AutoCAD drawing file. There is one record for all the EED of a given registered application name for each entity. For example, if an entity had EED from two different registered application names, then there would be two records in the table with the same OwnerID. When dealing with CAD data that has multiple registered application names, pre-select the XTRProps table before joining the data to other tables.
- The field names of the XTRProp table are derived from the data itself. When working with EED in an ADE format, the column name is derived from the self-labeling syntax of the ADE data string. When the data is in standard format, the columns are named according to the data type.
Supported CAD drawing files
Several CAD formats can be processed by Import CAD. Supported CAD drawing files include:
- AutoCAD drawing files R14 (.dwg) up to AutoCAD 2005.
- DGN version 5.x up to version 8.x
- All ASCII, binary, and partial drawing interchange files (.dxf) that comply with DXF standards version R14 up to Version 2005.