POST
|
Wow I know that this topic was written a long time ago - but I am looking for a solution to the exact same thing. I have a blank mxd saved on my network and I add a bunch of layers to it. I really want to simply open that document once the layers have been added and "see" them in the TOC. arcpy.mapping does not ever seem to refresh the TOC (even using arcpy.RefreshTOC()) unless I save the mxd arcpy.mapping.MapDocument.saveACopy() and open the new one. What I want is to dump all of the layers into a 'read-only' MXD open the mxd, and BAM! there are my layers. and then it is up to the user to decide if they want to save it or not. I've tried accomplishing this with os.startfile(). But the os module doesn't seem to wait for the arcpy objects etc to do their thing before opening the MXD. Even if the MXD is open and I load the layers I can't "see" them unless I save. It's absolutely bogus! Any solutions? Chris
... View more
07-20-2012
09:25 AM
|
0
|
0
|
74
|
POST
|
Thanks for the quick response Jason. As you can probably tell it was the end of the day when I wrote my problem so maybe I can clarify a bit. I am not interested in adding an output parameter to my script tool. For my purposes the script tool is a super simple GUI that will only ask the user for a few inputs. I have hard coded the names and locations of all of the outputs so I know where everything will end up. I would like to try os.startfile (maybe i'll give it a shot this morning). All that I am trying to accomplish is dumping the results of the script (5 rasters) into a blank MXD so that the user can take a look at the outputs and save the MXD if he or she chooses. They likely will not have and MXD open (which is why i was hoping to avoid using arcpy.mapping...) and will be running the script tool from catalog. Thanks for your help though! Chris
... View more
07-20-2012
08:02 AM
|
0
|
0
|
3
|
POST
|
Hi All! I have a few questions regarding the arcpy.mapping module that hopefully some of you can shed some light on. I am currently working on a project for a fairly complicated raster processes for some non-GIS type people. As such I burried the script in a script tool to make it user friendly. Some have asked that once the process is complete - I output the resulting raster dataset into an ArcMap Document (MXD). It seems like this can be done using the mapping module, but alas issues keep coming up. 1. Do I have to have an MXD created before I can dump the outputs into it? I would love to open ArcMap using something like: subprocess.Popen([arcmap]) where arcmap is the path to the .exe. But then when I try refering to the document as: arcpy.mapping.MapDocument("CURRENT") it doesn't seem to recognize the document. 2. If I have to create a default MXD I will. but I would like to see the raster I add to the TOC without saving the document (it will be read only). Instead I have to use: mxd.saveACopy(mxdoutput) to see the rasters in the TOC, and I would rather the users just decide where they want to save the map to. 3. Is there any way to open a closed MXD using arcpy.mapping? 4. If i can't open a closed MXD and have to use subprocess.Popen to open ArcMap. I think I have to use Popen.wait to keep the process from killing itself. Is there anyway to set up some checks so that the script with stop waiting? Chris
... View more
07-19-2012
02:58 PM
|
0
|
4
|
725
|
POST
|
Hi Everyone. I'm fairly new to python/ArcGIS script tools, so I was hoping I could find an easy/ straightforward example... I need the user of tool to select an input parameter in a script tool from Dropdown List populated with 5 or 6 default string values. I'm sure this is a very simple task, but I can't seem to find any straight forward examples online or in esri help that are this simple. http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//00150000000t000000.htm I know that this has to be set in the tool Properties > Validation > Edit the Validation Script. Anybody have any insight on how I should write the function so that I get a very simple list of strings to choose from? Thanks! Chris
... View more
07-09-2012
08:55 AM
|
0
|
1
|
393
|
POST
|
Thanks for the reply Luke! I eventually came to something of the same conclusion. Appreciate the reply though! Chris
... View more
11-24-2011
03:42 PM
|
0
|
0
|
5
|
POST
|
Hi Everyone, My problem is fundamentally simple but I am having a lot of trouble with it... I have attached a "word" document with images describing my problem. I would really appreciate any input or suggestions. Thanks for your time Chris
... View more
11-21-2011
07:31 AM
|
0
|
2
|
218
|
POST
|
Thanks William, so far this seems like the most appropriate solution for my project. Much appreciated. Chris
... View more
02-21-2011
11:08 AM
|
0
|
0
|
5
|
POST
|
The buffer width does not depend on slope; I have a series of polygons (Lakes) each one is classified as L1 to L4. L1 requires a buffer width of 10 meters while L2 - 3 requires a buffer width of 30 meters and L4 is 40 meters. The buffer width is non euclidean, it is slope distance. Because the slope varies so much around each of these lake polygons, the width with vary (in terms of euclidean distance) but will be a consistent distance in terms of hypotenuse. Thanks for the quick response, And again, sorry if i missed a similar thread. Chris
... View more
02-19-2011
06:34 AM
|
0
|
0
|
5
|
POST
|
Hi everyone, I'm sorry for the extremely convoluted title, but I thought it would be best to try and describe my issue with a one off. I am new to ESRI forums, as I usually find what I need by browsing, but while I have seen similar problems to mine, I have not seen a solution that will work for my specific issue. If I have posted this in the wrong section, please feel free to let me know. The problem is as follows: I have a series of polygon (for arguments sake lets call them LAKES), and I need to generate a buffer around these polygons. Unfortunately, the euclidean distance does not meet the buffer requirements for this specific application - the buffer must be based on slope distance and thus will vary in width as -for example 10 meters on a steep slope has a much shorter euclidean distance than 10 meters on a gentle slope. I have a DEM with 25m cell size that covers the same area as the polygons. What I am wondering is - if i generate the slope from the DEM, would there be an appropriate way to use it to generate the the buffer distance around the polygon feature classes. Any help is greatly appreciated, and if there is confusion over the problem I would be happy to clarify. Thanks Chris
... View more
02-18-2011
01:19 PM
|
0
|
2
|
2399
|
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:23 AM
|