|
POST
|
This is likely the issue. The other way to accidentally use the feature class instead of the layer is when choosing the value in the parameter at run time of the script tool. I'm assuming you have a parameter for "Project_Layer". If you're browsing to the feature class in a geodatabase for this parameter instead of choosing it from the list of layers in the map, then it'll calculate on all records (without the selection). Also, if you have the same feature class added to the map in more than one layer and you choose the wrong one (without a selection), it will calculate on all records. So there's multiple ways to mess this up. It might be worth adding some validation in your script tool to check if the layer has a selection. You can use the getSelectionSet() method on the Layer object.
... View more
06-05-2024
11:48 AM
|
1
|
1
|
3342
|
|
POST
|
After making a selection, you can use the CalculateField Python command (or geoprocessing tool) to edit the fields of only the selected records. However, make sure your input for it is the layer with the selection and not a generic path to the feature class in the geodatabase. In the latter case, it won't have a selection and it will field calc all records. You can also run the tool with an undo option in case there is unexpected behavior.
... View more
06-05-2024
08:18 AM
|
2
|
0
|
2003
|
|
POST
|
If you check the documentation for Split(), you'll see the last parameter is removeEmpty. There's something in the logic of how Split() works that can create empty items in the array and setting removeEmpty to true will resolve that.
... View more
05-31-2024
01:40 PM
|
0
|
0
|
2700
|
|
POST
|
Since you're making html, you could leverage that and use an unordered list that will automatically apply formatting. var sMgmt = split($feature.ManagementGoals, "•", 10, true)
// Format text strings with html list item tags.
for(var i in sMgmt) {
sMgmt[i] = "<li>" + Trim(sMgmt[i]) + "</li>"
}
// Combine all the list items within html unordered list.
var v = "<ul>" + Concatenate(sMgmt) + "</ul>"
... View more
05-31-2024
12:15 PM
|
0
|
0
|
2747
|
|
POST
|
Could you make another GraphicsLayer for display? When a graphic in the "base" layer is clicked, you add it to the "display" layer (above the base). Then remove it from the "display" layer when something else is clicked.
... View more
05-31-2024
06:58 AM
|
0
|
0
|
813
|
|
POST
|
You might need to use Convert() in the SQL expression to explicitly specify the value is a date and not a string. I also reorganized a little bit for readability. # Fetch data from both tables
workorders_data = []
and_expressions = [
f"Type = '{type_query}'",
f"teamLeader = '{leader_query}'",
f"teamAssigned = '{assigned_query}'",
f"dateReceived <= Convert(datetime, '{date_before}')",
f"dateReceived >= Convert(datetime, '{date_after}')"
]
expression = " AND ".join(and_expressions)
with arcpy.da.SearchCursor(f'{gdb_path}\\{workorders_fc}', workorders_fields, where_clause=expression) as cursor:
for row in cursor:
workorders_data.append(row)
... View more
05-28-2024
02:17 PM
|
0
|
0
|
4160
|
|
POST
|
I use ArcSDESQLExecute for querying non-spatial databases too. Your mileage may vary as the SQL gets more complex.
... View more
05-28-2024
01:55 PM
|
0
|
0
|
1963
|
|
POST
|
I've been able to use ArcSDESQLExecute as a replacement for basic things.
... View more
05-28-2024
01:02 PM
|
1
|
2
|
1972
|
|
POST
|
I have had this happen when clicking links in the automatic subscription emails, but it's rare; maybe 10% of the time.
... View more
05-22-2024
11:13 AM
|
1
|
0
|
3718
|
|
POST
|
You could create a script tool or Python toolbox that runs inside ArcGIS Pro. Both give you a simple user interface and custom messaging.
... View more
05-22-2024
09:00 AM
|
1
|
2
|
4601
|
|
POST
|
Esri has some documentation called the ArcGIS Well-Architected Framework that might be useful to get started with.
... View more
05-21-2024
01:58 PM
|
0
|
0
|
2390
|
|
POST
|
You can use Python to open a search cursor using the fields in the order you want with a sql_clause parameter to sort on the field you want. Iterate through each row of the cursor and write the data to your text file. You can even use the Python CSV module.
... View more
05-20-2024
11:45 AM
|
1
|
0
|
3647
|
| Title | Kudos | Posted |
|---|---|---|
| 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 | |
| 1 | 12-01-2025 06:19 AM |