POST
|
Maybe use None for the wildcard parameter instead of an empty string. df = arcpy.mapping.ListDataFrames(mxd, None)[0]
lyr = arcpy.mapping.ListLayers(mxd, None, df)[0]
... View more
yesterday
|
0
|
2
|
40
|
POST
|
I haven't done this in ArcMap, but your path doesn't look right. Try removing the two trailing back slashes.
... View more
yesterday
|
0
|
1
|
57
|
POST
|
The CIM is a weird and wonderful world. I highly recommend watching the session from the 2024 Esri Developer Summit. ArcPy: Beyond the Basics of arcpy.mp
... View more
yesterday
|
0
|
0
|
13
|
POST
|
This is possible, but only through manipulating the CIM, which is a bit tedious. Python CIM access—ArcGIS Pro | Documentation def highlightField(map, layer_name, highlight_field_name):
lyr = map.listLayers(layer_name)[0]
# Get the layer's CIM definition
cim_lyr = lyr.getDefinition("V3")
# Ensure the featureTable has fieldDescriptions to modify
# https://pro.arcgis.com/en/pro-app/latest/arcpy/mapping/python-cim-access.htm#GUID-C80C9CF4-67C8-418E-BEB5-386B18EE6097
if len(cim_lyr.featureTable.fieldDescriptions) == 0:
# No CIM field descriptions class; create one.
fDesc = arcpy.cim.CreateCIMObjectFromClassName('CIMFieldDescription', 'V3')
# Get field info and populate the new field description.
highlight_field_props = [f for f in arcpy.ListFields(lyr) if f.name == highlight_field_name][0]
fDesc.alias = highlight_field_props.aliasName
fDesc.fieldName = highlight_field_props.baseName
fDesc.highlight = True
fDesc.visible = True
fDesc.searchMode = "Exact"
# Add new field description to the CIM.
cim_lyr.featureTable.fieldDescriptions.append(fDesc)
else:
# Make changes to field description in CIM.
for f in cim_lyr.featureTable.fieldDescriptions:
if f.fieldName == highlight_field_name:
f.highlight = True
# Push the CIM changes back to the layer object
lyr.setDefinition(cim_lyr)
aprx = arcpy.mp.ArcGISProject("current")
highlightField(aprx.activeMap, "MY_LAYER_NAME", "MY_FIELD_NAME") In my testing, the fieldDescriptions was indeed empty (as the documentation notes) so I created a CIMFieldDescription only for the field being highlighted. This has the effect of moving the highlighted field to the beginning of the attribute table view. If that is not acceptable, you will have to create a CIMFieldDescription for each field in the order you want.
... View more
yesterday
|
0
|
0
|
13
|
BLOG
|
Shout out to the GIS cohort in the Phoenix metro area! @MeleKoneya has inspired the City of Chandler to implement a similar solution for our Fire/Health/Medical teams during big events.
... View more
yesterday
|
4
|
0
|
145
|
POST
|
Unrelated question for you, @JakeSkinner: Do you recommend using del on a cursor even when it's used in a with statement?
... View more
Tuesday
|
0
|
0
|
74
|
POST
|
If that hard coded workspace path worked fine, then it's not a problem with the database. I see you are doing some other workspace path manipulation if the input feature class is in a feature dataset. Try some other variations of the path to see if you can get it to fail when hardcoded. My guess is that you're getting something in the workspace that is causing Editor to hang.
... View more
Monday
|
0
|
0
|
33
|
POST
|
Okay, that looks fine. Now try an isolated test with the arcpy.da.Editor() with that workspace and see what happens. workspace = 'F:\\GIS\\WORKING FILES\\TestProjects\\TestingDB.gdb'
with arcpy.da.Editor(workspace, multiuser_mode=False):
arcpy.AddMessage('starting edit')
# Nothing else, just leave the script.
... View more
Monday
|
0
|
2
|
44
|
POST
|
Maybe something isn't right with your workspace manipulation. Try messaging out the workspace before you open the editor, then see if it works when you hard code that workspace path (or something else you know to work).
... View more
Monday
|
0
|
4
|
57
|
POST
|
Try Generate Near Table and specify the closest_count parameter as 2
... View more
Friday
|
0
|
0
|
139
|
POST
|
Ah, yes, sorry about that. The FeatureSharingDraft class has a code sample for publishing a layer and a table. FeatureSharingDraft—ArcGIS Pro | Documentation
... View more
Friday
|
1
|
1
|
117
|
POST
|
Does this have the information you need? Introduction to sharing web layers—ArcGIS Pro | Documentation Share a table—ArcGIS Pro | Documentation
... View more
Friday
|
0
|
3
|
162
|
POST
|
Yes, this workflow can be automated. However, it's not efficient to calculate the park name field in playgrounds on a regular basis. Since this is something you need to happen regularly, I recommend creating a relationship class between park and playground and utilize Attribute Rules to automatically populate the park name. This has the benefit of always being updated immediately when the data changes instead of only when you run the script.
... View more
Friday
|
0
|
2
|
117
|
POST
|
The Calculate Field tool in ArcGIS Pro will now create the field if it doesn't already exist, which is handy and saves a step. Either way, you should be able to have access to the new field in model builder and Python. Without more details, I can't advise further. If you are able to provide a detailed description of your starting tables and what you want the output to be, we might be able to provide some code examples.
... View more
Thursday
|
0
|
4
|
137
|
Title | Kudos | Posted |
---|---|---|
4 | yesterday | |
1 | a week ago | |
1 | Friday | |
2 | a week ago | |
1 | a week ago |