Expanding a bit on Marinheiro's answer: Even if the CAD data is georeferenced, there might still be some significant work to do to make it useable. I've often recieved CAD data that has georeferencing info in it, but the draftsman (or whoever produced it) simply ignored that and drew features all over the place. Then I have to manually align the features using the spatial adjustment tools (in ArcGIS). Granted that's a whole lot easier than starting from scratch, but it can be a pain.
If you're using ArcGIS, there are some CAD tools built into it. First, make sure the proper projection is applied to the CAD data using ArcCatalog or ArcToolbox. If you open the dwg and everything seems to line up properly, you can just right-click on the layer and save it as a shapefile. You can also use the "ArcToolbox > Conversion Tools > To Geodatabase > Cad to Geodatabase" tool to import your CAD data into a Geodatabase.
As far as the "Free-as-in-beer-and-as-in-I-don't-have-any-grant-money-for-this" route: If you don't have access to ESRI tools, QGIS has a plugin that will convert DXF to SHP, but I'm less familiar with that software than I am with ESRI.
The answer to your question lies in understanding that even though it is referred to as Annotation, it is still coming from a CAD drawing.
This ESRI Help document lists the Supported AutoCAD entities.
This Help document talks about ArcGIS Annotation: What is annotation?
There are a lot of differences. The most important being that all CAD data is Read-Only in ArcGIS. You can load in data and symbolize in different ways, but if you want to edit anything it has to be converted to a different spatial format first.
ArcGIS Annotation on the other hand is editable like any other feature class in a geodatabase, along with the ability to add different attributes.
In short, if you want to add CAD Annotation as an Annotation Feature Class, you first have to convert it to Geodatabase Annotation. Here is a help document that describes this process: Import CAD Annotation (Conversion)
-------- Edit
With a clearer head, I reread your question, and realized there are two different ways of understanding it.
1. Is like above where I thought you wanted to bring it in as an actual ArcGIS Annotation layer
.
2. Is that you simply want to load the layer in to show the CAD annotation
as text
, and not have it represented as a point
featureclass as in your first diagram.
The way to do this requires using a different type of Layer function, not the one in arcpy.mapping
, but instead the geoprocessing
type, with this command: Make Feature Layer
This command creates a Feature Layer
in memory, but also adds it to your current Map. The difference between this and the arcpy.mapping Layer class is that you are able to specify not only the Annotation Layer
of the CAD drawing, but also specify that this dataset is of type CAD
. This changes the way that ArcGIS reads the file.
Once you have added the layer to the map, you may simply add it to your Group Layer. Here is some code that takes a referenced CAD drawing, pulls out the Annotation portion, creates a Feature Layer and adds it to the Group Layer
import arcpy
#Reference current MXD
mxd = arcpy.mapping.MapDocument("CURRENT")
#Directory containing CAD File
cadpath = r"C:\City_GIS\Projects\Python"
#Set environment workspace
arcpy.env.workspace = cadpath
#Return specific drawing name from list of datasets
dwgname = arcpy.ListDatasets("C-6*","CAD")[0]
#Returns desired dataframe from current MXD
dataframe = arcpy.mapping.ListDataFrames(mxd,"Layers")[0]
#Return desired group layer to add Annotation to
grouplayer = arcpy.mapping.ListLayers(mxd,"CADLayers",dataframe)[0]
#Name of new layer to be created
cadname = dwgname + "_anno"
#Create Temporary Feature Layer, which also adds to Map document
arcpy.MakeFeatureLayer_management(dwgname + "/Annotation",cadname)
#Refresh Table of Contents
arcpy.RefreshTOC
#Search MXD list to return Layer
layertogroup = arcpy.mapping.ListLayers(mxd,cadname)[0]
#Add this returned layer to your group layer
arcpy.mapping.AddLayerToGroup(dataframe,grouplayer,layertogroup)
This will create two copies of the layer on your Map. The one will be outside and one inside the Group layer. You can then set up code to remove the one that is outside the group layer.
It is a bit convoluted, but I hope it approaches what you were trying to accomplish. Here is a screenshot of the result.
Best Answer
This is Spatial Manager for AutoCAD (DEMO VERSION) I upload here map.osm from OpenStreetmap by exporting I have layers here