|
POST
|
hitTest() will return features from an intersecting GraphicsLayer, from which you can getAttribute() or browse with the attributes property. Here are some hitTest() samples to check out.
... View more
05-04-2021
07:55 AM
|
0
|
0
|
1821
|
|
POST
|
For debugging, try only having this in updateParameters() just to see what you're working with self.params[0].setWarningMessage(self.params[0].values)
... View more
05-03-2021
02:32 PM
|
0
|
0
|
3921
|
|
POST
|
All the Python Toolboxes I've seen have updateParameters defined like def updateParameters(self, parameters): So you should have a parameters argument that you can use instead of self.params, but that's just more of a curiosity. self.params[0].values should return a list of values instead of splitting the delimited string. And I don't see where you're actually iterating over the list of feature classes. Try something like if self.params[0].values:
lyrs = self.params[0].values
fieldList = []
for lyr in self.params[0].values:
fieldList.append([f.name for f in arcpy.ListFields(lyr)])
self.params[1].values = sorted(fieldList) However, I've never worked with multivalue inputs so I could be way off.
... View more
05-03-2021
01:33 PM
|
0
|
1
|
3928
|
|
POST
|
Is your multivalue input for fields a boolean value list (checkboxes) or something else?
... View more
05-03-2021
01:11 PM
|
0
|
3
|
3935
|
|
POST
|
Ironically, I am in development of a script that does just this. I was working with ArcMap but just tested the search cursor on Excel in my ArcGIS Pro 2.7 environment and it works. No single quotes around the sheet name.
... View more
05-03-2021
08:31 AM
|
1
|
0
|
4511
|
|
POST
|
An outer join will smash up the whole table from both sides; matched and unmatched all together. You can do the full join, then query out where your join fields are null. "{} is null or {} is null".format(ParcelLayerJoinField, CamaTableJoinField)
... View more
04-29-2021
10:01 AM
|
1
|
0
|
1374
|
|
POST
|
Try some of the techniques described by @RichardFairhurst in Turbo Charging Data Manipulation with Python Curso... - Esri Community
... View more
04-20-2021
02:37 PM
|
1
|
1
|
3466
|
|
POST
|
Could you describe the join? Are there multiple records in the dbf for each hexagon_id in the feature class? are you calculating the mean of some value for each group of hexagon_id in the dbf?
... View more
04-20-2021
02:20 PM
|
0
|
3
|
3477
|
|
POST
|
@GeoDev I would recommend you do not attempt to integrate your new script into this existing script for geodatabase maintenance. These should be two separate scripts run at two separate times; preferably staggered enough so one has enough time to complete before the other starts. This is accomplished by saving your new script as a .py file and then scheduling it to run on a destkop or server machine that will be powered reliably to run this task at the scheduled time. Scheduling a Python script to run at prescribed times—ArcMap | Documentation (arcgis.com)
... View more
04-16-2021
10:42 AM
|
1
|
1
|
2816
|
|
POST
|
It depends what your geoprocessing script does. Is it part of database maintenance? That script code you posted is performing database maintenance operations that should all happen together without interference of anything else. However, the logic of that script is strange because the compress operation is in a loop but the unconditional break statement will exit the loop after the first iteration. A better way to do it is like this where it connects as SDE to perform compress, then does analyze and indexes as owner of the objects (different database connections). Use Python scripting to batch reconcile and post versions—ArcMap | Documentation (arcgis.com) Additionally, I found that I needed to use arcpy.SetLogHistory(False) so as not to fill up the geodatabase metadata with this nightly task, which seemed to keep slowing down the performance of the script each time.
... View more
04-15-2021
10:23 AM
|
0
|
3
|
2851
|
|
POST
|
Schedule a Python script or model to run at a prescribed time: 2019 update (esri.com)
... View more
04-15-2021
08:35 AM
|
1
|
0
|
2861
|
|
POST
|
If you're trying to find the "intersection" of the two lists (values that exist in both), try comparing the lists as sets. set(list1).intersection(set(list2))
... View more
04-14-2021
01:10 PM
|
2
|
0
|
1803
|
|
POST
|
Do you have other CatName values in Cat_Layer that aren't in cat_names? In other words, do you want to count all occurrences of every CatName value or only the ones you explicitly define?
... View more
04-14-2021
08:23 AM
|
0
|
1
|
2441
|
|
POST
|
You can use a default dictionary for this! from collections import defaultdict
fakeCursor = ["one", "three", "two", "one", "one", "two", "five", "nine"]
counter = defaultdict(int)
for i in fakeCursor:
counter[i] += 1
print counter Output: defaultdict(<type 'int'>, {'nine': 1, 'five': 1, 'three': 1, 'two': 2, 'one': 3})
... View more
04-14-2021
07:40 AM
|
2
|
0
|
2451
|
|
POST
|
This is a good solution. Just be aware @JamesMcAllister1 that if you don't pass the right number of fields, the field assignment will error out. You could validate the fldList argument before opening the cursor to make sure it's got four items. assert len(fldList) == 4, "fldList must have exactly 4 field names; like week_a, hours_a, week_b, hours_b"
... View more
04-08-2021
04:01 PM
|
3
|
1
|
5001
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 4 weeks ago | |
| 1 | 10-23-2025 03:53 PM | |
| 1 | 04-28-2026 07:25 AM | |
| 1 | 03-19-2026 08:59 AM | |
| 1 | 02-12-2026 01:37 PM |