|
POST
|
Thanks, @RobertCao. This is an okay band-aid option for now, but I'd prefer to refresh a feature layer and its attributes individually instead of bogging down the map session while all feature layers get refreshed unnecessarily. Would you or anyone else on your side happen to know of a way to refresh individual feature layers? I got some odd suggestions from ChatGPT on this. Most of the options are invalid (e.g. featureLayer.Refresh() is not possible, even if ChatGPT thinks so...what a tease...). I thought maybe featureLayer.ClearDisplayCache() might work since it discusses the refreshing of the display, but it did not work as I needed. I'll put a pin in this and see if you have any other suggestions.
... View more
04-15-2024
03:16 PM
|
0
|
4
|
6126
|
|
POST
|
Hey Rich, I'm super late to this party but was hitting a similar snag as Barbara here. I deal with quite a few layers in Pro that are created from selections of a feature class. Searching the Feature Class allows me to define useRecyclingCursor true/false. However, a Feature Class search will iterate the entire feature class table. I'd like to just perform a search on the feature layer (created from a table selection). The search option with feature layers is limited and won't allow me to set a recycling cursor. This is causing the output to repeat and not be unique values. Barbara's workaround may work, but that is not a desirable workflow. Is there no convenient, native way to search a Feature Layer similarly to how a Feature Class is searched? Interestingly enough, I'm allowed to use the useRecyclingCursor during a Select().Search() instead. I've used featureLayer.Select().Search(null, useReyclingCursor: false) with more desireable outcomes, but it will also select all of the features within Pro. I immediately have to utilize featureLayer.ClearSelection() to undo that afterwards. My choices for feature layer search just seem...surprisingly clunky. Any better ideas are welcomed!
... View more
03-06-2024
01:36 PM
|
1
|
0
|
1070
|
|
POST
|
Hey Robert, thanks for clarifying. I know this is an older message I'm responding to and that you are merely a messenger, but I wanted to say that I hope your internal team reviews this Warning message configuration. The reason I say that is summed up in one word: Inconsistency. If I do an Arcade expression with null, there is no Warning message. If I do a VBScript expression with NULL, there is no Warning message. Why is there a Warning message exclusive to Python expressions for nulling the field? Also, nulling a Python string is not an error when coding in, well, any IDE I've ever used. An absence of a string value has never been a problem (so long as the field is nullable). The warning message is even more convoluted because it uses the wording "error" with a Warning message's explanation. Esri has Error messages and Warning messages. Error wording should not exist in a Warning message. This is causing our end-users a lot of confusion and, our support staff, wasted headaches because we have to try and explain to them the Esri thought-process here (I rate my answers a D- so far..). Best case solution: Nulling a nullable field should be excluded from this scenario....because it's a legal operation. Worse case solution: the Warning message should be updated where "error in evaluating Python expression" is removed/reworded for null scenarios. Okay, I'm off my soapbox now! - A GIS programmer
... View more
02-14-2024
09:21 AM
|
2
|
1
|
4820
|
|
POST
|
Providing an update: My original tests were happening on Windows Server 2022 with Pro 3.2.1. I was able to find a machine that had Windows Server 2016 with Pro 3.1.3. Its State ID output was matching the actual SQL tables, no negative numbers! I was also able to find a machine that had Windows Server 2022 with Pro 3.1.3. Its results were also matching the actual SQL tables, no negative numbers....but.....the State ID values were being converted to double and no longer integers. Um, wut. My testing seems to conclude that there is a bug between Pro 3.1.3 and Pro 3.2.1. I'll be submitting a ticket to Esri and will follow up here if I learn anything relevant about my situation.
... View more
01-26-2024
02:05 PM
|
0
|
6
|
2051
|
|
POST
|
Hello everyone, I've got a confusing enterprise SQL situation that I'm presently stumped on. I'm using arcpy.ArcSDESQLExecute() within a new custom tool I've built to select each database's (traditional) version state_id value from the SDE_versions table. We've got 16 enterprise databases that I'm comparing the Default version state_id against its child version state_id (for assisting us with identifying versions that our GIS editors may have forgotten to reconcile and post after their QC edit sessions). For 15 of the 16 SDEs, it's working flawlessly. The state_id values are returned to me as expected, and the Python output matches what I'm seeing within SQL Server Management Studio table view. However, I have one SDE that is returning a massive negative number (in the -17,000 range). When I saw this, I manually looked at the SQL table directly and saw that the actual state_id values were 47,539! I thought maybe the negative number indicated an error, so I edited, reconciled, and posted the versions again. I'm still getting a negative value as the result. I've double checked the connection strings to ensure I'm looking at the correct database with proper permissions, and yes everything looks good and consistent like the other 15 SDEs. The interesting thing is, as the SDE's state_id values increased by 4 in the SQL table (currently 47,543), the Python output showed a decrease of 4 with the negative number (currently -17,993). So the state_id values are changing at matching numeric intervals, just within a different counting dimension somehow. Ha. This one has me puzzled, and since 15 of 16 are working perfectly, I am beginning to assume a) a sickly database, or b) some sort of Esri bug. It's a new tool I've built though, so I have no previous Pro version to have a frame of reference (currently using Pro 3.2.1) Before I get in contact with Esri customer support, has anyone ever experienced negative state_id values like this? Here's the function I built that's running the core logic, if it helps. def func_sql_tables(sde_conn, sde_database_name, def_version, child_version):
schema_owner = def_version.name.split(".")[0]
string_SQL_Query = f"SELECT Owner + '.' + Name, State_ID FROM {sde_database_name}.{schema_owner}.SDE_Versions WHERE Owner + '.' + Name = '{def_version.name}'"
if child_version:
string_SQL_Query = string_SQL_Query + f" OR Owner + '.' + Name = '{child_version.name}'"
print(string_SQL_Query)
connect_2_SQL_Tables = arcpy.ArcSDESQLExecute(sde_conn)
sync_Results_SQL = connect_2_SQL_Tables.execute(string_SQL_Query)
temp_list_for_state_id = []
for each_result in sync_Results_SQL:
print(each_result)
temp_list_for_state_id.append(each_result[1])
if len(set(temp_list_for_state_id)) == 1:
print(sde_database_name + ": All state IDs match!")
else:
print(sde_database_name + ": Uh oh, the state IDs don't match!") Thanks for any insight!
... View more
01-25-2024
10:36 AM
|
0
|
8
|
2151
|
|
POST
|
I was struggling through this as well. Thanks for the answer. 👍
... View more
01-12-2024
03:00 PM
|
0
|
0
|
902
|
|
POST
|
Thanks! That got me on the right track and is working for me now. Ended up implementing these subscriptions: ActiveMapViewChangedEvent.Subscribe(func_OnActiveMapViewChanged); // if active map changes
LayersAddedEvent.Subscribe(func_OnLayersAddRem); // if feature layer added
LayersRemovedEvent.Subscribe(func_OnLayersAddRem); // if feature layer removed
LayersMovedEvent.Subscribe(func_OnLayersAddRem); // if feature layer reordered
MapMemberPropertiesChangedEvent.Subscribe(func_OnMapMembersPropertyChanged); // if feature layer renamed
... View more
01-12-2024
02:40 PM
|
0
|
0
|
1192
|
|
POST
|
Hello everyone, I have a Pro SDK add-in tool (a dockpane). It has a listbox that I populate with the feature layers from the Contents pane. Currently, it's using a Refresh button that the end-user can manually click to update the listbox if anything changes within the Contents pane. That's working fine. However, I'd like to enhance this a bit to auto-update the listbox based on "live" changes from the Contents pane. Examples could be if someone imports a new feature layer into the map or a feature layer gets renamed while the dockpane is open. I'm starting to get the hang of Pro SDK and WPF/XAML, but still have a lot to learn. Is it possible to "monitor" the Contents pane and auto-update the listbox? If so, what approach would I use to accomplish that? Thanks for any advice.
... View more
01-10-2024
01:40 PM
|
0
|
2
|
1382
|
|
POST
|
Hey everyone, I recently upgraded from Pro 3.1.4 to Pro 3.2.1, and am running my scripts through some audits to ensure odd behavior has not been introduced with the minor release update. I'm hoping to get some clarification regarding new output messages I'm seeing in my Python script. I have quite a few .sde enterprise connections that I use for various purposes. At the end of those operations (compressions, for example), I use the ClearWorkspaceCache_management code block. For years, this has worked fine as-is. The arcpy.GetMessages() output will show Start Time and Succeeded. However, with the upgrade to 3.2.1, I'm now getting an extra message "WARNING 000585: Warning occurred during execution." Nothing seems to fail, but I'm concerned about what this new message is trying to warn me about. A basic code snippet that produced the above warning message: import arcpy
print("clearing cache...")
arcpy.ClearWorkspaceCache_management("C:\\Path\\To\\Connection\\Example.sde")
print(arcpy.GetMessages()) Output result: clearing cache...
Start Time: Wednesday, January 3, 2024 1:30:26 PM
Succeeded at Wednesday, January 3, 2024 1:30:28 PM (Elapsed Time: 1.63 seconds)
WARNING 000585: Warning occurred during execution. The warning code description left me puzzled, since it's a string path to the .sde file. I thought maybe it was some sort of format deprecation warning, so I tried the new arcpy.management.ClearWorkspaceCache() format. However, it gave the same Warning message. I tried using .sde files created from ArcMap as well as ArcGIS Pro, in case of compatibility issues. Nope, that didn't change anything either. I also tried changing the string path format I used from \\ to r', but no output difference with that either. There has been only one scenario (so far) where I am able to make the Warning message disappear. Instead of assigning the .sde connection path to the geoprocessing tool itself, I needed to first assign it to the arcpy.env.workspace beforehand. From there, it appeared to work as intended. import arcpy
print("clearing cache...")
arcpy.env.workspace = "C:\\Path\\To\\Connection\\Example.sde"
arcpy.ClearWorkspaceCache_management()
print(arcpy.GetMessages()) New output: clearing cache...
Start Time: Wednesday, January 3, 2024 1:40:47 PM
Succeeded at Wednesday, January 3, 2024 1:40:47 PM (Elapsed Time: 0.20 seconds) I see that the Clear Workspace Cache documentation shows the above example in the official code sample, but that documentation also shows that the input data can still be included within the tool itself. I guess I'm just confused as to what the Warning message is trying to actually tell me. Has anyone had any experience or epiphanies with this one yet? Thanks for any insight. I'm hoping I won't need to modify every script to accommodate the arcpy.env.workspace format.
... View more
01-03-2024
11:57 AM
|
0
|
1
|
1078
|
|
POST
|
Thanks, Rich. Good to know! We have numerous Python tools in-house that deal with conflicts and sync, so it'll be nice to have that accessible across Pro SDK as well. For now, I was able to create a work-around for the desired output for the replica lists. If I can build this in 2 weeks, I'm sure Esri could do it in 2 days with some focus. 😉
... View more
06-12-2023
12:42 PM
|
0
|
0
|
975
|
|
POST
|
Thanks, Rich. That's too bad, but I'm glad it's on the roadmap. Is there a link for Pro SDK specific roadmap items that the public can track? I looked on the github site, but wasn't able to track it down if it's on there. In this case, I was able to band-aid things by iterating the .sde tables to extract the information I was looking for. If I take the distinct ReplicaID values from the REPLICALOG table and match those to their matching ObjectID values in the GDB_ITEMS table, I can then use that table's Name field value to return each replica name. There is hope yet!
... View more
05-24-2023
08:25 PM
|
0
|
0
|
1057
|
|
POST
|
Hello all, I'm primarily a Python guy, but I've been dabbling more in ArcGIS Pro SDK lately. I'm trying to convert some functionality over from Python into a workflow for a Pro add-in. During this process, I've quickly realized that some pieces are hard to find equivalents for, such as arcpy.da.ListReplicas(). So far in Pro SDK, I've learned how to access .sde database tables, but I was hoping there was an easy tool to allow me to get a list of replicas built from an enterprise database. I thought that await Geoprocessing.ExecuteToolsAsync("da.ListReplicas", parameters, flags, etc...) might work, but it did not. That may not be a compatible tool for that geoprocessing scenario though, so I'm not sure. Anyway, thanks for any enlightenment.
... View more
05-24-2023
02:49 PM
|
0
|
4
|
1226
|
|
IDEA
|
I believe they do provide that. It's a little bit buried, but once you've entered the Search area of Esri's Support page, you should be able to filter and search by Bugs on the left-hand side. Here's the link to the Search page where you can filter by Bugs. https://support.esri.com/en-us/search?s=Relevance Bugs are filterable within the Content Type, here: I hope that helps.
... View more
05-24-2023
02:38 PM
|
0
|
0
|
2658
|
|
POST
|
I finally got a chance to try that workaround. It worked for me as well! I'll mark this as a solution while Microsoft sorts itself out.
... View more
05-24-2023
09:27 AM
|
0
|
0
|
4591
|
| Title | Kudos | Posted |
|---|---|---|
| 2 | 04-19-2024 10:31 AM | |
| 1 | 06-14-2024 08:37 AM | |
| 1 | 06-14-2024 10:12 AM | |
| 1 | 06-14-2024 10:03 AM | |
| 1 | 06-12-2024 09:00 AM |
| Online Status |
Offline
|
| Date Last Visited |
4 weeks ago
|