New answers tagged tools
Samy, I use sys.argv[n] but GetParameterAsText is the same thing, but be aware that argv is the script, argv is the first parameter as opposed to GetParameterAsText(0) being the first parameter. On each iteration (after the clip) you need to clear the selection or remake the layers "lyr" and "pochoirlyr" otherwise it will only work on the first ...
Unfortunately I do not have a 50 reputation yet to comment on posts so I had to post this here. category="" <-- will place your command or tool under the Misc. category under Customize>Commands. I do not know how to fully hide a custom tool like you are wanting to do.
Have a look on the documentation here : http://docs.qgis.org/2.6/en/docs/user_manual/print_composer/print_composer.html#atlas-generation and the example in http://nathanw.net/2014/09/23/qgis-atlas-on-non-geometry-tables/
You need to use the arcpy.GetParameterAsText(0) method: See examples from: Understanding script tool parameters
Change the updateParameters as follows: def updateParameters(self, parameters): """Modify the values and properties of parameters before internal validation is performed. This method is called whenever a parameter has been changed.""" if parameters.value: if not parameters.altered: fields = [f for f in ...
You can do this using 2 os.path functions (splitext and basename): import os os.path.splitext(os.path.basename(r'C:\user\shapefiles\polygon.shp')) # returns 'polygon'
Top 50 recent answers are included