In model builder I am attempting to Clip a Feature which has Selected Attributes by each polygon in another feature. This model will get the desired output. But, it will "Select Layer By Attribute" each time. Making the process slower.
I've tried variations of putting either the 'top' or 'bottom' commands before clip into submodels, but this has resulted in the same behavior. I've tried different iterators (e.g., use split by attributes on the clipping feature and then a feature class iterator) to no avail. If export to python code I can see that 'arcpy.SelectLayerByAttribute_management" is in the same for loop as 'clip'. How might I adjust this model to no longer "Select Layer By Attribute" for each clipping polygon?
Not sure, don't really use Model Builder for these kind of reasons. I'd probably suggest it's a result of the selection output being an input alongside the iterator but it doesn't make a great deal of sense.
Perhaps copy the selected feature in the model.
select layer by attribute --> selected feature --> copy feature
Thanks.
I tried 'select layer by attribute --> selected feature --> copy feature' as well as sticking that and the rest of the <select layer by attribute> into a submodel. But, unfortunately, <select layer by attribute> is run for each polygon still.
Scripting is likely the way to go. But, I am now eager to see if this could work with model builder.
Exporting the model to Python script isn't functional, but does reveal the <select layer by attribute> within the 'for loop' as I mentioned above. Here is that script for completeness: