Bug
| Bug-ID-Nummer | BUG-000142773 |
|---|---|
| Eingereicht | September 8, 2021 |
| Zuletzt geändert | June 5, 2024 |
| Gilt für | ArcGIS Pro |
| Gefunden in Version | 2.8.2 |
| Betriebssystem | Windows OS |
| Betriebssystemversion | 10.0 |
| Status | Non-Reproducible |
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")
Bug-ID: BUG-000142773
Software:
Unterstützung durch ArcGIS-Experten anfordern
Esri Support App herunterladen