Timeline for Filter the Feature Layer parameter in Python Script Tool
Current License: CC BY-SA 3.0
6 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Mar 18, 2016 at 11:56 | comment | added | Alex Tereshenkov | Please ask a new question about that | |
Mar 18, 2016 at 10:34 | comment | added | Panos | I implemented it like this: mxd = arcpy.mapping.MapDocument("CURRENT") lyrs = [lyr for lyr in arcpy.mapping.ListLayers(mxd) if lyr.supports("DATASOURCE") and lyr.dataSource[-4:] == ".shp" and arcpy.Describe(lyr.dataSource).shapeType == "Polygon"] self.params[1].filter.list = [lyr.longName for lyr in lyrs] but the result is not what I want. The String hides the icon on the right of the parameter, so the user can choose sth outside the mxd. Is there a way to get the Feature Layer list in ToolValidator, filter it and put it back? | |
Mar 18, 2016 at 9:30 | comment | added | Panos | Thanks. I will implement it and let you know if it works as I am expecting. :-) | |
Mar 5, 2016 at 9:22 | history | edited | PolyGeo♦ | CC BY-SA 3.0 |
Formatting
|
Mar 4, 2016 at 22:22 | history | edited | PolyGeo♦ | CC BY-SA 3.0 |
Formatting
|
Mar 4, 2016 at 20:29 | history | answered | Alex Tereshenkov | CC BY-SA 3.0 |