A new update for ArcGIS for AutoCAD 300 is now available. ArcGIS for AutoCAD 300 SP1 adds support for AutoCAD 2013 and includes enhancements and bug fixes.
For those of you who work with feature data in both AutoCAD and ArcGIS applications, check out the latest installment of the no-cost plug-in ArcGIS for AutoCAD. The CAD team added support for ArcGIS image and feature services. This release also delivers a long requested enhancement to be able to edit and extract geodatabase features from within an AutoCAD session. Continue reading
Editing and data compilation are less commonly thought of as operations that can be automated through geoprocessing. However, ArcGIS 10 introduced the Editing toolbox, which contains a set of geoprocessing tools to perform bulk edits. These tools combined with others in the geoprocessing environment can automate data import and maintenance work. Automated data compilation tools are especially useful for importing data into a geodatabase but can also be employed on a regular schedule to perform routine quality assurance (QA) checks. In this entry, I will discuss the use of geoprocessing to clean CAD line data as part of the import process.
Importing data with geoprocessing
Lines that are created without the use of spatial integrity measures, such as snapping or topology, almost always contain some inconsistencies. These errors are likely in data that originated in formats such as CAD, shapefile, or KML. Fortunately, many common topological issues can be resolved in an automated manner by using ModelBuilder to link together tools that will import data into a geodatabase and perform standard data cleanup techniques.
I have a CAD file for a new subdivision that needs to be integrated with my existing GIS parcel data. The GIS data must be kept to stringent accuracy standards, so I need to fix any issues where lines do not connect to each other, overlap, or are duplicated. Rather than risk reducing the quality of the main parcels geodatabase, I can create a local temporary geodatabase where I can preprocess the CAD lines before introducing the features into the production geodatabase. Although the CAD file contains buildings, roads, text, registration tic marks, and other features, I plan to use only the parcel lot lines.
I have built a model that imports the CAD lines into a temporary scratch workspace, cleans and processes the lines, and then copies the corrected lines into an output file geodatabase. When importing CAD data into a geodatabase, I can choose from several available tools, including CAD to Geodatabase or Feature Class to Feature Class. The CAD to Geodatabase tool converts all the geometries in a drawing to individual feature classes, such as a line feature class for the parcel lines, annotation feature class for CAD text, and so on. In my case, I am using Feature Class to Feature Class tool because I need only the lot line geometry from the CAD file. This tool makes the model reusable because it can import many different formats and not simply CAD. In addition, the Feature Class to Feature Class tool allows for an SQL expression so I can further refine the import to include only the CAD features that satisfy an attribute query for lot lines (in this case, “Layer” = ‘LOT-L’).
Performing automated quality assurance on lines
Once the CAD parcel lot lines are imported into a geodatabase feature class, I can begin running tools to perform automated QA processes. Many tools are found in the Editing toolbox, although other toolboxes can be purposed for data compilation QA tasks. For example, I can start by using the Integrate tool in the Data Management toolbox to address minor inconsistencies in the line work. Integrate makes features coincident if they fall within the specified x,y tolerance. By using a small tolerance on Integrate (and other similar tools), I can avoid editing the data beyond the level of cleanup I intended. In addition, since I am running the tools on a copy of the data outside my production database, I can run the tools repeatedly to refine tolerance values to fix more issues in an automated manner. The intermediate data created as the model runs is maintained and can be reviewed in the scratch geodatabase.
After the dataset is integrated, I check for duplicated lines with the Delete Identical tool (Data Management toolbox). The dashed lines connecting to this tool represent preconditions, which are used to control the order of operations in a model. For example, the Integrated Lines output is a precondition to the Delete Identical tool. This way, the Delete Identical tool will not execute until the lines have been integrated.
The next part of the model identifies lines that are dangles. With the Feature Vertices to Points tool in the Data Management toolbox, I create a new point feature class containing the line endpoints that are not connected to any other lines. I can then use Select Layer By Location to identify the lines that intersect these dangling endpoints. The resulting selection represents lines with dangles.
Many of these dangle errors can be fixed by running the Editing toolbox’s Trim Line, Extend Line, and Snap tools. Effective use of the Editing toolbox geoprocessing tools can improve productivity because the tools apply edits in bulk, such as to all features or all selected features. In most cases, the similar editing function applies to only one feature at a time. Because I exposed the tolerances as variables and model parameters, I can easily run the model with different values because the tolerance settings appear as input boxes on the tool’s dialog box. For example, I am willing to extend or trim the lines from this CAD dataset initially up to a maximum length of five feet. After that procedure, I want to inspect the lines visually to see how many issues remain to ensure that I will not be making incorrect edits if I increase the tolerance value. I can change the tolerance as needed depending on the accuracy of the lines I am importing.
In addition, since my organization’s spatial integrity rules indicate the parcel lines should be split and not intersect themselves, I can use a sequence of spatial and attribute queries to find the locations where lines have intersecting endpoints. Lines are often split so that each length can be attributed separately.
Once these processes have run, the lines are output into a feature dataset in a geodatabase and are much cleaner topologically. After the model completes, I can run the Feature Vertices to Points tool again on the cleaned output to see the remaining dangles and compare the current number of endpoints that are dangles (the yellow circles in the graphic) to the number in the original CAD lines (the red circles). While there may be a few remaining issues, there are less than before running the model. At this point, I can build a geodatabase topology to check for and repair any other errors. When I am satisfied that the lines meet the standards for our spatial data, I can import it into the production database.
For more information:
The sample tools and data can be downloaded from the Editing Labs group on ArcGIS.com. An ArcInfo license in required to run the tools.
An ArcGIS for AutoCAD Build 250 patch for 64-bit platforms has been released. This patch enables 64-bit AutoCAD applications to edit feature class attributes using the AutoCAD properties palette.
We recommend that all ArcGIS for AutoCAD 64-bit users install the patch at your earliest opportunity.
If you are running a 32-bit installation of AutoCAD Civil 3D 2010 on a 64-bit Windows operation system, reference Knowledge Base article 38453.
ArcGIS for AutoCAD Build 250 was released this week, and is now available for download. It can be installed on 32-bit or 64-bit versions of the following AutoCAD-based products by Autodesk:
- AutoCAD 2010/2011
- AutoCAD Map 3D 2010/2011
- AutoCAD Civil 3D 210/2011
For a complete list of requirements, see System Requirements.
A common question the CAD team receives is how to preserve the original text height when importing a CAD annotation feature layer, or, if it has already been converted, how to scale it back to its intended size.
Define a Coordinate System
The best practice is to define a coordinate system for the CAD dataset before adding it to your map and before importing the annotation. More importantly, it needs to be a projected coordinate system with a unit of measure that matches the unit of measure the CAD file was created in.
Defining a projected coordinate system is important for two reasons:
First, if you don’t define a coordinate system, the tool has no other recourse than to use its own default unit of measure, which is meters. If the source CAD drawing was created in meters, this is not a problem. But if the drawing was created in units other than meters, such as U.S. Survey feet, your text will convert to a size that is likely to be unusable.
Second, the Import CAD Annotation tool only references the coordinate system defined with the dataset, not the data frame. Therefore, you must define a coordinate system in a Catalog window before adding it to ArcMap if you want the tool to recognize one.
Convert to Geodatabase Annotation
After you’ve assigned a correct coordinate system and added the CAD data to your map, right-click the CAD annotation feature layer in the table of contents and click Convert to Geodatabase Annotation.
Run the Import CAD Annotation tool accepting the default parameters. When it has completed executing, the annotation will be added to your map.
Recalculate the FontSize Field
If instead, you no longer have access to the CAD file, but you know the unit of measure it was created with, then it is a simple matter of rescaling the font size with a conversion factor.
A common misconception at this point in the workflow is the idea that changing the annotation’s reference scale will correct the problem. Although useful in its own right, a reference scale is only a display scale, meaning it is the scale at which the annotation will display at its defined size. In this case, it does not correct the results that were caused by an undefined unit of measure in the input CAD dataset.
The solution to the problem is to scale the values in the FontSize field with the Field Calculator using the correct conversion factor.
Open the attribute table, right-click the FontSize field heading, and open the Field Calculator.
For the sake of this discussion, let’s assume the CAD file was created in U.S. Survey feet. In this case, multiply all values by the conversion factor 1200/3937.
One last note: If you’ve followed these instructions and the annotation is still displaying incorrectly in ArcMap, check the data frame’s units setting and verify that it also matches the units that your conversion factor calculated for.
In summary, if you need to import CAD annotation, you should always define a coordinate system before converting the data. The units should match the CAD file’s unit of measure. Defining a coordinate system defines a unit of measure that the Import CAD Annotation tool will use to calculate font size. If you don’t define a coordinate system, the tool will calculate one unit per meter. If you no longer have access to the CAD file, but you know the unit of measure, you can resize the font by applying a conversion factor to the FontSize field using the Field Calculator.
Contributed by Alex LeReaux of the CAD development team
In ArcGIS Desktop 10 you can now import CAD data directly from ArcMap. Best practice CAD conversion tools can be opened directly from the shortcut menu when you right click a CAD feature layer in the table of contents. These tools open already populated with the selected input feature layer and output to your default geodatabase. Clicking OK runs the tool and adds the output to your map.
- Convert CAD Feature Layer opens the Copy Features tool.
- Convert CAD Feature Dataset opens the CAD To Geodatabase tool.
- Convert to Geodatabase Annotation opens the Import CAD Annotation tool.
CAD To Geodatabase
The shortcut menu includes a new tool for importing CAD datasets. The CAD To Geodatabase tool imports all feature classes contained in the CAD dataset for the selected feature layer and converts it to a geodatabase dataset. Processing includes the dataset’s annotation using preset parameters.
Using this tool, you can also add multiple CAD datasets as input including mixed DWG and DGN formats. When you import more than one CAD dataset, the tool merges duplicate feature class types and their attributes, and applies the first coordinate system in the list to the new dataset. This tool replaces the Import From CAD tool.
ArcGIS Desktop 10 simplifies importing CAD data. The new shortcut menu provides easy access to best practice CAD conversion tools without having to know them by name. You simply click on the task you need to perform and the right tool opens ready to run. The new tool CAD to Geodatabase simplifies converting entire CAD datasets by incorporating several best practice tools into one easy tool.
Contributed by Alex LeReaux of the CAD development team
Microstation and AutoCAD files are a supported GIS formats in ArcGIS and have been for many years. CAD features classes are a valid source of ArcMap layers and are valid as input to most geoprocessing tools, including those that copy features from one feature class to another. These data manipulation tools like COPY FEATURES, APPEND, MERGE and FEATURE CLASS TO FEATURE CLASS all have their own specific subtleties and use cases for moving features from one data set to another. These tools automatically convert data from one data format to another and from one coordinate system to another; Shapefile to file geodatabase to enterprise geodatabase etc. In the case of the read/only CAD feature class this means that you can use these tools with CAD as input to effectively convert CAD data to GIS data. When working with CAD text to create geodatabase annotation the IMPORT CAD ANNOTATION tool is the way to go.
In ArcGIS 9.4 the context menu for a CAD layer in ArcMap guides you directly to the preferred tools to convert the CAD features to other GIS data sets. Right-clicking on a CAD layer in ArcMap presents you with the choices Convert CAD Feature Layer or Convert to Geodatabase Annotation. Other methods for copying and converting data are still available such as using copy-n-paste in an edit session or other tools like COPY FEATURES listed above. In fact these new context menu choices direct you to the existing FEATURE CLASS TO FEATURE CLASS tool or the IMPORT CAD ANNOTATION tool in the as of CAD text. The FEATURE CLASS TO FEATURE CLASS tool is preferred over the similar COPY FEATURES tool in that it includes a query parameter that is useful in filtering the CAD data that you want to convert.
The new CAD TO GEODATABASE tool replaces the obsolete IMPORT FROM CAD tool and combines the functionality of several existing tools to streamline the conversion of one or more CAD files into a geodatabase.
In the last post I walked you through how ArcView 9.3.1 Export-to-CAD automatically stores feature class information in an AutoCAD DWG file. A natural extension of this functionality is to use it to leverage existing ESRI data models to create template AutoCAD drawings.
A sample DWG template of the Water Utility Data Model has been created using Export-to-CAD and posted on the Water Utilities Template Gallery. To go to the Template Gallery click here.
If you’ve ever tried to use AutoCAD xdata to store feature attributes in a DWG file you might be interested to know about the enhancements made to the Export-to-CAD tool in 9.3. In ArcGIS 9.3 storing GIS information in an AutoCAD drawing and the ability to read this data in ArcGIS Desktop is now automated.
For each feature class used as input, the Export-to-CAD tool will automatically:
- Embed the feature class definition as a non-graphic entry in the DWG file.
- Create a layer with a name that matches the feature class name.
- Write the features to the matching CAD layer name.
- Attach the corresponding ArcGIS feature attributes to each CAD entity.
- And embed the coordinate system information as a non-graphic entry in the DWG file.
Both ArcGIS 9.3 and ArcGIS for AutoCAD Build 200 read and write this data out of the box. This makes round-trip data exchanges between ArcGIS Desktop and AutoCAD a straightforward and uncomplicated task.
Behind the scenes
Behind the scenes the information is stored as AutoCAD xrecords and organized into a framework of AutoCAD object dictionaries that is defined by the ESRI “Mapping Specification for CAD”. As a result, there is no longer a need to burden workflows with complex xdata tasks. This new format stores ArcGIS information in the drawing’s Named Object Dictionary similar to other native AutoCAD data tools such as Plot Styles or Groups. This means your GIS data will not interfere with standard AutoCAD entities or commands yet remain accessible to ArcGIS or ArcGIS for AutoCAD.
Using the Export-to-CAD Tool
If you have an ArcView license or higher, the Export-to-CAD tool can be found in the ArcToolbox under Conversion Tools > To CAD > Export to CAD
A simple use of the tool requires four steps (Figure 2). For simplicity this example does not use a seed file:
- Enter or drag-and-drop the input features into the dialog.
- Select the DWG output format.
- Verify or enter the output filename.
- Run the tool.
Viewing the results in the Catalog tree, the CAD dataset now includes an additional type of CAD feature class (Figure 3). In addition to the usual suspects, the dataset also contains uniquely named feature classes that correspond to the feature classes from the source geodatabase. For example Parcels.
The contents of these feature classes are derived from their default parent CAD feature classes, Point, Line, Polygon, etc. This means, as in previous releases of ArcGIS, the default feature classes continue to maintain all CAD entities organized by type but these new feature classes only contain the CAD entities that belong to a particular feature class. In ArcMap this gives you the option of working with all or subsets of CAD data. For common workflows this can save you time from having to build specialized query definitions to accomplish the same result.
Another important distinction between the two types of CAD feature classes is feature attributes. As in previous releases of ArcGIS, the default CAD feature classes continue to be absent of attribute data. However, these new feature classes contain the attribute data that was present in the feature attributes table at the time the data was exported.
If you add this CAD data in ArcMap and use the Identify tool and scroll to the bottom of the field list, notice the feature attributes that come across from the feature classes in the sample geodatabase Montgomery.gdb (Figure 4). In this example the feature belongs to the Parcels feature class. In addition to the CAD property fields, the feature attribute field PARCEL_ID has a value of 9956.
Beginning with ArcGIS 9.3, the Export-To-CAD tool now offers an alternative to using xdata or block inserts for storing GIS information. The benefit of this data persisting in an AutoCAD drawing is the ability to streamline workflows that routinely move data between AutoCAD and ArcGIS. Using ArcGIS for AutoCAD you can take this information and work with it, edit it, and add to it in a GIS context that mirrors your organization’s GIS data standards. This data can then be used as input to ArcGIS geoprocessing tools to update specific feature classes in your geodatabase – including attribute data.