Tag Info

Hot answers tagged

4

Put a u in front of the string so the interpreter knows it's Unicode. myCalc(!Epulettipus!, u"Lakóépület")


3

I would use the "SHAPE@" token with the search cursor, then do something like this: with arcpy.da.SearchCursor(fc, ("SHAPE@", "UNIQUE_ID")) as searchCur: for row in searchCur: myDF.extent = row[0].extent myDF.scale = 50 arcpy.RefreshActiveView() arcpy.mapping.ExportToPDF(thisMap, ...


3

You don't 'Dim' variables in python, you just declare and assign them. That said, your basic route is to set the parser to python and check Show Codeblock. In the Pre-Logic Script Code box, enter your function like this: def DoThis(fld): val = 0 if fld <> 'a certain string': val = # do your calculation here return val In your ...


2

Yes - to do this I would: Use the extent of the polygon just digitized to Create [a] Fishnet of the same size Use SelectLayerByLocation on the fishnet just created to select those that overlap the polygon geometry that you digitized Use GetCount to count how many of the fishnet cells overlap with the polygon geometry Use an update cursor or CalculateField ...


1

You could reproduce the toolbox yourself pretty trivially: the parameters are described in that documentation and the source for zip.py and unzip.py are both online.


1

Instead of using PIPE in the subprocess.Popen, you can use a file path to save the output. You can create the path by using the arcpy.CreateScratchName() (http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#/CreateScratchName/000v0000001z000000/). After the subprocess runs and you have the output in the file, you might set the output parameter ...



Only top voted, non community-wiki answers of a minimum length are eligible