laptop and a wrench

Bug

Setting a default symbology for the derived output raster layer of a script tool that is brought into the tool using arcpy.SetParameterAsText causes ArcMap to crash.

Last Published: August 25, 2014 ArcGIS for Desktop
Bug ID Number NIM088841
SubmittedFebruary 6, 2013
Last ModifiedJune 5, 2024
Applies toArcGIS for Desktop
Version found10.1
Operating SystemWindows OS
Operating System Version7
Version Fixed10.2.1
StatusFixed

Workaround

Add the layer to the map manually and use UpdateLayer to import the other symbology. For example:#####import arcpymxd = arcpy.mapping.MapDocument("Current")df = arcpy.mapping.ListDataFrames(mxd)[0]Output_LAC_Raster = r"<a href="file:C:/testdata/data.gdb/Landcover_Level2_NLCD2006" target="_blank">C:\testdata\data.gdb\Landcover_Level2_NLCD2006</a>"arcpy.SetParameterAsText(0, Output_LAC_Raster)updatelayer = arcpy.GetParameterAsText(0)arcpy.AddMessage(updatelayer)updatelayer2 = arcpy.mapping.Layer(updatelayer)sourceL = arcpy.mapping.Layer(r"<a href="file:C:/testdata/lac.lyr" target="_blank">C:\testdata\lac.lyr</a>")arcpy.mapping.UpdateLayer(df, updatelayer2, sourceL)arcpy.mapping.AddLayer(df, updatelayer2)arcpy.RefreshTOC()#####

Steps to Reproduce

Bug ID: NIM088841

Software:

  • ArcGIS for Desktop

Get notified when the status of a bug changes

Download the Esri Support App

Discover more on this topic

Get help from ArcGIS experts

Contact technical support

Download the Esri Support App

Go to download options