I updated the code in the script below per suggestion. I receive the same results as described in my original post, here...
I have a very simple Modelbuilder model (ArcGIS Pro, v2.6) that has a parameter for user input asking how many input feature classes to include (in a later model). I want the user to be able to input a number between 1-4 (AuxNum). If the user input value is 1 then a specific model runs, if the user input is 2 then a different model runs, and so on. Prior to the chosen model running, the user needs to be able to input parameter values prior to the model running. I want the python code to open the second model in the Geoprocessing window to allow the user to input parameters.
Here is the layout of the first user input model.
In the DecideAuxLayer tool in the above model layout, I have the following Python code, (spoiler alert!! I'm not a coder).
Toolbox is PreProcesses.tbx
Model names are Aux1, Aux2, Aux3, Aux4
Models and python script are inside PreProcesses.tbx
Toolbox, models, and .py are all located in C:\Temp
import arcpy arcpy.AddToolbox("C:/Temp/PreProcesses.tbx") AuxNum = arcpy.GetParameterAsText(0) if (AuxNum is 1): arcpy.Aux1_PreProcesses() elif (AuxNum is 2): arcpy.Aux2_PreProcesses()
Issue: when I run the Python script the model does not open in the Geoprocessing window. The model completes with no errors or warnings and shows that the input value is 1. That's it. Here is a screenshot of the results of the script model.