|
POST
|
In .Net or C++? 1. Yes. Either using a system call to a .py file, or more easily, setting up the .py file as a script tool and executing it through the Geoprocessing framework. You can also open the geoprocessing tool dialog with the GPToolCommandHelper class. 2. I'd recommend 2008, though 2010 should be OK for .Net development. 3. Not off the top of my head.
... View more
06-30-2011
11:31 AM
|
0
|
0
|
514
|
|
POST
|
Correct, many objects in arcpy/arcgisscripting are not pickleable, so sending them directly across the wire in multiprocessing will not work. There are workarounds, however. If you are sending rows around, you can use tuples with the column values you need, and if you are using geometries you can use the __geo_interface__ attribute to send and the AsShape function to convert back to the geometry object in your function.
... View more
06-30-2011
07:40 AM
|
0
|
0
|
4159
|
|
POST
|
You'll need to run your script out of process (there's a checkbox in the script tool settings dialog) to get it to work. ArcMap sets up a runtime environment that may not be compatible with the way that multiprocessing bootstraps its runtime.
... View more
06-28-2011
12:36 PM
|
0
|
0
|
4159
|
|
POST
|
Yes. If you import the toolbox using ImportToolbox and call the model you will get iteration.
... View more
06-28-2011
12:12 PM
|
0
|
0
|
1425
|
|
POST
|
You can use subprocess. import subprocess subprocess.call(['rplrunner.exe', r'c:\path\to\my.rpl'])
... View more
06-23-2011
09:16 AM
|
0
|
0
|
2105
|
|
POST
|
Replace each \\n with \n in the code. I believe this was fixed in 10.0.
... View more
06-23-2011
06:52 AM
|
0
|
0
|
391
|
|
POST
|
As comtypes is not an officially supported library in ArcGIS, there is no released API for converting to/from arcpy objects and comtypes.
... View more
06-23-2011
06:51 AM
|
0
|
0
|
785
|
|
POST
|
Yes, by using UpdateLayer in arcpy.mapping with the symbology_only argument set to True.
... View more
06-19-2011
09:34 AM
|
0
|
0
|
844
|
|
POST
|
This video gives some hints on Python Add-Ins, which will give access to a set of common document events.
... View more
06-17-2011
01:24 PM
|
0
|
0
|
1558
|
|
POST
|
def getCLIMVAR(PYCLIM):
climvar = str(%Climate Variable%)
if climvar == "Current Temperature":
PYCLIM = "CUR_TEMP"
return PYCLIM
elif climvar == "High Temperature":
PYCLIM == "HI_TEMP"
return PYCLIM
elif climvar == "Low Temperature":
PYCLIM == "LOW_TEMP"
return PYCLIM
elif climvar == "Wind Chill Temperature":
PYCLIM == "CHILL_TEMP"
return PYCLIM
elif climvar == "Dew Point Temperature":
PYCLIM == "DEW_TEMP"
return PYCLIM
elif climvar == "High Temperature":
PYCLIM == "HI_TEMP"
return PYCLIM
elif climvar == "Relative Humidty":
PYCLIM == "REL_HUMID"
return PYCLIM
elif climvar == "Solar Radiation":
PYCLIM == "SOL_RAD"
return PYCLIM
elif climvar == "Wind Speed":
PYCLIM == "WIND_SPEED"
return PYCLIM
... View more
06-16-2011
01:19 PM
|
0
|
0
|
4896
|
|
POST
|
Ah, if it's always the same like that then you can do this: tail_to_clip = "_12May11_mm"
x = "My_String_Needs_to_be_truncated_12May11_mm"
truncated = x.rsplit("_")[:-len(tail_to_clip)] And then just swap out tail_to_clip as needed. Though the option with rstrip is a bit more robust.
... View more
06-10-2011
12:31 PM
|
0
|
0
|
7322
|
|
POST
|
What do other strings of the same form look like? Do you need to truncate to a length or a number of fields? x = "My_String_Needs_to_be_truncated_12May11_mm"
truncated = x[:31] or x = "My_String_Needs_to_be_truncated_12May11_mm"
truncated = x.rsplit("_")[0] etc. What do other samples of strings you need truncating look like?
... View more
06-10-2011
11:51 AM
|
0
|
0
|
7322
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 09-26-2012 02:46 AM | |
| 2 | 01-06-2011 08:22 AM | |
| 1 | 03-25-2014 12:18 PM | |
| 1 | 08-12-2014 09:36 AM | |
| 1 | 03-31-2010 08:56 AM |
| Online Status |
Offline
|
| Date Last Visited |
11-11-2020
02:22 AM
|