I am often requested to provide my water or sewer data in in a dwg or dxf format. I can easily move data back and forth between the two platforms using either the native import or export functions ArcGIS (Info level 9.3.1 or 10) or AutoCAD (Map 3D 2010). I am looking for a way to sort the features of a given featureclass into different CAD Layers based on their attribute values. For example if my water pipe data has an attribute values for both Diameter and Material. On export I would like to all of the 8 inch Ductile Iron pipes to be placed in the same CAD layer and all of the 10 PVC pipes in another CAD layer. I have done this in the past by manually selecting the pipe similar pipes and exporting just the selections but this can be tedious and time consuming. I have tried looking for a tool to do this, as I seem it is somethings others would be interested in, with no luck.

5 Answers 5


You can do it in AutoCAD Map with Query and Alter Properties.

  1. export you data to shp file
  2. import it into AutoCAD Map with attribute data in Object Table
  3. save your file as dwg and close it
  4. open empty dwg file and open Task plane (MAPWSPACE) - Map Explorer
  5. attach the drawing in which you imported your shp file
  6. define a query with Location:ALL ; Query mode: Draw
  7. open Alter Properties
  8. select Layer
  9. in Expression field write (strcat :fleid1@objectTable " " :field2@objectTable)
  10. press Add, then OK then Execute Query
  11. and thats it

filed1 and field2 are names of attribute columns in shapefile (in your example they are Diameter and Material) objectTable is name of you shapefile (this can be something else, but if you left as a default value in time of import it will be name of the shapefile)

I tested it on my example and it works so i think it will work for you also. I hope it helps.


In map 3d 2010 you can set the import to use data field for layer name. however if you have a size and type in two differing fields you would still not be able to accomplish exactly what you are talking about without another step of creating a composite field with size and type in it. If on the other hand your data does not have concidental values (i.e. 8" ductile, and 8" PVC) then you can accomplish. To describe further ... on the first page of your import dialog (after selecting the import file type) select the drawing layer elipsis... to the right of the default. and select use data field for layer name, select the data field you want to use and walla! Of course if you have enterprise data this would add another step to get your data into shape to begin with. If you add FME to the mix then you can accomplish in sooo many ways! as described in previous post or even with my solution by selecting your enterprise data type in map. hope this helps

  • I tested this answer out and it worked well and required the least amount of data prep and or cleaning. If you do this a lot I would suggest looking at FME as noted in a previous suggestion. However do do this without additional software this method proved to be the most effective and efficient.
    – Chris M
    Oct 26, 2010 at 16:35

You could set up a model that runs through the various selections, and then exports to CAD. All that would be required then is to run the model when a request comes in, or you could export it to a Python script and automate it to run on a set schedule. It will require some setup to get the model working, but it's time well spent. Here is a link to ESRI's help on working with models.

  • This was my initial thought for a longer term answer, however I after some thought came to the conclusion that I would need to hard code in the queries for each combination. I would really like the flexibility to to just choose the fields and let the software do heavy lifting of calculating the combinations and creating the CAD Layers. I think to do this programatically would require some advanced skills. Although I haven't ruled out possibly hiring a developer to create such a tool.
    – Chris M
    Oct 8, 2010 at 14:56

If you don't mind a suggestion for another software, then FME could do this in about 10 seconds with a fanout. It could even create either separate layers or separate files. I believe the ArcGIS Data Interoperability extension would do the same.

eg - here for elevation in a diagram from our training manual

alt text

Which is done with a simple check box:

alt text

Disclosure: I do work for Safe Software, the company who creates FME.

  • I have begun researching FME Desktop (ESRI Edition) for some unrelated DB tasks and had actually submitted the request for an evaluation license earlier in the day before this request came in. So it would appear this is yet another reason to consider FME. As an employee do you know if this functionality in included in the Interoperability extension or I would need full blown desktop. I am pretty sure I will need to go with desktop anyway for the DB stuff but just curious.
    – Chris M
    Oct 8, 2010 at 16:59
  • Yes, I just checked it out and fanouts are in the Interop extension in case you go with that route. Oct 8, 2010 at 17:49

Due to a rather short turnaround time I broke down and using the "Add CAD Fields" GP tool to add the layer properties fields (Check Box). I then used the field calculator in ArcMAP to Concatenate the valves from my attribute fields in this case Diameter and Material along with the text string "WaterPipe" into the LyrName attribute field. I then used the "Export to CAD" GP tool remebering to leave the Ignore Paths in Table box unchecked. The resultant DWG file created contained my pipes neatly organized in CAD layers named [Diameter][Material]"WaterPipe" (i.e. 6DIPWaterPipe).

  • I did this before seeing Mario's post which I intend to check out as it doesn't require me to add any additional fields to my data. The Add Cad Fields GP tool added 12 fields of which 11 went unused. I did create a clone of my data before running so I really didn't change my base data. If it doesn't take a lot more effort to use Mario's method I might make that my standard operating procedure. So I am deferring a selection of correct answer pending further comparisons of the methods.
    – Chris M
    Oct 8, 2010 at 14:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.