I'm new to Arcmap and arcpy but I've been watching videos and reading documentation to try to learn.
I'm writing my first python toolbox. I know there's a way to do this in batch processing, but for proof of concept I want to write this pyt tool to call the Clip tool and add the resulting featureclasses to the map.
According to the documentation, here is how you're supposed to call the Clip tool:
arcpy.Clip_analysis('input_feature', 'clip_feature', 'output_feature')The parameters I have defined for my tool are two "Feature Layer"s for the user to select, and then a Derived parameter that is a Feature Layer and an Output.
After parameters are defined, the only part of the code that does anything is the execute function. I just want to call Clip_analysis with the names of the feature layers that the user defined, and then output to the derived output feature layer.
It seems that calling Clip_analysis with these parameters will output to the gdb I am working in, but it will not show up in the current layer in arcmap. How do I solve this? (And thank you.)
أكثر...
I'm writing my first python toolbox. I know there's a way to do this in batch processing, but for proof of concept I want to write this pyt tool to call the Clip tool and add the resulting featureclasses to the map.
According to the documentation, here is how you're supposed to call the Clip tool:
arcpy.Clip_analysis('input_feature', 'clip_feature', 'output_feature')The parameters I have defined for my tool are two "Feature Layer"s for the user to select, and then a Derived parameter that is a Feature Layer and an Output.
After parameters are defined, the only part of the code that does anything is the execute function. I just want to call Clip_analysis with the names of the feature layers that the user defined, and then output to the derived output feature layer.
It seems that calling Clip_analysis with these parameters will output to the gdb I am working in, but it will not show up in the current layer in arcmap. How do I solve this? (And thank you.)
أكثر...