Select to view content in your preferred language

Prevent users from running script tool if not in edit session?

513
1
11-15-2010 06:10 AM
Pey_JinCook
Occasional Contributor
I have a script tool that calculates fields.  How do you prevent the user from accidentally running the tool if s/he isn't in an edit session?  Thanks.
0 Kudos
1 Reply
LoganPugh
Frequent Contributor
I don't think it is possible to detect open edit sessions with Python scripting (because the geoprocessing model is supposed to automatically handle edit sessions on its own), only from within ArcObjects, unless you resort to something hacky like running a tool you know will throw an error without an edit session, trap the error and replace it with your own.
0 Kudos