I could never get the Append Tool with the NO_TEST option to work so I called a Python script.
Test Failed
try
{
ESRI.ArcGIS.Geoprocessor.Geoprocessor gp = new ESRI.ArcGIS.Geoprocessor.Geoprocessor();
ESRI.ArcGIS.ConversionTools.MapToKML mk = new ESRI.ArcGIS.ConversionTools.MapToKML();
mk.in_map_document = @"U:\kmltest.mxd";
mk.data_frame = "Layers";
mk.map_output_scale = 24000;
mk.out_kmz_file = @"U:\junk5.kml";
/*mk.is_composite = "NO_COMPOSITE";
mk.is_vector_to_raster = "VECTOR_TO_VECTOR";
mk.extent_to_export ="";
mk.image_size = 2048;
mk.dpi_of_client = 192;*/
gp.Execute(mk, null);
}
catch
{
MessageBox.Show("Failed");
}
this.Close();
Python Fix
appendStatus = RunPythonScript.ExecuteCommand("cmd", "/c " + @"C:\python26\ArcGIS10.0\python.exe " + @"U:\loc\GIS\PROJECTS\CustomTools\PythonScripts\append.py" + " " + input + "," + output);
class RunPythonScript
{
public static Boolean ExecuteCommand(string command, string arug)
{
Boolean appendComplete = true;
try
{
string result;
Process pProcess = new Process();
pProcess.StartInfo.UseShellExecute = false;
pProcess.StartInfo.Arguments = arug;
pProcess.StartInfo.CreateNoWindow = true;
pProcess.StartInfo.RedirectStandardOutput = true;
pProcess.StartInfo.RedirectStandardError = true;
pProcess.StartInfo.FileName= command;
pProcess.Start();
result = pProcess.StandardOutput.ReadToEnd();
if (result.Substring(0, 4) == "true")
{
appendComplete = true;
}
else
{
appendComplete = false;
}
}
catch
{
appendComplete = false;
}
return appendComplete;
}
}