Suppressing Messages from arcpy.FeatureClassToShapefile_conversion

1236
4
02-11-2013 09:20 AM
TomNeer
New Contributor III
I am using the command

arcpy.FeatureClassToShapefile_conversion([workspace + "/townships", workspace + "/township_points", workspace + "/section_points", workspace + "/sections"], proc_fldr)


to convert a temporary workspace out to shapefile. Unfortunately, unlike arcpy.Project_management, arcpy.CopyFeatures_management, arcpy.SelectLayerByLocation_management, and arcpy.MakeFeatureLayer_management, the arcpy.FeatureClassToShapefile_conversion sends the following back to the console.

D:/DDS/_Sites/PLSSFinder/orders/processing/20130210175117_Neer/20130210175117_Ne
er_temp.gdb/townships Successfully converted:  D:/DDS/_Sites/PLSSFinder/orders/p
rocessing/20130210175117_Neer\townships.shp
D:/DDS/_Sites/PLSSFinder/orders/processing/20130210175117_Neer/20130210175117_Ne
er_temp.gdb/townships Successfully converted:  D:/DDS/_Sites/PLSSFinder/orders/p
rocessing/20130210175117_Neer\townships_1.shp
D:/DDS/_Sites/PLSSFinder/orders/processing/20130210175117_Neer/20130210175117_Ne
er_temp.gdb/townships Successfully converted:  D:/DDS/_Sites/PLSSFinder/orders/p
rocessing/20130210175117_Neer\townships_2.shp
D:/DDS/_Sites/PLSSFinder/orders/processing/20130210175117_Neer/20130210175117_Ne
er_temp.gdb/townships Successfully converted:  D:/DDS/_Sites/PLSSFinder/orders/p
rocessing/20130210175117_Neer\townships_3.shp


All the other tools I have to use arcpy.GetMessages() to get this info. I need to suppress this as it is causing problems. I've tried trace back through the arcpy libraries but cannot locate where these messages are being generated. Any idea on how I can suppress this?
Tags (2)
0 Kudos
4 Replies
MathewCoyle
Frequent Contributor
They are generated from the script you are calling. You can edit the script or create a new one and import it separately. If you edit the script directly I suggest you make a copy just in case.

Here is the line to edit.
ConversionUtils.gp.AddMessage("%s %s %s" % (inFeatureClass, msgSuccess, outFeatureClass))
0 Kudos
TomNeer
New Contributor III
Thanks for the location. It seems to be deeper than that. Commenting out those lines did not stop the status messages. I resolved it by splitting the script and running from the command line.
0 Kudos
MathewCoyle
Frequent Contributor
Did you save the script after you commented out the line? It works in 10.0, in 10.1 it seems the ability to modify system scripts directly has been disabled.
0 Kudos
TomNeer
New Contributor III
Yep. Saved the script. Commented out that line and the line before. Also tried directly calling the conversion function and skipping the FeatureClassToShapefile function. No go on either. Could be because I am running 10.1?

I have my processing script running as a Scheduled Task. I already had one running cleanup (deleting processed files after 30 days), so I just merge those together. Does the same thing, just came at it from another angle.

Thanks for the input!
0 Kudos