I'm not sure how you can achieve this in Model Builder, but once you're model is completely finished, you can export it to a Python script, create a script tool, and use validation to customize the filter.
def initializeParameters(self): """Refine the properties of a tool's parameters. This method is called when the tool is opened.""" mxd = arcpy.mapping.MapDocument("CURRENT") lyrs = arcpy.mapping.ListLayers(mxd) compare_list = ['points','buff','something_else'] # the full list of layers you want to consider param_list = [] for lyr in lyrs: if lyr.name in compare_list: param_list.append(lyr.name) # add to internal list self.params[2].filter.list = param_list # overwrite filter list return
Darren,
That works well as I will know the names of the layers. The only issue that I have with this process is that it is possible that not all layers will be in the TOC and I do not want layers not in the TOC available in the dropdown.
Thanks again!
Do you know the names in the layer list beforehand? If so, you can populate a string parameter value list with the names of your layers, and reference them in your model through inline variable substitution.
Is anyone aware if this question was ever answered? Even though it was posted several years ago, I am running into the same issue. However instead of rasters, I'm dealing with feature classes. I can filter the dropdown selection in the parameter by feature class type but am looking to filter this dropdown to specific feature class names.
Thanks.
サインインしたメンバーは投稿、更新のフォローなどができます。初めてですか?無料アカウントを登録してください。
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.