POST
|
OK, here is the whole shebang. For ArcGIS I am making a GUI to do importing of layers. The code uses ttk.Entry Widgets My program (Monty.py that is attached) uses Entry Widget to display the pathname to files (using tkFileDialog.askopenfilename) But the Entry requires a textvariable being equal to a StringVar() and I cannot get the pathname I picked up to load the name.) The black part of the JPG above is it printing what was displayed in the Entry box, but when it transferred the string to the StringVar for each of then it printed '<bound method StringVar.get of <Tkinter.StringVar instance...>> The GeoScrip01 window is created by Monty.py for input of the two pathnames via two buttons, plus a Clear button, Submit Job button, and Quit. It won't give me 'C:/Users/phacker/Documents/ArcGIS/FAKEINPUT/counties.txt' I need that pathname (and others) to load GIS information later in the program. Thanks, Paul
... View more
07-28-2016
02:25 PM
|
0
|
0
|
622
|
POST
|
I am using the Entry Widget. In it I have: global HoldString HoldString = StringVar() HoldString.set("") Later I want the HoldString to have the value of a string that was made earlier like: abc = "asdadad" Trying HoldString.set(abc) just gives me a cryptic PY_VAR0 when I try to print the value of HoldString It seems I can only set it to a literal like HoldString("asdadad") Is there anyway move the value of a string to a StringVar? Thanks!
... View more
07-28-2016
09:49 AM
|
0
|
2
|
1856
|
POST
|
I want to open a popup to a folder list of files and when I click on one file it gives back the full pathname to that file. I can do this in tkinter (3.0) and I know about the Widgets for tkFileDialog in 2.7 but there seems to be none for just giving me the whole pathname (so I can run a stand-alone ArcGIS program that ask for a specific input file) using Tkinter (I use 2.7 not 3.0 Python.) Thanks.
... View more
07-26-2016
09:23 AM
|
0
|
0
|
437
|
POST
|
Well I looked, we have no license for background geoprocessing. But can a Python script that was assembled and put into a regular .py file be submitted for nightly run somehow? Thanks.
... View more
07-12-2016
06:20 AM
|
0
|
1
|
1350
|
POST
|
Looking into it. Thanks Shaun. It looks real interesting!
... View more
07-11-2016
02:14 PM
|
0
|
0
|
1350
|
POST
|
I had a similar setup but I was hoping it would NOT 'wait'... and thus show ArcGIS as being busy. Even taking the proc.wait out does not help. Looking for a true background method to allow users to keep using ArcMAP. Thanks.
... View more
07-11-2016
07:54 AM
|
0
|
1
|
1350
|
POST
|
Well this works. If you make the degree symbol in a text file, say "degreetest.txt" and read it in it displays it fine. import sys, os # Open the input file * try: intemplate = open("C:/data/degreetest.txt", "r") except IOError: print "screwup1" # Read line. try: x = intemplate.readline() except IOError: print "screwup2" print x intemplate.close() sys.exit("Finto") also..... Try this: import unicodedata b = unicodedata.lookup('DEGREE SIGN') print b and that will get your degree sign. So you can generate it in the script for use. Paul
... View more
07-08-2016
08:12 AM
|
0
|
1
|
2650
|
POST
|
I run a batch at the end of the .pyt Python Toolbox script so to do most of the process (it runs a .bat file that runs a python script.) Yes a Python script runs a bat runs a Python script. But when using subprocess.Popen("C:/output/BatchRun.bat", shell=False) The command prompt window opens and I guess stays open till the bat is finished. The .pyt goes ahead and ends. How to get rid of the command prompt window from opening? Thanks!
... View more
07-08-2016
07:27 AM
|
0
|
9
|
3585
|
POST
|
Ok I got it to work. What I did was: Make the tool create a batch .bat file with the command to run the python 2.7 and the python script to do all the processing. Then the tool gets all the parameters via the def getParameterInfo, and uses a python template program minus the parameters. As it creates a new temporary python script it adds the parameters to the script. Then using subprocess.call (one uses 'import subprocess' to get access to it) run the bat file with the new temporary python script. It created everything I desired. So the ArcMap we have does not have the advanced license but the python 2.7 under ArcGIS does! Thanks, Paul
... View more
07-07-2016
12:21 PM
|
1
|
0
|
470
|
POST
|
Ok, I find we don't have the advanced licenses and thus running it strait by python tools won't do. So, since it works perfectly outside using python IDLE how does one set the parameters in the tools and then 'batch' it to run? That is using the same pyt script I have in the toolbox to input all the parameters and then send them to a batch .py script to run with IDLE? Thanks, Paul
... View more
07-06-2016
06:38 AM
|
0
|
1
|
470
|
POST
|
I am copying GDB extensions from XML templates. I am making a Python Toolbox from a Python script that runs perfectly if I run it alone using Python IDLE. Now when running the tool it works fine except for the last, where I import the XML to overlay the GDB I created. I get the error: Traceback (most recent call last): File "<string>", line 282, in execute File "c:\program files (x86)\arcgis\desktop10.4\arcpy\arcpy\management.py", line 1196, in ImportXMLWorkspaceDocument raise e ExecuteError: Failed to execute. Parameters are not valid. ERROR 000824: The tool is not licensed. Failed to execute (ImportXMLWorkspaceDocument). I suspect I do not have a license for the ImportXMLWorkspaceDocument. I understand I can check with 'arcpy.CheckExtension' and if there is one I can use 'arcpy.CheckOutExtension' and 'arcpy.CheckInExtension' But what group is ImportXMLWorkspaceDocument part of? Is it 'Spatial'? 'Datareviewer'? or what? I have the list but don't know what part ImportXMLWorkspaceDocument belongs to. Thanks.
... View more
06-29-2016
07:24 AM
|
0
|
4
|
2642
|
POST
|
So if I use the messagebox it will halt the code till one presses 'continue' button and then it will keep running? Can a 'cancel' be added so it stops processing.. ah.. looks like OK/Cancel is '1' and 3 is 'yes/no/cancel'. So I guess it does halt the code! Yes I bet this will do just what I want. Today is experiment day. Thanks! Have a good 4th of July guys.
... View more
06-28-2016
06:45 AM
|
1
|
2
|
607
|
POST
|
Looks like I'll do that. The three steps become three tools on ONE Toolbox. At the end of each a message that will tell the user the step completed with or without errors and point to the next tool. Or... I could make a VisualStudio with Python or C# (but that would take quite a rewrite.) Thanks.
... View more
06-27-2016
12:24 PM
|
0
|
0
|
607
|
POST
|
I constructed a Python Toolbox that has many steps. When one first runs it a window comes up and for the layers and folders and shapes, the boxes for the information show up well. BUT, for each stage of the run I want it to display results and ask if one wants to continue. Tkinter does NOT work for this (tried and tried.) And the arcpy.AddMessage does not seem to be suitable as it's a message and not being able to handle input like (Y/N) to continue. I would like the original box to say visible and the messages show up on the bottom. Is this possible with ArcMAP/ArcGIS? Thanks.
... View more
06-27-2016
11:45 AM
|
0
|
8
|
3400
|
Title | Kudos | Posted |
---|---|---|
1 | 06-28-2016 06:45 AM | |
1 | 07-07-2016 12:21 PM |
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:25 AM
|