I have been stuck on this problem for days now and I am starting to think that it can't be done. I am needing to search through a folder and find all of the CAD datasets. Then I need to run a select by attributes only on the Polyline layer so I can export out certain features based on their attributes. I don't know if there is a way to do that through ModelBuilder without selecting the Polyline layer first.
Solved! Go to Solution.
OK, here's what you can do.
1. Model 1 - Iterate Datasets with Dataset Type (optional) set to CAD, followed by Feature Class to Feature Class to save off the CAD datasets to a File Geodatabase as feature classes. You will have to have a File Geodatabase set up in advance before running this.
2. Model 2 - Iterate Feature Classes with Feature Type set to LINE. Then add in the Select processes and other processing you want to do. Model 2 would be run on the output from Model 1 after it finishes (See Iterate Feature Class example in link below):
Examples of using iterators in ModelBuilder—Tools | ArcGIS Desktop
3. If it is desired to have both models automatically run one after another, Model 3 would be a linking model. Essentially Model 3 would be calls to the other two models, one after another. Note that one cannot use more than one iterator in a Model, thus the need for multiple models.
Integrating a model within a model—Help | ArcGIS for Desktop
Also, if you are familiar with Python and are going to be running this sort of processing often, Python may be an easier and more efficient way to do this than Modelbuilder. Modelbuilder will still work, but it can be cumbersome once it involves multiple models.
Chris Donohue, GISP
For the first part of your challenge, finding the CAD datasets in a folder can be accomplished by using an Iterator in Modelbuilder. In this case Iterate Datasets looks like it will do the trick (See example in link):
Examples of using iterators in ModelBuilder—Tools | ArcGIS Desktop
The key in using this iterator is to set the "Dataset Type (optional)" setting to CAD.
Chris Donohue, GISP
Thanks for the response Chris. I am using the Iterate Datasets and setting the Dataset Type to CAD. My problem is after it iterates through the CAD datasets. I need to select just the polyline layer from the CAD dataset so I can run a select by attributes on the layer and create a new line layer inside a geodatabase. I am using the Select Data tool after I iterate but it is not giving me the option to select the polyline CAD layer.
I know there is a way to do the next step, I just am blanking on it at the moment (need caffeine)
In the meantime, here's some general CAD to GIS info in case that triggers some ideas:
Strategies for loading CAD data—Help | ArcGIS for Desktop
Chris Donohue, GISP
OK, here's what you can do.
1. Model 1 - Iterate Datasets with Dataset Type (optional) set to CAD, followed by Feature Class to Feature Class to save off the CAD datasets to a File Geodatabase as feature classes. You will have to have a File Geodatabase set up in advance before running this.
2. Model 2 - Iterate Feature Classes with Feature Type set to LINE. Then add in the Select processes and other processing you want to do. Model 2 would be run on the output from Model 1 after it finishes (See Iterate Feature Class example in link below):
Examples of using iterators in ModelBuilder—Tools | ArcGIS Desktop
3. If it is desired to have both models automatically run one after another, Model 3 would be a linking model. Essentially Model 3 would be calls to the other two models, one after another. Note that one cannot use more than one iterator in a Model, thus the need for multiple models.
Integrating a model within a model—Help | ArcGIS for Desktop
Also, if you are familiar with Python and are going to be running this sort of processing often, Python may be an easier and more efficient way to do this than Modelbuilder. Modelbuilder will still work, but it can be cumbersome once it involves multiple models.
Chris Donohue, GISP
Thank you for all of your help Chris!
I looked at create multiple models myself but since I won't be the only one to run the model, I was trying to combine it all into one. I will probably look at the Python option instead. I just need to dust off those skills and books to tackle this task
Preston Dallas
Preston, to follow up, when you get a model or script created, you can share it here (or just the gist of it). If Chris's reply help solve this issue, please mark his reply as "Correct".
Chris, thanks for responding and providing all this info! This is great!
Thanks,
Adrian