|
POST
|
You just need to run the Join Field tool afterwards. Join Field (Data Management) Summary Joins the contents of a table to another table based on a common attribute field. The input table is updated to contain the fields from the join table. You can select which fields from the join table will be added to the input table.
... View more
06-27-2022
02:54 PM
|
1
|
0
|
1061
|
|
POST
|
That sort of hackery is not very pythonic. What you want is called a dictionary. colours = {}
colour = "red"
colours[f"{colour}_dom"] = "anothervalue"
print(list(colours.keys()))
# ['red_dom']
... View more
06-23-2022
09:54 PM
|
2
|
1
|
7368
|
|
POST
|
You could use a ValueTable with one column for the layers and one for the buffer distance Creating value table parameters def getParameterInfo(self):
"""Define parameter definitions"""
params = []
param = arcpy.Parameter(
displayName='Buffer Layer',
name='buffer',
datatype='GPValueTable',
parameterType='Required',
direction='Input')
param.columns = [['GPFeatureLayer', 'Input Features'], ['GPDouble', 'Buffer Distance']]
params.append(param)
return params
... View more
06-11-2022
05:31 PM
|
0
|
0
|
1166
|
|
IDEA
|
Thanks for updating the link @omdaniel . I also tried hacking the conda-hook.ps1 to work with ArcGIS Pro conda and it seems to work ok. I didn't bother setting up the integrated terminal in VS Code, just added the call to conda-hook.ps1 in my profile.ps1. I'm aware doing that also "hijacks" every instance of powershell, but that's what I want. Now to find a way around conda activate dot sourcing etc/conda/{activate|deactivate}.d scripts and failing because it's running in constrained language mode...
... View more
06-02-2022
04:28 PM
|
0
|
0
|
7863
|
|
IDEA
|
@omdaniel interesting, can you provide the link to the article? You just linked to the conda repo.
... View more
06-02-2022
02:33 AM
|
0
|
0
|
7923
|
|
IDEA
|
The corporate environment I work in has disabled cmd.exe and running of .bat & .cmd files as part of their IT Security policy and we are unable to install a separate miniconda. We do have access to powershell and Visual Studio Code to run python scripts. As of Pro 2.8, the isolated conda installation does not support conda init (ref.). This means we can not activate conda envs in powershell or VS Code and therefore can't run scripts that use additional packages installed into clones (that rely on a properly activated environment). Please enhance the ArcGIS Pro isolated conda installation to support conda init.
... View more
05-31-2022
12:04 AM
|
5
|
9
|
8020
|
|
POST
|
The value you compare it to should be a type, not a string. if type(value) in (arcpy.Polygon, arcpy.Point, arcpy.Polyline, arcpy.Multipoint):
arcpy.DoSomething(...) It'd be nice if type(value) is arcpy.Geometry returned True, but sadly it doesn't.
... View more
05-28-2022
10:31 PM
|
1
|
0
|
1437
|
|
POST
|
arcpy.ExecuteError is arcgisscripting.ExecuteError print(arcpy.ExecuteError)
<class 'arcgisscripting.ExecuteError'> Might be something happening when arcgisscripting gets imported in arcpy that causes a crash when you import it again in your notebook context. Worth reporting as a bug perhaps.
... View more
05-26-2022
11:18 PM
|
1
|
1
|
2059
|
|
POST
|
What flow modeling algorithm did you specify? D-Infinity (DINF) output is angle in degrees going counter-clockwise from 0 (due east) to 360 (due east), not the D8 direction codes (1,2,4,8,16,32,64,128).
... View more
05-24-2022
06:48 PM
|
0
|
0
|
721
|
|
POST
|
Don't nest Cursors. Build a dict with a da.SearchCursor, then refer to that dict in your da.UpdateCursor loop. Here are plenty of examples: Turbo Charging Data Manipulation with Python Cursors and Dictionaries
... View more
05-22-2022
09:58 PM
|
3
|
1
|
1662
|
|
POST
|
I've never had an issue adding the conda directory to my PATH. You don't need to change the system environment, just the user environment.
... View more
05-22-2022
09:40 PM
|
0
|
0
|
4994
|
|
POST
|
Use arcpy.ExecuteError instead: import arcpy
try:
arcpy.do_something()
except arcpy.ExecuteError as e:
handle_error(e)
... View more
05-19-2022
03:55 PM
|
1
|
1
|
2102
|
|
POST
|
Assuming you are using a custom toolbox (*.tbx), right click your script in the toolbox and select "Properties", select the parameters tab and then right click on the parameter you want to move and select "Move up" or "Move down". And then change the parameter references in your code. If you're actually using a Python Toolbox (*.pyt) then it's easier, just move the parameters around in your tool `getParameterInfo` method and then refer to the parameters by name using a dict or namedtuple class Tool
etc...
def execute(self, parameters, messages):
parameters = {p.name: p for p in parameters}
# do something with parameters["some_name"]
# Or
from collections import namedtuple
class Tool
etc...
def execute(self, parameters, messages):
parameters = namedtuple('Parameters', (p.name for p in parameters))(*parameters)
# do something with parameters[0] or parameters.some_name I also recommend voting for the following idea: ArcGIS Pro Ideas - Make Python Toolbox parameters a namedtuple instead of a list
... View more
05-18-2022
10:02 PM
|
3
|
1
|
2023
|
|
POST
|
Works for me in Pro 2.8.3 Try either adding 'C:\Program Files\ArcGIS\Pro\bin\Python\Scripts' to your PATH environment variable or using the full path to conda.exe 'C:\Program Files\ArcGIS\Pro\bin\Python\Scripts\conda.exe' env list
# conda environments:
#
arcgispro-py3 C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3
... View more
05-18-2022
09:33 PM
|
1
|
0
|
5034
|
|
POST
|
You can interact with AGOL maps using the ArcGIS API for Python. The arcgis package is pre-installed in Pro's default arcgispro-py3 environment.
... View more
05-15-2022
01:46 PM
|
0
|
0
|
1457
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 07-24-2022 03:08 PM | |
| 1 | 07-30-2025 03:00 PM | |
| 1 | 06-10-2025 08:06 PM | |
| 5 | 05-20-2025 07:56 PM | |
| 1 | 05-04-2025 10:34 PM |