Using Arc 10.2
I am getting the following error message...
ExecuteError: Failed to execute. Parameters are not valid. ERROR 000732: Input Layer: Dataset Q:\Data\Infrastructure\Infrastructure.gdb\LiftStations_Active does not exist or is not supported Failed to execute (ApplySymbologyFromLayer).
...when I run a script containing the following code snippet:
dest = arcpy.GetParameterAsText(1) destWorkspace, destName = os.path.split(dest) arcpy.FeatureClassToFeatureClass_conversion(source, destWorkspace, destName, "", mapping) in_symbology_layer = r"Q:\Data\lyrfiles\LiftStations.lyr" arcpy.ApplySymbologyFromLayer_management (dest, in_symbology_layer)
There are no problems with the first four lines of my snippet (all the parameters are legit and I'd rather spare you the entire or extraneous sections of my code). The error message says nothing about those lines and I've confirmed the "in_symbology_layer" exists (Q:\Data\lyrfiles\LiftStations.lyr).
I have double checked - the FC mentioned in the above error message does exist. In fact, since it comes directly from the tool's 2nd GetParameterAsText, the tool warns me that it "already exists" with the exclamation symbol beside the parameter field.
Why am I getting this error?
Am I not allowed to use "ApplySymbologyFromLayer_management" on a Feature Class? On a newly-created FC?
Does it have anything to do with the fact that since "dest" is an Output Parameter it gets deleted as soon as the script begins? (reference: "Why is “arcpy.GetParameterAsText” deleting Target Feature Class?")
Does it have anything to do with the fact that "dest" then gets recreated only two lines prior to 'ApplySymbologyFromLayer_management'?