Tell me more ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

Here is a snippet from the functioning ArcGIS 9.2 script:

for item in lst_dxf_o_files:

                gp.MakeFeatureLayer_management(item + os.sep + 'Annotation', 'tmp_3rayon_lyr', "UPPER(layer) LIKE 'OFF_LO_RAY' AND UPPER(txtmemo) LIKE 'R: %,%'")
                print unicode(gp.GetMessages()).encode("iso-8859-2", "replace") + "\n"
                lst_anno_lyrs.append('tmp_3rayon_lyr')

                gp.MakeFeatureLayer_management(item + os.sep + 'Annotation', 'tmp_4pc_lyr', "UPPER(layer) = 'GRA_NM_PLA_COM' AND UPPER(txtmemo) LIKE 'PC%'")
                print unicode(gp.GetMessages()).encode("iso-8859-2", "replace") + "\n"
                lst_anno_lyrs.append('tmp_4pc_lyr')

# Process: ImportCADAnnotation
gp.ImportCADAnnotation(';'.join(lst_anno_lyrs), tmp_an, 1000, "ONE_CLASS_ONLY", "NO_MATCH", "NO_SYMBOL_REQUIRED", "STANDARD", "", "NO_AUTO_CREATE", "NO_AUTO_UPDATE")
print unicode(gp.GetMessages()).encode("iso-8859-2", "replace") + "\n"

And here is the non-functioning ArcGIS 10.0 version:

for item in lst_dxf_o_files:

                arcpy.MakeFeatureLayer_management(item + os.sep + 'Annotation', 'tmp_3rayon_lyr', "UPPER(layer) LIKE 'OFF_LO_RAY' AND UPPER(txtmemo) LIKE 'R: %,%'")
                print unicode(arcpy.GetMessages()).encode("iso-8859-2", "replace") + "\n"
                lst_anno_lyrs.append('tmp_3rayon_lyr')

                arcpy.MakeFeatureLayer_management(item + os.sep + 'Annotation', 'tmp_4pc_lyr', "UPPER(layer) = 'GRA_NM_PLA_COM' AND UPPER(txtmemo) LIKE 'PC%'")
                print unicode(arcpy.GetMessages()).encode("iso-8859-2", "replace") + "\n"
                lst_anno_lyrs.append('tmp_4pc_lyr')

# Process: ImportCADAnnotation
arcpy.ImportCADAnnotation_conversion(';'.join(lst_anno_lyrs), tmp_an, 1000, "ONE_CLASS_ONLY", "NO_MATCH", "NO_SYMBOL_REQUIRED", "STANDARD", "", "NO_AUTO_CREATE", "NO_AUTO_UPDATE")
print unicode(arcpy.GetMessages()).encode("iso-8859-2", "replace") + "\n"

And here are the error messages:

GP ERRORS: ERROR 000021: Failed to create the output annotation feature class Failed to execute (ImportCADAnnotation).

PYTHON ERRORS: Traceback Info: File "D:\workspace\Scripts\cadastre_pour_v__Outils_\Scripts\Copie de 01_urb_cad_projete_chargement.py", line 78, in arcpy.ImportCADAnnotation_conversion(';'.join(lst_anno_lyrs), tmp_an, 1000, "ONE_CLASS_ONLY", "NO_MATCH", "NO_SYMBOL_REQUIRED", "STANDARD", "", "NO_AUTO_CREATE", "NO_AUTO_UPDATE")

Error Info: : ERROR 000021: Failed to create the output annotation feature class Failed to execute (ImportCADAnnotation).

I noticed that the Make Feature Layer (Data Management) documentation at both versions mentions the following limitation regarding the parameter:

"Complex feature classes, such as annotation and dimensions, are not valid inputs to this tool."

I have also experimented with using the python list directly for the input_features parameter, but I still get the same error. The output workspace is a PGDB for the relavant version (9.2 vs. 10).

Cheers for any insight!

Here is a link to the same question on the ESRI Forums:

http://forums.arcgis.com/threads/78233-Import-Cad-Annotation-unable-to-get-an-ArcGIS-9.2-script-to-function-with-ArcGIS-10

share|improve this question

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

Your Answer

 
discard

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

Browse other questions tagged or ask your own question.