Thursday 18 May 2017

arcgis desktop - How to limit input of Python script parameter to polyline only when using Layer file?


When the parameter is feature class I can filter the input to polyline only. How to do this when the input is layer file at CURRENT MXD? I'm looking for something that will operate before the script starts running. I'm using Layer file so the user can choose the input from the data frame at the current MXD.




Answer



Try this:



  • Set the Data Type for your input feature to be Feature Layer. Then you can apply a Feature Class filter as shown in the image below.


enter image description here



  • If your mxd has polyline features, you will get a drop down list: enter image description here

  • if no polyline features present in mxd, you will get this: enter image description here



No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...