|
POST
|
No unfortunately, my independent forays into integrating tkinter and script tools also failed, so I rummaged around and found that example which works by integrating the widget into a frame tied to the script tool itself, or so it seems. Whoever wrote it is far more knowledgeable in tkinter than I. When I tried implementing tkinter myself first I would use the standard script function implementation, which doesn't seem to work.
class MyApp(object):
def __init__(self, root):
self.root = root
[...]
def main():
root = Tk()
myapp = MyApp(root)
root.title("Export Tool")
root.update()
root.mainloop()
if __name__ == '__main__':
main()
Implementing the widget in this manner seems to be the silver bullet, tying the widget to the application under the __init__ and then calling your widget creation and geoprocessing under those new sub-functions seems to be the way to go.
class Application(Frame):
def __init__(self, master=None):
Frame.__init__(self, master)
self.grid()
self.createWidgets(master)
def createWidgets(self, master):
[...]
root = Tk()
app = Application(master=root)
app.master.title(Title)
app.mainloop()
... View more
05-23-2012
09:07 AM
|
0
|
0
|
5789
|
|
POST
|
Usually in the log there is a list of messages, not just the error code.
... View more
05-23-2012
05:45 AM
|
0
|
0
|
727
|
|
POST
|
Spaces in path names are not supported either for some functions.
... View more
05-23-2012
05:26 AM
|
0
|
0
|
5979
|
|
POST
|
You can pass the attribute of your where clause as a variable and inject that into the filename. Something along these lines. attributeList = [1,2,3,4]
queryField = "FIELD_NAME"
for attribute in attributeList:
where = "{0} = {1}".format(queryField,attribute)
arcpy.Buffer_analysis(input,output+attribute,buffer_dist)
... View more
05-23-2012
05:22 AM
|
0
|
0
|
888
|
|
POST
|
You should remove any spaces from your shapefile names.
... View more
05-23-2012
05:14 AM
|
0
|
0
|
5979
|
|
POST
|
The example I posted works in ArcMap as a script tool. I just used it yesterday.
... View more
05-23-2012
05:10 AM
|
0
|
0
|
5789
|
|
POST
|
Are you trying to add a downloaded or custom toolbox to your "My Toolboxes" folder? If so, in ArcCatalog, you can navigate to where you downloaded them, copy the toolbox, and paste them to your "My Toolboxes" folder. Also, I am not sure what you mean by the "toolbox window". From what you are describing it sounds like you are trying to add toolboxes to the system toolboxes, which you cannot do. You must create your own toolbox somewhere on disk and reference that.
... View more
05-22-2012
12:37 PM
|
0
|
0
|
753
|
|
POST
|
You can see this example to get started on integrating ArcMap and Tkinter in scripting tools. http://resources.arcgis.com/gallery/file/Geoprocessing-Model-and-Script-Tool-Gallery/details?entryID=F0B54854-1422-2418-A0F6-37042FE94472
... View more
05-22-2012
11:36 AM
|
0
|
0
|
5789
|
|
POST
|
You need to put your var_text in quotes so it knows it is a string, otherwise it is trying to write unicode or something funky. var_text = "0176"
... View more
05-16-2012
10:57 AM
|
0
|
0
|
1527
|
|
POST
|
Try posting your entire code. All I see it doing is print this line for every iteration of your loop print "Processing:" + arcpy.env.workspace + "\\" + Polyline + "To:" + fileout
... View more
05-16-2012
10:16 AM
|
0
|
0
|
3270
|
|
POST
|
Pretty much all GP tools can cause a memory leak if run enough times in a single script. This is due mostly to the geoprocessing history logging I believe, and I could be mistaken, but I recall coming across that explanation at some point. The only work around I've found to this is to call your highly repetitive tools in functions in external scripts that can be imported, processed and unloaded for each iteration. I've only had to do this once, when doing various checks and analysis and then projecting an entire database to multiple different coordinate systems, but that was how I got it to work. An alternative could be to simply turn off logging, but for some reason that didn't work for me.
... View more
05-16-2012
10:13 AM
|
0
|
0
|
698
|
|
POST
|
You have a couple problems. 1) Coverage names cannot be over 13 characters. 2) the infile parameter does not reference workspaces, it must be a full path Read this for more information. http://support.esri.com/en/knowledgebase/techarticles/detail/21052
... View more
05-16-2012
10:02 AM
|
0
|
0
|
971
|
|
POST
|
That is not was AddMessage was designed to do, so not currently no. See here under "Messaging in a dual-purpose script" http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#/Writing_messages_in_script_tools/00150000000p000000/
... View more
05-16-2012
09:43 AM
|
0
|
0
|
3278
|
|
POST
|
I do not believe arcpy has access to graphics in ArcGIS 10. ArcObjects could do this for you.
... View more
05-16-2012
08:14 AM
|
0
|
0
|
1106
|
|
POST
|
If you want performance it would be fastest I would imagine to check the XY extent of your dataframe against the XY position of your point to see if it is greater than your max X and Y extents, or lesser than your min X and Y extents.
... View more
05-16-2012
08:01 AM
|
0
|
0
|
1508
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 05-17-2011 10:36 AM | |
| 1 | 08-16-2012 10:48 AM | |
| 1 | 10-31-2012 08:39 AM | |
| 1 | 07-16-2012 01:52 PM | |
| 1 | 03-15-2012 10:57 AM |
| Online Status |
Offline
|
| Date Last Visited |
08-22-2024
11:12 PM
|