Hey Guys,
The Problem is as follows:
Main problem is that I have different data sets in different geodatabases and out of these datasets I want the end-user to choose one dataset. The selection process in the main problem. With the selected data set you can then work in the routine. I want to narrow down the choice for each routine, because only the use of some data is meaningful in the routine. More routines are developed. I want to predefine which datasets could be used for the routine.
Through a script a data set shall be selected for the use in a routine, so that a feature layer is shown.
The script looks like this:
<SPAN class="keyword token">import</SPAN> sys<SPAN class="punctuation token">,</SPAN> string<SPAN class="punctuation token">,</SPAN> os<SPAN class="punctuation token">,</SPAN> arcgisscripting
gp <SPAN class="operator token">=</SPAN> arcgisscripting<SPAN class="punctuation token">.</SPAN>create<SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN>
gp<SPAN class="punctuation token">.</SPAN>AddToolbox<SPAN class="punctuation token">(</SPAN><SPAN class="string token">"C:\\Users\\bootcamp\\Desktop\\20181008\\Toolbox.tbx"</SPAN><SPAN class="punctuation token">)</SPAN>
Input <SPAN class="operator token">=</SPAN> gp<SPAN class="punctuation token">.</SPAN>GetParameterAsText<SPAN class="punctuation token">(</SPAN><SPAN class="number token">0</SPAN><SPAN class="punctuation token">)</SPAN>
gp<SPAN class="punctuation token">.</SPAN>AddMessage <SPAN class="punctuation token">(</SPAN>gp<SPAN class="punctuation token">.</SPAN>GetParameterAsText<SPAN class="punctuation token">(</SPAN><SPAN class="number token">0</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">)</SPAN>
<SPAN class="keyword token">if</SPAN> Input <SPAN class="operator token">==</SPAN> <SPAN class="string token">"Fahrradwege"</SPAN><SPAN class="punctuation token">:</SPAN> Fahrradwege <SPAN class="operator token">=</SPAN> <SPAN class="string token">"C:\\Users\\bootcamp\\Desktop\\20181008\\touristische Infrastruktur.gdb\\Freizeit\\Fahrradwege"</SPAN> Fahrradwege_Layer <SPAN class="operator token">=</SPAN> <SPAN class="string token">"Fahrradwege_Layer"</SPAN> gp<SPAN class="punctuation token">.</SPAN>MakeFeatureLayer_management<SPAN class="punctuation token">(</SPAN>Fahrradwege<SPAN class="punctuation token">,</SPAN> Fahrradwege_Layer<SPAN class="punctuation token">,</SPAN> <SPAN class="string token">""</SPAN><SPAN class="punctuation token">,</SPAN> <SPAN class="string token">""</SPAN><SPAN class="punctuation token">,</SPAN> <SPAN class="string token">"NAME NAME VISIBLE NONE; Shape_Length Shape_Length VISIBLE NONE; Shape_Le_1 Shape_Le_1 VISIBLE NONE"</SPAN><SPAN class="punctuation token">)</SPAN> gp<SPAN class="punctuation token">.</SPAN>SelectLayerByAttribute_management<SPAN class="punctuation token">(</SPAN>Fahrradwege_Layer<SPAN class="punctuation token">,</SPAN> <SPAN class="string token">"ADD_TO_SELECTION"</SPAN><SPAN class="punctuation token">)</SPAN> Zwischenergebnis <SPAN class="operator token">=</SPAN> <SPAN class="string token">"Fahrradwege_Layer"</SPAN> Ergebnis_Layer <SPAN class="operator token">=</SPAN> <SPAN class="string token">"Ergebnis_Layer"</SPAN> gp<SPAN class="punctuation token">.</SPAN>MakeFeatureLayer_management<SPAN class="punctuation token">(</SPAN>Fahrradwege_Layer<SPAN class="punctuation token">,</SPAN> Ergebnis_Layer<SPAN class="punctuation token">,</SPAN> <SPAN class="string token">""</SPAN><SPAN class="punctuation token">,</SPAN> <SPAN class="string token">""</SPAN><SPAN class="punctuation token">,</SPAN> <SPAN class="string token">"NAME NAME VISIBLE NONE; Shape_Length Shape_Length VISIBLE NONE; Shape_Le_1 Shape_Le_1 VISIBLE NONE"</SPAN><SPAN class="punctuation token">)</SPAN>
<SPAN class="keyword token">elif</SPAN> Input <SPAN class="operator token">==</SPAN> <SPAN class="string token">"Straßen"</SPAN><SPAN class="punctuation token">:</SPAN> Strassen <SPAN class="operator token">=</SPAN> <SPAN class="string token">"C:\\Users\\bootcamp\\Desktop\\20181008\\touristische Infrastruktur.gdb\\Transport\\Straßen"</SPAN> gp<SPAN class="punctuation token">.</SPAN>MakeFeatureLayer_management<SPAN class="punctuation token">(</SPAN>Strassen<SPAN class="punctuation token">,</SPAN> Strassen_Layer<SPAN class="punctuation token">,</SPAN> <SPAN class="string token">""</SPAN><SPAN class="punctuation token">,</SPAN> <SPAN class="string token">""</SPAN><SPAN class="punctuation token">,</SPAN> <SPAN class="string token">"BEZ BEZ VISIBLE NONE; Shape_Length Shape_Length VISIBLE NONE; Shape_Le_1 Shape_Le_1 VISIBLE NONE"</SPAN><SPAN class="punctuation token">)</SPAN> gp<SPAN class="punctuation token">.</SPAN>SelectLayerByAttribute_management<SPAN class="punctuation token">(</SPAN>Strassen_Layer<SPAN class="punctuation token">,</SPAN> <SPAN class="string token">"ADD_TO_SELECTION"</SPAN><SPAN class="punctuation token">)</SPAN> Zwischenergebnis <SPAN class="operator token">=</SPAN> <SPAN class="string token">"Strassen_Layer"</SPAN> Ergebnis_Layer <SPAN class="operator token">=</SPAN> <SPAN class="string token">"Ergebnis_Layer"</SPAN> gp<SPAN class="punctuation token">.</SPAN>MakeFeatureLayer_management<SPAN class="punctuation token">(</SPAN>Strassen_Layer<SPAN class="punctuation token">,</SPAN> Ergebnis_Layer<SPAN class="punctuation token">,</SPAN> <SPAN class="string token">""</SPAN><SPAN class="punctuation token">,</SPAN> <SPAN class="string token">""</SPAN><SPAN class="punctuation token">,</SPAN> <SPAN class="string token">"BEZ BEZ VISIBLE NONE; Shape_Length Shape_Length VISIBLE NONE; Shape_Le_1 Shape_Le_1 VISIBLE NONE"</SPAN><SPAN class="punctuation token">)</SPAN>
<SPAN class="keyword token">elif</SPAN> Input <SPAN class="operator token">==</SPAN> <SPAN class="string token">"Schienen"</SPAN><SPAN class="punctuation token">:</SPAN> Schienen <SPAN class="operator token">=</SPAN> <SPAN class="string token">"C:\\Users\\bootcamp\\Desktop\\20181008\\touristische Infrastruktur.gdb\\Transport\\Schienen"</SPAN> Schienen_Layer <SPAN class="operator token">=</SPAN> <SPAN class="string token">"Schienen_Layer"</SPAN> gp<SPAN class="punctuation token">.</SPAN>MakeFeatureLayer_management<SPAN class="punctuation token">(</SPAN>Schienen<SPAN class="punctuation token">,</SPAN> Schienen_Layer<SPAN class="punctuation token">,</SPAN> <SPAN class="string token">""</SPAN><SPAN class="punctuation token">,</SPAN> <SPAN class="string token">""</SPAN><SPAN class="punctuation token">,</SPAN> <SPAN class="string token">"NAME NAME VISIBLE NONE; Shape_Length Shape_Length VISIBLE NONE; Shape_Le_1 Shape_Le_1 VISIBLE NONE"</SPAN><SPAN class="punctuation token">)</SPAN> gp<SPAN class="punctuation token">.</SPAN>SelectLayerByAttribute_management<SPAN class="punctuation token">(</SPAN>Output_Layer<SPAN class="punctuation token">,</SPAN> <SPAN class="string token">"ADD_TO_SELECTION"</SPAN><SPAN class="punctuation token">)</SPAN> Zwischenergebnis <SPAN class="operator token">=</SPAN> <SPAN class="string token">"Schienen_Layer"</SPAN> Ergebnis_Layer <SPAN class="operator token">=</SPAN> <SPAN class="string token">"Ergebnis_Layer"</SPAN> gp<SPAN class="punctuation token">.</SPAN>MakeFeatureLayer_management<SPAN class="punctuation token">(</SPAN>Schienen_Layer<SPAN class="punctuation token">,</SPAN> Ergebnis_Layer<SPAN class="punctuation token">,</SPAN> <SPAN class="string token">""</SPAN><SPAN class="punctuation token">,</SPAN> <SPAN class="string token">""</SPAN><SPAN class="punctuation token">,</SPAN> <SPAN class="string token">"NAME NAME VISIBLE NONE; Shape_Length Shape_Length VISIBLE NONE; Shape_Le_1 Shape_Le_1 VISIBLE NONE"</SPAN><SPAN class="punctuation token">)</SPAN>
<SPAN class="keyword token">else</SPAN><SPAN class="punctuation token">:</SPAN> <SPAN class="keyword token">print</SPAN> <SPAN class="punctuation token">(</SPAN><SPAN class="string token">"Fehlerhafte Auswahl! Dieser Datensatz existiert nicht!"</SPAN><SPAN class="punctuation token">)</SPAN>
gp<SPAN class="punctuation token">.</SPAN>SetParameter<SPAN class="punctuation token">(</SPAN><SPAN class="number token">1</SPAN><SPAN class="punctuation token">,</SPAN>Ergebnis_Layer<SPAN class="punctuation token">)</SPAN>
<SPAN class="line-numbers-rows"><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN></SPAN>
Parameters for the script are defined as follows:

If I integrate my script in the Modul Builder in ArcGIS, this script stays white.
I want to generate the Result_Layer(Ergebins_Layer) as Output. The routine shall then work with the output. Right now, the entry mask of the script queries the Result_Layer(Ergebins_Layer). The output file is not yet generated. I can’t put something in the mask, that is not there. It looks like this:

How can I adjust the code, so that the Result_Layer is only generated as the output?