I've been working with ESRI Python toolboxes for a while but I'm still having difficulties setting an input parameter as a "DEWorkspace" and using the parameter filter to make it so only file geodatabases are visible to the end user when entering parameters.
I'm using 10.5 and this is the ESRI documentation
param0 = arcpy.Parameter( displayName="Input Workspace", name="in_workspace", datatype="DEWorkspace", parameterType="Required", direction="Input") # Set the filter to accept only local (personal or file) geodatabases param0.filter.list = ["Local Database"] params = [param0] return params
The problem I'm encountering is that this filter doesn't seem to actually limit what the end user can see or enter as parameter. For example when they navigate to provide a file geodatabse the dialog allows them to see and enter .lyr files.
I'm assuming that you should be able to limit what the end user can see and enter when it comes to workspaces?