Hi,
I'm working on a model with model builder.
At the end of the process i want to set the symbology using "Apply symbology from layer" tool.
The .lyr file varies by the input of the process. I'm doing this using "calculate value" tool.
Here is the code in the calculate value:
def x(num):
if num==2:
return "C:\\tmp\GisSql.tmp2.lyr"
return "C:\\tmp\GisSql.tmp3.lyr"
now, the model runs perfectly on my local machine, including the symbology decision above.
but after publishing and trying to run it i get an error:
Well, i understand the problem. The .lyr file was not copied to the server, or the server cant find it for any other reason.
The question is, how can i dynamically change the symbology of a geo process?
I tried registering the "c:\tmp" folder with with the server - with no luck.
Any advice? I've spent hours on this..
I have the same problem. I have written a python script which should apply a symbology from a lyr file to the output layer. The path to the file is hard coded in the script. The folder has read acces for the user of the ArcGIS for Server Windows service. The tool ApplySymbologyFromLayer_management does not fire an exception. But in the map service of the gp service, the applied symbology does not show up. The features are always symbolized with the symbology used when publishing the geoprocessing service.
features = arcpy.GetParameterAsText(0) whereClause = arcpy.GetParameterAsText(1) arcpy.MakeFeatureLayer_management(features, "layerName", whereClause) symbology = 'C:\\data\\gp\\mysymbology.lyr' arcpy.ApplySymbologyFromLayer_management("layerName", symbology) arcpy.SetParameterAsText(2, "layerName")
Any luck on this ?? I'm trying to do the same thing
Hi,
Has there been any luck on this issue? Either with the two options below work in ArcGIS Pro 2.5, but does not contain symbology in the Geoprocessing Widget in WAB:
# Method 1 - ApplySymbologyFromLayer():
arcpy.ApplySymbologyFromLayer("layer_PATH", "symbology_PATH")
# Method 2 - parameters[1].symbology:
parameters[1].symbology = "symbology_PATH"
Does anyone have any help on preserving symbology from a layer file (".lyrx") in the output of a geoprocessing service? It simply is not preserved for me.
anybody have any luck with this? I realllllllllly need this figured out for a custom GP service I built too.