|
POST
|
Tim, In looking at your script, and reading what you want to do - I think either its missing a part, or maybe thats just the part you need to add in. What I dont see is the points layer and the selection on it. Perhaps you're doing the selection within ArcMap, and the tool you're running is against the layer inside ArcMap, thus the selection is honored? (yes no?) If thats the case you'll probably want to add another input to your script - a feature set (assuming you want your end user to draw an area of interest to select features). Otherwise a textbox to pass an expression in for the Select Layer by Attributes Some untested code (as written directly in this forum textbox)
originalPointsFC = r'c:\data\myPoints.shp'
SelectionSet = arcpy.GetParameterAsText(0)
arcpy.MakeFeatureLayer(originalPointsFC, inputLayer)
selectedLayer = arcpy.SelectLayerByLocation(inputLayer, SelectionSet, "NEW_Selection")
#Your code
Output_ASCII_File_Name = arcpy.GetParameterAsText(1)
Output_ASCII_File = OutputDirectory + Output_ASCII_File_Name + ".txt"
Add_Field_Names_to_Output = "ADD_FIELD_NAMES"
arcpy.ExportXYv_stats (selectedLayer, Value_Field, Delimiter, Output_ASCII_File, Add_Field_Names_to_Output)
# and so on....
Then in flex when you call this service, you'd have 2 inputs to pass in: the feature set (to be used as a selection) and the output ASCII file name. Though, I'd make sure it works when using the Service in ArcMap before diving into the Flex application.
... View more
02-09-2011
01:54 PM
|
0
|
0
|
631
|
|
POST
|
You can't save the model as a lower version, but you can save the toolbox the model lives in to a lower version On the toolbox, right-click > save-as > Take a look at the list here to see what you may lose (as new functionality is removed when saving down to ensure compatibility) http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//003q00000007000000.htm
... View more
02-04-2011
07:32 AM
|
0
|
0
|
1621
|
|
POST
|
Jeff, I'm assuming you're on 10. Check the toolbox I've attached. You dont need to script this. You'll see its just a copy features and a Calc Value. The Calc value has a python snippet to calc the date. The output of this is "outDate" I've then used the inline variable %outDate% as the name of the featureclass. I grabbed the snippet from: http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#/Calculate_Field_examples/00170000004s000000/ Depending on how you write out time.strftime("%d/%m/%Y") (d/MM/yyyy etc etc), you can get different dates. Also remember the featureclass name cant start with a number.
... View more
02-04-2011
07:25 AM
|
4
|
0
|
10650
|
|
POST
|
Jeff, Actually, looking at the syntax of the AGSSOM utility, and then my syntax - it doesn't make sense. You would want to change it to 1 of 2 things. -Make a batch file and wrap any/all the AGSSOM.exe commands inside. Then just call the batch file -Or simply make the call to the AGSSOM.exe and add the arguments. (similar to how the batch file was called with an argument above) And yes, looking at the usage syntax, it looks like it supports "stop all" >> agssom.exe -x *all* As for generating the script from modelbuilder - you could do it in modelbuilder like you want with just the service stopping inside a script. You would just make a basic script tool (probably no parameters) and embed the script tool inside your model. (script tool being the stop/start python call). The script tool just becomes another element that the model works through. Thinking a little further (and I haven't tried this) - you might be able to do an advanced field calculation and within that have the python calls to restart the services via the agssom. Not sure if that would work, but it would be an interesting idea. (maybe I'm just over complicating it now). Hope this helps some
... View more
02-04-2011
07:15 AM
|
0
|
0
|
1904
|
|
POST
|
Thanks Kevin. If you need any information from me to test the first issue, let me know. When is 10 SP2 slated for release? Last I heard the general target is Q2. As it comes closer to completion there will be a more official date/announcement
... View more
02-03-2011
02:03 PM
|
0
|
0
|
713
|
|
POST
|
There is no modelbuilder way to do this. There is a utility on Arcscripts which you can use with a batch file to achieve this. http://arcscripts.esri.com/details.asp?dbid=16293 I've heard a lot of people have been successful with this. There might be other scripting alternatives, but nothing in "arcpy" to stop/start services. That said, you could write a script to: -call the batch file (stop services) os.system(r"C:\path\AGSSOM.bat " + str("stop MapService1")) -do an arcpy.WhateverToolYouNeed_to_do_the_update -call batch file again (start services)
... View more
02-03-2011
12:19 PM
|
0
|
0
|
1904
|
|
POST
|
I'm not entirely sure about the first render issue (I'd need to test it). However the 2nd issue (pop ups) is a planed fix for for 10 sp2. NIM061804 - KML Popups from Optimized MapServices do not open when selecting features in KML clients.
... View more
02-02-2011
01:56 PM
|
0
|
0
|
713
|
|
POST
|
Based on your information, your license level should be fine. I'm not sure which API you're using, but have a look at this link. It actually uses the Zonal tool inside to get a value. The code actually does the work of grabbing a single value from the results table to display it. http://help.arcgis.com/en/webapi/javascript/arcgis/help/jssamples/gp_zonalstats.html ..if you arent using JavaScript, I believe the other APIs make use of a similar example. Just look for "Population Zonal Stats" or "Population Summary"
... View more
02-01-2011
09:07 AM
|
0
|
0
|
1351
|
|
POST
|
Chris, I've searched the help and can't find where you reference that you should be able to import a featureclass into a recordset. However - I agree you should be able to do this. Like you said, you can do it in ModelBuilder from ArcMap. Also as a note, I dont think this is an arcpy issue, its probably been like this back since the time of import arcgisscripting (gp.RecordSet) I just logged the bug - Sorry I cant post the Nim as I'm heading on holidays and dont have time to wait for it to export 🙂 (it is in the system though) However, as a work around you should be able to do an arcpy.CopyRows(..... "in_memory\table") And then do your record set from that. It isn't great, but should keep you moving on your workflow.
... View more
12-17-2010
12:36 PM
|
0
|
0
|
949
|
|
POST
|
Actually I was just made aware that you can do this if you have the Data Interoperability extension. There is mention of it here around slide 18: http://proceedings.esri.com/dvd/uc/2010/uc-index/uc/workshops/tw_557.pdf Sorry, I couldn't find this presentation on the video channel. I'm not sure if it exists in video form.
... View more
12-06-2010
06:44 AM
|
0
|
0
|
2231
|
|
POST
|
This isn't currently something you can do with scripting. From what I understand you can control and work with attachments using ArcObjects. You could write something with native ArcObjects, or you could conceivably use Python and ArcObjects together to accomplish this. Attachments via Python/Arcpy is something we're looking at for the next release. However, at this time no promises, its just under consideration.
... View more
12-03-2010
11:01 AM
|
0
|
0
|
2231
|
|
POST
|
Mmmmm ... I wouldn't ever say ignore errors, but despite these, did both the GP and Map service start? Can you use them? If not - the error: The workspace is not connected. Cannot open a network table. seems the most questionable. Is ArcMap / Server on the same machine? If not are you copying everything over from one machine to another? It sounds like it cant find the network dataset. As for the error: The Layer:'Routes' in Map:'Layers' is invalid. The Layer:'Routes' in Map:'Layers' is invalid. You're probably getting this as you ran the model, dragged it over into the ToC, saved the doc and tried to publish. If you remove the result from the ToC when you first ran the model and try again - those errors should clear up. For this reason I dont think this part of the problem is much to worry about.
... View more
11-01-2010
07:06 AM
|
0
|
0
|
1688
|
|
POST
|
The image of your model looks correct - however I can't comment on the settings which make up the model. Your workflow is pretty similar to the following tutorial: http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#/GP_service_example_Shortest_route_on_a_street_network/002v0000001q000000/ If you haven't seen it, I'd suggest working through it to be sure everything is in line. If you still have a problem, please post the error you get when you execute the service (you'll have to turn messages on).
... View more
11-01-2010
06:27 AM
|
0
|
0
|
1688
|
|
POST
|
Barb, Dragging the tool into the ToC creates a tool layer. Tool layers are not supported with the fast map server (.msd based services). You can use the tool layer with a simple MXD (that is publish the MXD), but if you want to go the MSD route you'll have to remove the tool layer.
... View more
10-26-2010
11:28 AM
|
0
|
0
|
1103
|
|
POST
|
Rune, To the best of my knowledge, the list for SP1 is pretty set. This one wont make it into that. I've tagged it for SP2 - I can't make any promises between now and SP2, but in the very least it will be looked at.
... View more
09-23-2010
08:03 AM
|
0
|
0
|
1199
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 03-25-2026 08:25 AM | |
| 1 | 09-29-2025 05:19 AM | |
| 1 | 09-20-2023 06:37 AM | |
| 1 | 09-18-2025 07:07 AM | |
| 3 | 09-18-2025 06:52 AM |
| Online Status |
Offline
|
| Date Last Visited |
03-25-2026
08:04 AM
|