|
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
|
9828
|
|
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
|
1393
|
|
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
|
559
|
|
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
|
1393
|
|
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
|
559
|
|
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
|
950
|
|
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
|
648
|
|
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
|
1572
|
|
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
|
1572
|
|
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
|
949
|
|
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
|
949
|
|
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
|
837
|
|
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
|
646
|
|
POST
|
My apologies, this has been logged as a defect; NIM058666 - saveACopy method fails when saving to the previous version. At this time I'm unaware of any work arounds to saving an older version
... View more
09-22-2010
08:05 AM
|
0
|
0
|
646
|
|
POST
|
The help topic is here: http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#/Result/000v000000n7000000/ Sample code: import arcpy
inTable = arcpy.GetParameterAsText(0)
result = arcpy.GetCount_management(inTable)
print result.getOutput(0)
... View more
09-21-2010
11:30 AM
|
0
|
0
|
3184
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 09-20-2023 06:37 AM | |
| 1 | 09-18-2025 07:07 AM | |
| 2 | 09-18-2025 06:52 AM | |
| 1 | 03-23-2023 12:07 PM | |
| 1 | 10-21-2024 12:40 PM |
| Online Status |
Offline
|
| Date Last Visited |
09-30-2025
06:25 AM
|