Select to view content in your preferred language

Using custom python toolbox while working in a branch versioned feature class in ArcGIS Pro 3.5

831
5
11-17-2025 06:12 AM
TaDo_NL
Emerging Contributor

Hi all,

I could not find a way to use my own python script on a branch while editing in Pro on this same branch because of locking issues (branch versioned data). Python can not re-use the branch connection from ArcGIS Pro and wants to create a new connection, but it can not, because the branch is already locked by ArcGIS Pro.

It is recommended in documentation to let a python script work directly on the service using Arcgis API on a separate branch, but this is not an option for us, as we would like to use Python tools to help editors fill in specific attributes while working in an edit session in Pro.

I tried different strategies.

I see no option to stop editing session in Pro and turn back to read only connection with the branch? I have tried to change the version to default, let the pythonscript run and change back again, but if an edit session already was opened in Pro, because of caching, locking still happens. Even if the edits are already saved. Also changing versions from python takes like for ever, because it can only do this by layer or table and our service is huge. Script took about 14 minutes and then crashed because locking still existed.

I tried editing with python locally with arcpy (not connecting directly to de service with arcgis api but using ArcPy), but changes are then not saved in the service and get overwritten as soon as you start editing in Pro, because a new cache gets built up from the service as soon as you start editing.

The only way I could get the python tool working, was bij restarting ArcGIS Pro, opening a new project and run the script...

The only option I now see is building a kind of C## wrapper around my python toolbox? Because C## has more options for handling branches and caches?

Can anyone confirm my findings or give me an other solution?

Any further insight will be appreciated!

Thanks! 

 

0 Kudos
5 Replies
Joshua-Young
MVP Regular Contributor

Could whatever the Python script is doing be replicated with attribute rules? Attribute rules still have limitations, but they have come a long way at ArcGIS Enterprise 11.5.

"Not all those who wander are lost" ~ Tolkien
0 Kudos
TaDo_NL
Emerging Contributor

Nope, unfortunately not.

0 Kudos
LauraBecht
Frequent Contributor

Have you tried running it in an arcpy notebook from within Pro?

0 Kudos
TaDo_NL
Emerging Contributor

No, we want to create our own toolbox. Tried running it from there.

0 Kudos
LauraBecht
Frequent Contributor

To explain my reasoning, my thought is if it runs as a notebook, then you can use the normal toolbox to create a script tool which should run the same as the notebook.  Theoretically a script tool shouldn't be any different from a python toolbox, but sometimes things get weird.

0 Kudos