2

I am trying to ingest 1000's of DWG files into ArcGis. Some of them are clearly georeferenced (that is, if I view them in ArcMap I can see that there are in the right place relative to my other GIS data). Many of them are not geo referenced.

I don't know own a copy of AutoCad but I have the free TrueView DWG viewer installed.

Is there a tool that I can use to scan all of the DWG files and list which of them have a coordinate system assigned (and hopefully tell me what CS is defined).

Thanks,

2

You can use arcpy.Describe on each AutoCAD dwg and get the spatial reference out of the Describe object.

dwg_list = []
for dirpath, subdirs, files in os.walk(source):
    for f in files:
            if f.endswith(".dwg") or f.endswith(".DWG"):
            fullpath = os.path.join(dirpath, f)
            desc = arcpy.Describe(fullpath)
            dwg_sr = desc.spatialReference
            print(f)
            print(dwg_sr.name)
            dwg_list.append(fullpath)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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