laptop and a wrench

Bogue

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.

Dernière publication: August 25, 2014 ArcGIS for Desktop
Numéro d’ID de bogue NIM088841
EnvoiFebruary 6, 2013
Dernière modificationJune 5, 2024
S’applique àArcGIS for Desktop
Version trouvée10.1
Système d’exploitationWindows OS
Version du système d’exploitation7
Version de correction10.2.1
StatutFixed

Solution de contournement

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()#####

Étapes pour reproduire

ID de bogue: NIM088841

Logiciel:

  • ArcGIS for Desktop

Recevoir une notification lorsque le statut d’un bogue change

Télécharger l’application Esri Support

En savoir plus sur ce sujet

Obtenir de l’aide auprès des experts ArcGIS

Contacter le support technique

Télécharger l’application Esri Support

Accéder aux options de téléchargement