laptop and a wrench

Bogue

The updated symbology is not applied to the exported PDF when running a script tool.

Dernière publication: December 8, 2021 ArcGIS Pro
Numéro d’ID de bogue BUG-000142773
EnvoiSeptember 8, 2021
Dernière modificationJune 5, 2024
S’applique àArcGIS Pro
Version trouvée2.8.2
Système d’exploitationWindows OS
Version du système d’exploitation10.0
StatutNon-Reproducible

Informations supplémentaires

The issue is non-reproducible.

Solution de contournement

Create a feature layer, apply the symbology, and add the layer. The sample script is stated as below:

import os

p = arcpy.mp.ArcGISProject('current')

m = p.listMaps()[0]

relpath = r"C:\Users\<Username>\Documents\ArcGIS\Packages\SymbologyLayout_806889\commondata\work"

#SymbolLayer

symbolLayer = os.path.join(relpath, "Boundary.lyrx")

#Add Layer 1 and update symbology

#lyr1add = m.addDataFromPath(os.path.join(relpath, "workone.shp"))

#arcpy.management.ApplySymbologyFromLayer(lyr1add, symbolLayer, None, "DEFAULT")

lyr1path = os.path.join(relpath, "workone.shp")

lyr1make = arcpy.management.MakeFeatureLayer(lyr1path, "WorkOne")

lyr1add = arcpy.management.ApplySymbologyFromLayer(lyr1make, symbolLayer, None, "DEFAULT")

m.addLayer(lyr1add.getOutput(0))

#Export

lyt = p.listLayouts('Layout')[0]

lyt.exportToPDF(r"C:\Temp\TestOutput.pdf")

os.startfile(r"C:\Temp\TestOutput.pdf")

Étapes pour reproduire

ID de bogue: BUG-000142773

Logiciel:

  • ArcGIS Pro

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