POST
|
I had esri support take a look. They weren't helpful at all. Just living with it.
... View more
12-05-2023
07:02 PM
|
0
|
0
|
686
|
POST
|
@HervéW so I have a python toolbox setup with a class/tool called VersionController. In its execute method I use arcpy.mp.ArcGISProProject('current') to grab the project object. I am passing that into an importing module (main.py) and I have another class called APRXVersionManager that takes this object as one of its instance attributes. Inside there I have two methods for switching from a verison to default and from default to a version. Instead of using the change version function, I am constructing dictionaries of the default and version connection info properties and just updating those in a loop. To get the version GUID needed for the class below, you could just use the python api to get the version, and look it up in the objects properties. I did not test it, but just grabbing the Project object within the tool itself, and passing that into what ever module you need to may work with the ChangeVersion method. class AprxVersionManager:
def __init__(self, aprx_obj: str, version_name: str, version_guid: str) -> None:
self.aprx_obj = aprx_obj
self.version_name = version_name
self.version_guid = version_guid
self.map_obj = self.aprx_obj.listMaps("Map")[0]
self.layers = [
{
"layer_name": "myFirstLayer",
"layer_id": "0",
"current_layer_obj": self.map_obj.listLayers("myFirstLayer")[0],
},
{
"layer_name": "mySecondLayer",
"layer_id": "1",
"current_layer_obj": self.map_obj.listLayers("mySecondLayer")[0],
},
{
"layer_name": "myThirdLayer",
"layer_id": "2",
"current_layer_obj": self.map_obj.listLayers("myThirdLayer")[0],
},
]
def get_default_lyr_conn_dict(self, layer_id: str):
return {
"connection_info": {
"url": "https://domain.com/path/to/featureservice",
"version": "sde.DEFAULT",
"versionguid": "{CF8A9817-9A00-41AC-B0CC-58F78DBAE0A1}",
},
"dataset": f"{layer_id}",
"workspace_factory": "FeatureService",
}
def get_version_lyr_conn_dict(self, layer_id: str):
return {
"connection_info": {
"url": "https://domain.com/path/to/featureservice",
"version": f"{self.version_name}",
"versionguid": f"{self.version_guid}",
},
"dataset": f"{layer_id}",
"workspace_factory": "FeatureService",
}
def switch_to_default(self):
for layer in self.layers:
default_lyr_conn_dict = self.get_default_lyr_conn_dict(
layer_id=layer["layer_id"]
)
version_lyr_conn_dict = self.get_version_lyr_conn_dict(
layer_id=layer["layer_id"]
)
layer["current_layer_obj"].updateConnectionProperties(
version_lyr_conn_dict, default_lyr_conn_dict
)
def switch_to_version(self):
for layer in self.layers:
default_lyr_conn_dict = self.get_default_lyr_conn_dict(
layer_id=layer["layer_id"]
)
version_lyr_conn_dict = self.get_version_lyr_conn_dict(
layer_id=layer["layer_id"]
)
layer["current_layer_obj"].updateConnectionProperties(
default_lyr_conn_dict, version_lyr_conn_dict
)
... View more
11-10-2023
06:58 AM
|
0
|
2
|
592
|
POST
|
That’s definitely the same situation I dealt with. Thanks.
... View more
11-08-2023
02:45 PM
|
0
|
0
|
109
|
POST
|
Thanks @HervéW. I figured out a solution. I can come back here and share it later. Signing off for the day.
... View more
11-08-2023
02:44 PM
|
0
|
4
|
623
|
POST
|
@HervéW Any luck with this? Trying to do something similar and experiencing same results as you.
... View more
11-08-2023
07:54 AM
|
0
|
6
|
649
|
POST
|
Hey @EdApalinski I'm curious to know how you went about resolving this issue? Very similar to the current one I am dealing with.
... View more
11-06-2023
10:02 AM
|
0
|
0
|
191
|
POST
|
I’m curious if you have had a use case where you need to do some edits to a version while the user has it in a project or actively using it somewhere. I am currently needing to update some values in a versioned layer once a user finishes their edit. Right now I’m using just a normal update cursor with not many issues but it’s slow. Was testing with just using the .edit method on a version object through the API and I have to remove their lock in order to establish my own and update the data. After this they still need to reconcile and post, but are getting errors related to no schema locks. I am using .start_editing() and .stop_editing() which I thought would allow their lock to be reestablished, but doesn’t look like that is the case.
... View more
11-03-2023
03:44 PM
|
0
|
0
|
234
|
POST
|
Hey @EmilioTomeBlasco, did you ever figure out a resolution to this?
... View more
11-01-2023
10:35 AM
|
0
|
0
|
1449
|
POST
|
Hey @anbinh, did you ever figure out a resolution to this?
... View more
11-01-2023
10:33 AM
|
0
|
0
|
485
|
POST
|
Had this error since 10.9.1. At 11.1 now. FRUSTRATING!
... View more
09-28-2023
07:34 AM
|
1
|
0
|
962
|
POST
|
Thanks. I figured it out for the python api, basically I just needed to call StartReading() and StopReading() methods on the version object.
... View more
09-26-2023
02:22 PM
|
1
|
0
|
291
|
POST
|
Hey @Dwarburg did you ever resolve this? Specifically the no schema locks error via the python api. I am running into the same issue.
... View more
09-26-2023
07:31 AM
|
0
|
2
|
855
|
POST
|
@LukeBehling I am curious to know if you ever tracked down the cause of this issue?
... View more
09-21-2023
06:09 AM
|
0
|
0
|
183
|
POST
|
@davedoesgis I am curious if you ever came up with a solution to your problem? If so, could you share what you implemented?
... View more
09-19-2023
08:16 AM
|
0
|
1
|
390
|
Title | Kudos | Posted |
---|---|---|
1 | 03-15-2024 07:22 AM | |
1 | 09-26-2023 02:22 PM | |
1 | 09-28-2023 07:34 AM | |
1 | 09-11-2023 03:02 PM | |
1 | 02-02-2020 06:58 PM |
Online Status |
Offline
|
Date Last Visited |
a week ago
|