Apply Symbology not working inside Model Builder

692
1
12-16-2021 09:01 AM
DevonAlsip
New Contributor II

Hello everyone, I am working on a model that enables the end user to select a color scheme that will be applied to all outputs from a drop down list. The way I am doing this is by creating a string variable and making that a Value List. I then use Calculate Value and an 'if/elif' statement that says "If this color scheme is chosen, then reference this specific folder". The output of Calculate Value is a Folder. Inside the selected folder are all the layer files for that color scheme. I then use the output of the Calculate Value as an in-line variable inside my submodel later on when referencing the symbology layer in 'Apply Symbology from Layer'.

This method works for one of the outputs where the symbology type is 'Classify', but the Apply Symbology from Layer tool does not work at all for my other outputs where the Symbology type is 'Unique Values'. I have tried using absolute paths and in-line variables but the Apply Symbology tool does not work at all. I have also tried using the in-line variable inside the properties of the output to reference the layer template, but that does not work either. The only way have gotten the symbologies to be applied to the output file is by using an absolute path inside the output properties. I have attached pictures that should help show the flow of the model and my end goal.

I am aware of BUG-000120906 'The Apply Symbology From Layer and Make Feature Layer tools do not work in a model when the input uses an inline variable.' The support page says this bug was fixed in v2.7, but I am running 2.8 and still experiencing problems.

Does anyone having any work around for this bug or any suggestions that could help? Much appreciated for your time!

1 Reply
Carl_Flint
New Contributor III

Do you by chance have a reference of your model?  I've used the arcpy.management.ApplySymbologyFromLayer() in scripts applying updates to a Pro project before and usually works fine.

Carl Flint, GISP
0 Kudos