|
POST
|
In addition to "Script" tools, you'll hurt the Calculate Field tool when using Python expressions, as well as any layer properties which use Python. For example you can define label expressions with the Python parser. Yeah, both of these examples make use of VBScript as the default parser, but removing Python would break that functionality should someone choose it. My vote is with the masses above : dont remove it. And if you do, make sure thats the very first thing you tell tech support if you call in looking for help on anything. It would be a shame to spend a week on something only to find out that it was related to the Python removal.
... View more
10-11-2012
07:16 AM
|
0
|
0
|
1749
|
|
POST
|
Ok.... I couldnt find a windows installer for this package...I did find this though: http://www.lfd.uci.edu/~gohlke/pythonlibs/ I installed both of these (32 and 64bit versions.... the installer finds my the proper python and puts them in there) Base-12.9.15.win-amd64-py2.7.*exe Base-12.9.15.win32-py2.7.*exe I then took your tool you provided above, created a PYT and ran it on Desktop. (I had to make an "output" folder in the same directory as the PYT) No problems. I then published it to Server, no problems. I then executed the service, no problems. My best guess of what you're doing - you've installed the package differently? It doesnt look like theres a real installer for it. I'm not sure I can offer any advice on getting this particular package installed short of the way I did it. Why is it taking 30+ minutes to publish? My guess - you have a LOT of files inside that output folder. Gigabytes and gigabytes. As per the publishing rules, if you reference a folder, we take the contents of that folder because we assume it contains required inputs. The folder I made was brand new and had nothing in it. Could you clean the folder or point to an empty one and try again? Also - in your tool it looks like you're trying to handle unique output names for your excel file. Any particular reason why? If not, I'd suggest letting server do it for you by creating the file in the scratch directories. The way you have it right now, you're setting the scratchWorkspace in the script. You can't do this in a GP Service. The framework handles the scratchworkspace, thus you should just inherit from it. Your tool on Desktop can work the same way - let ArcMap set the scracthWorkspace and have the tool inherit from it. import arcpy import os, sys import datetime, time import openpyxl class Toolbox(object): def __init__(self): """Define the toolbox (the name of the toolbox is the name of the .pyt file).""" self.label = "Toolbox" self.alias = "" # List of tool classes associated with this toolbox self.tools = [Tool] class Tool(object): def __init__(self): """Define the tool (tool name is the name of the class).""" self.label = "Tool" self.description = "" self.canRunInBackground = False def getParameterInfo(self): """Define parameter definitions""" selectOwners = arcpy.Parameter( displayName = 'This is test 1', name = 'owner_selected', datatype = 'Boolean', parameterType = 'Optional', direction = 'Input') selectResidents = arcpy.Parameter( displayName = 'This is test 2', name = 'residents_selected', datatype = 'Boolean', parameterType = 'Optional', direction = 'Input') params = [selectOwners, selectResidents] return params def isLicensed(self): """Set whether tool is licensed to execute.""" return True def updateParameters(self, parameters): """Modify the values and properties of parameters before internal validation is performed. This method is called whenever a parameter has been changed.""" return def updateMessages(self, parameters): """Modify the messages created by internal validation for each tool parameter. This method is called after internal validation.""" return def execute(self, parameters, messages): """The source code of the tool.""" wb = openpyxl.Workbook() filename = os.path.join(arcpy.env.scratchFolder, "myExcel.xlsx") arcpy.AddMessage('Filename : {}'.format(filename)) wb.save(filename)
... View more
10-09-2012
01:06 PM
|
0
|
0
|
5028
|
|
POST
|
Yes, Tabulate Intersection requires Advanced Desktop, this requires Advanced Server. At 10.1 Basic and Standard tools can run under a Standard Server License. Advanced Tools require an Advanced Server license.
... View more
10-08-2012
08:18 AM
|
0
|
0
|
575
|
|
POST
|
Based on all your information, at this point it sounds like you have everything setup correctly for Python. All of the returns you've printed make sense based on where you've called them from. So at this point, you can run your toolbox locally, and publish it. You just cant consume it as a GP Service? What do you mean by: But when I then share the result as a Service, it never finishes, it keeps on running at 175kb. If you navigate to: C:\arcgisserver\directories\arcgissystem\arcgisinput\<your service>.GPServer\extracted\v101\<folder original .pyt lived in>\ You'll find your toolbox that ArcGIS Server uses. Can you consume this in ArcMap?
... View more
10-08-2012
07:34 AM
|
0
|
0
|
5028
|
|
POST
|
No - they're separate. < 10.1 ONLY information > ArcMap is 32bit and uses 32bit Python ArcGIS Server is 64bit and uses 64bit Python If both products are installed on a single machine, you have 32bit and 64bit Python. (if you let the installer do it). If you're managing your OWN python installs, then you need to install both the appropriate Python (32 or 64) as well as Numpy and Matplotlib (again, 32 or 64 or BOTH depending on what Arc* products you have installed). Before publishing a GP Service, ArcMap uses the 32bit Python to execute your tool. Consuming a GP Service, Server is using the 64bit Python to execute the tool. This is why you need both the 32 and 64bit versions of the 3rd party module installed when everything is on one machine. If you have both products installed and are using Python from command line (you open prompt and simply typed "python.exe"), then you could be using either 32 or 64bit. You need to be aware of which one you're executing against. Typically (bot not always) you're executing against the last Python version you installed. The best way to be sure is to launch the Python you want by explicitly referencing it: C:\Python27\ArcGIS10.1\python.exe or C:\Python27\ArcGISx6410.1\python.exe I hope this clears up the differing "bits"
... View more
10-05-2012
12:12 PM
|
0
|
0
|
5028
|
|
POST
|
I see you cross posted this in another forum and got some suggestions. The main one I'd confirm is having the 64bit Python module installed on your server machine. With that installed, can you start 64bit Python on that machine and access your tool that way? The answer to this will show if its a 3rd party module/tool issue, or an issue specific to the service.
C:\Python27\ArcGISx6410.1\python.exe
import arcpy
arcpy.ImportToolbox(r"<path to .pyt">
arcpy.<toolname>(params)
There might be some information in this help topic of use to you: http://resources.arcgis.com/en/help/main/10.1/#/Authoring_geoprocessing_tasks_with_Python_scripts/00570000007r000000/
... View more
10-05-2012
08:01 AM
|
0
|
0
|
5028
|
|
POST
|
Dear Guys, in ArcGIS 10 is a new tool (ArcToolbox/ConversionTools/FromGPS) called GPX to Feature... but it only converts the data into pointfeature... The tool help explains how you can create lines from your TRKPTs. http://resources.arcgis.com/en/help/main/10.1/index.html#//001200000050000000
... View more
10-04-2012
10:58 AM
|
0
|
0
|
1144
|
|
POST
|
You're close. Try this: arcpy.ImportToolbox("http://na-lap-3z8/ArcGIS_server/services;Toolboxes_Lesson1","abc") Also see this for more info: http://resources.arcgis.com/en/help/main/10.1/index.html#/Using_a_geoprocessing_service_in_Python_scripts/00570000004w000000/
... View more
10-03-2012
11:18 AM
|
0
|
0
|
820
|
|
POST
|
I guess I dont completely understand how it works on Desktop and what the return types are there. From the code snippet I assumed it didnt return anything in Desktop as there wasnt any outputs. I just read the help on this tool... it sounds like the tool, by default provides "results" in a couple ways: The Reviewer batch job results are written to the specified session (indicated by Session) in the Reviewer Workspace. A summary of the batch job is displayed in the Results window. The output parameter for this tool is a table view of one row of the REVBATCHRUNTABLE table in the Reviewer Workspace. The row represents the record created when the batch job is executed. Perhaps when this tool is run in your script on desktop, the output table is simply returned. With a GP Service you have to setup the output parameter specifically for this table to be returned. Looking at its Python usage: # execute the batch job
res = arcpy.ExecuteReviewerBatchJob_Reviewer(rev_workspace,session,batch_job_file,prod_workspace)
# get the output table view from the result object
tbl = res.getOutput(0) You'll have to set that "tbl" as your output table and pass that back. Again, assuming its that table you want.
... View more
10-02-2012
08:36 AM
|
0
|
0
|
2359
|
|
POST
|
Sure. Find attached. This piece will find its way into this document: http://resources.arcgis.com/en/help/main/10.1/index.html#//00s200000009000000 Right after the first large table, and before the "Maps" section. Let me know if you still have questions after having a read.
... View more
10-02-2012
08:30 AM
|
0
|
0
|
2139
|
|
POST
|
Ok that clears it up, thanks. Right now your tool has no outputs, so you could return pass/fail by simply having the tool "fail" with an AddError. That probably isn't the best approach. If you want an actual return type, you can add a new output parameter of Boolean and set it as True or False to say its passed or failed. Or do you want just a simple string (AddMessage) to say whether or not the records exist (based on your logic). With any of the Message approaches you'll have to make sure you turn Messages on the Service to the appropriate setting (Info|Warning|Error). Ultimately it comes down to your workflow - how do you want to tell the service user about the records? Using a message, using a return parameter or having the service simply succeed or fail.
... View more
10-02-2012
08:21 AM
|
0
|
0
|
2359
|
|
POST
|
Right - folder isn't a supported return type. Its probably been mapped to "string", so your service isn't returning anything. Or do I have it wrong - are you actual output types FEATURE (class/layer/etc)? Can you post your code from def getParameterInfo(self):
... View more
10-02-2012
07:57 AM
|
0
|
0
|
2359
|
|
POST
|
I havent personally used the Batch Reviewer tool as a GP Service, but the first two tools shouldnt have any issues. As a quick test to be sure that isn't the issue, can you change the output to just a feature layer from the Select tool and publish this? Do you get back the selected features from the service? Depending on this test result it'll give you an idea if its a Py-Toolbox/data issue, or specific to the Reviewer tool.
... View more
10-02-2012
07:44 AM
|
0
|
0
|
2359
|
|
POST
|
Are you using 10 or 10.1? At 10.0 its mostly "what you see is what you get" coming from ArcMap/ArcGlobe using the Layer to KML tool. At 10.1 you have more options, what you see, or you can have fine control over feature creation on a per feature basis using field attributes. If you're using 10.1, I have the doc updated internally to explain how to use the field attributes (its making its way through the copy edit process). Hopefully it'll get pushed to the web in the next couple weeks. If you want it before then, I'll cut out the appropriate pieces and post here. Just let me know.
... View more
10-02-2012
07:33 AM
|
0
|
0
|
2139
|
|
POST
|
Unless I'm missing something obvious**, I think the way you'd go about this is with a geoprocessing package. The Runtime supports Network Analysts tools which you can use to create a model and turn that into a geoprocessing package. You then consume that package in your application. This sample here explains making a service, but you can follow these steps to make your own model and just make a runtime enabled geoprocessing package instead of the service. http://resources.arcgis.com/en/help/main/10.1/#/Shortest_Route/00570000009q000000/ *disclaimer: I'm on the geoprocessing team, not the runtime team. However I've built geoprocessing packages and consumed them in the runtime. A pretty straight forward process. I'd just use the "Contour" in the Geoprocessing > Spatial Analysis samples as a starting point if you go this route.
... View more
09-28-2012
02:17 PM
|
0
|
0
|
1438
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 03-25-2026 08:25 AM | |
| 1 | 09-29-2025 05:19 AM | |
| 2 | 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
|