I have a working model that filters data down to a few layer files. I also have a working python script that will take those filtered layers and further filter them. As of now I have to run the model and then run the script, I'm trying to merge the processes for efficiency. When I drag the script into Modelbuilder or try to create another model to do a model within a model, the process will run except the searchcursor won't do any "searching."
Heres the Script
import os
import sys
import arcpy
Workspace = arcpy.GetParameterAsText(0) # Workspace
Points_Filtered = arcpy.GetParameterAsText(1) # Feature Layer
Event_id = arcpy.GetParameterAsText(2) # Event_ID
RTL_Unfiltered = arcpy.GetParameterAsText(3) # Feature Layer
FP1 = os.path.abspath(Workspace)
outputFile = fr"{FP1}\RTL_Filtered"
events = arcpy.da.SearchCursor(Points_Filtered, Event_id)
unique_events = list(set([row[0] for row in events]))
sql = "event_id IN(" + ','.join(map(str, unique_events)) + ")"
arcpy.management.SelectLayerByAttribute(RTL_Unfiltered, "NEW_SELECTION", sql, None)
arcpy.management.CopyFeatures(RTL_Unfiltered, outputFile, '', None, None, None)
arcpy.SetParameterAsText(4, outputFile)