2

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)?

2
  • were you able to resolve this?
    – user116630
    Mar 16, 2018 at 15:12
  • This does not really answer the question. If you have a different question, you can ask it by clicking Ask Question. You can also add a bounty to draw more attention to this question once you have enough reputation. - From Review
    – aldo_tapia
    Mar 16, 2018 at 15:33

1 Answer 1

2

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.

2
  • 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. Jan 16, 2013 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 Jan 16, 2013 at 9:17

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.