Iterate File Directory and Copy CAD Lines to Geodatabase in Model Builder

1642
6
09-14-2018 09:12 AM
AdamDaily
Occasional Contributor II

I've tried every way I could find to iterate through a file directory, extract CAD files, and then copy the CAD lines to a geodatabase. I want to avoid having to append each dataset individually to a matching db layer. I tried using a number of tools and combinations of tools and settings, creating new feature classes vs using existing ones. I am using Arc 10.6, and Autodesk 2018.

Nothing works. All I get are errors and empty outputs. I'd like to do this in model builder but wondering if it is even possible? None of these tools seem to do what they say they do. Just a few of the many things I've tried are shown below. Can anyone point me to a workflow that actually works?

Feature Class to Feature Class

CAD to Geodatabase

Copy Features

Copy

Collect Values

Create Feature Layer

0 Kudos
6 Replies
AdrianWelsh
MVP Honored Contributor

Adam,

Take a look at this other thread. Does this help do what you need done?

Export CAD Data With Modelbuilder 

If not, there is a Python workflow in this thread that might help:

https://community.esri.com/thread/172138 

0 Kudos
AdamDaily
Occasional Contributor II

Adrian,

Thank you for the reply and for posting those links. I had seen those threads previously, and I have tried the iterate dataset & feature class to feature class, as well as iterate feature class & copy methods he describes. Neither version returned anything for me except empty outputs and generic error messages.

I'm not able to copy the CAD data using any of these tools connected to an iterator. The only way that has worked so far is using "append" outside of iterating, by matching up every CAD file separately in my model to its created database layer (which I do not want to do for entire directories of CAD files).

I'm wondering if there is some compatibility issue with model builder reading newer CAD files?

0 Kudos
AdrianWelsh
MVP Honored Contributor

These are the supported CAD formats, according to Esri:

Supported CAD formats in ArcGIS—ArcGIS Pro | ArcGIS Desktop 

So, it looks like you should be ok. If you were to use a 'lower' version of a dwg CAD file, would it make a difference in your model?

0 Kudos
AdamDaily
Occasional Contributor II

These supported formats are for Pro, would it matter that I'm using desktop/catalog and not Pro? I've noticed a number of other arc toolbox tools that I use regularly in model builder that suddenly don't work well when exported to python.

0 Kudos
AdamDaily
Occasional Contributor II

I was able to get Iterate Feature Classes to work with Feature Class to Geodatabase to output CAD layers to a empty geodb. This still doesn't work well however, since I can't tell it which CAD files I want to use for iteration. I end up processing many files I don't need or want.

The wildcard in the iterator doesn't work when the name you want to search for in in the middle of a file name. Example: I have a folder with lots of CAD files all with different naming conventions. I want to use wildcard to keep only CAD layers with a string "value" in the file name:

"data-1 my value.dwg", "data-1_yourvalues.dwg", "some_other_value1.dwg". 

-   Cant use *value* or value*. Is there any way to do this? 

0 Kudos
AdrianWelsh
MVP Honored Contributor

Adam, I am not really sure. That is a good question about whether or not those CAD formats are only supported in ArcGIS Pro‌ versus ArcMap. Is there a way to use a 'lesser' version of the CAD data (like save it down to 2013 version or whatever) and try the model iterations that way? Other than that, I would not know.

There doesn't seem to be a lot of documentation on wildcards for modelbuilder. I found this article but does not have much detail:

Examples of using iterators in ModelBuilder—Tools | ArcGIS Desktop 

0 Kudos