Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I need to obtain a list of all the CAD drawings within a specified folder (and subfolders). I initially tried using a Files Iterator in ModelBuilder, but when I specified the extension, it prompted me to use the Dataset Iterator as the CAD extensions are recognised datasets.

After creating a test folder of four CAD files and a subfolder with one CAD file, I ran the model with a Collect Value to get the list of the full pathname for each file.

enter image description here

It ran for about a minute before "completing" the model without advancing to collect the values. As I had restricted the dataset type, this meant that it did not find any CAD files. I then removed the restriction and ran it again. This time it quickly returned the CAD files.

I then restricted the dataset type to FEATURE. It returned a list of the CAD files, when it should not have returned anything. Does the dataset iterator not recognise CAD files properly (whereas the files iterator does, and therefore does not allow me to use it)?

share|improve this question

1 Answer 1

up vote 2 down vote accepted

I'm not sure what the problem with the dataset iterator is, but you can replace it with a little Python.

If you're at ArcGIS 10.1 SP1, you could use the arcpy.da.walk function, passing in the CadDrawing option for datatype.

Otherwise you could use os.walk to achieve the same thing, but you would need to implement logic to return only the file types you're interested in.

share|improve this answer
    
Quite odd - the same thing happens. The array is empty as if there were no CAD files. If I use arcpy.da.walk without specifying the data type, it now "sees" the CAD files. –  Arabella Jan 16 '13 at 9:11
    
I've resorted to using os.walk and restricting it to CAD extensions. I'll keep looking around to find out why it is not recognising the CAD files. Thanks –  Arabella Jan 16 '13 at 9:17

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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