Select to view content in your preferred language

10.7.1 Python tool filters not displaying ArcMap layers

640
1
Jump to solution
07-07-2020 06:38 AM
williamwinner
New Contributor III

I have a python toolbox with a parameter set up like:

        lyrInput = arcpy.Parameter(name = "lyrInput",
                                   displayName="Input Feature Layer",
                                   direction="Input",
                                   datatype="GPFeatureLayer", #changed to allow drop-down from open layers
                                   parameterType="Required")
        lyrInput.filter.list = ["Polyline"]‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍

When I open the tool in ArcMap 10.5.1, it shows me the layers that have been added to ArcMap:

However, when I open it on our virtual servers using ArcMap 10.7.1, the filter doesn't show any layers added to ArcMap.  This means that selections won't be applied:

It's the exact same python script on both versions.  But, in 10.7.1, nothing shows.  I've tried creating a separate script and setting the filter in the properties and, when no filter is added, it shows me in_memory layers but when I set a filter to the feature layer, it doesn't show anything.

Any ideas?

UPDATE: I just noticed that my trying to add the newly created layer to ArcMap is not working.  It's giving an error stating, "CreateObject cannot open map document"

0 Kudos
1 Solution

Accepted Solutions
williamwinner
New Contributor III

I just restarted ArcMap again and, this time, it's working.  

View solution in original post

0 Kudos
1 Reply
williamwinner
New Contributor III

I just restarted ArcMap again and, this time, it's working.  

0 Kudos