Select to view content in your preferred language

How to suspend script?

2622
11
05-02-2017 01:43 AM
helloworld
Emerging Contributor

Hello. Is it possible to suspend script execution, then manually edit some tables in ArcGIS and then continue script execution? How can I do it?

11 Replies
DanPatterson_Retired
MVP Emeritus

I am not sure what you mean by 'suspend', but if you are looking for python and editing on the same process, then

the data access Editor might be what you are looking for.   How are you planning to implement this in any event? as a tool in ArcToolbox? 

helloworld
Emerging Contributor

Thanks for answer!:) I edit my question in the header, it means that script execute some ArcGIS instruments (calculate, addField, intersect and so on), thеn it can be necessary to edit some tables manually (so script should be suspended), and then, when editing is over, other instructions must be executed

as a tool in ArcToolbox? 

Yes, but it can be another way, because maybe some troubles with foreground processing may occur

0 Kudos
DanPatterson_Retired
MVP Emeritus

maybe in arcobjects, but it would be best to split the workflow into two separate operations in that event

BruceHarold
Esri Regular Contributor

The Tasks framework in ArcGIS Pro might be what you need.

RebeccaStrauch__GISP
MVP Emeritus

...it means that script execute some ArcGIS instruments (calculate, addField, intersect and so on), thеn it can be necessary to edit some tables manually (so script should be suspended), and then, when editing is over, other instructions must be executed

Can you break it up into separate tools/scripts?  (Similar to Bruce's suggestion of tasks in Pro).  Have the first script(s) do the calculate, addField, intersect, etc., all in one script or separated. Run you interactive edits. Then additional scripts to do the other tasks.

Although I haven't tried leaving an edit session "open" at the end of a script, do your interactive editing and then run another to close the edit session, it might be possible.  Take a look at

Editor—Help | ArcGIS Desktop 

(and don't forget to save at some point in there.)

helloworld
Emerging Contributor

Thanks for answer!
The Tasks look like what i need, but I don't have ArcGIS Pro:(
I'm not sure but would I be able to edit tables manually? I mean like this, directly in the table:
In "Editor" description editing is performed using instruments, not manually, i mean by hands:) (sorry for my bad English)
I thought about functionality like pause/play/stop, so i run script, it executes some instructions and instruments, then it makes "pause" and wait until i make my editing in the tables, and then the script finish other instructions. I even thinking about additional window on Python with button "Continue".

Sorry for many words, so, can I edit cells like is written above?
If not, well, I'll separate this script into two.

0 Kudos
RebeccaStrauch__GISP
MVP Emeritus

In "Editor" description editing is performed using instruments, not manually,

I don't know of a way to Pause/Continue using one script with arcpy.  In your original post, you mentioned things like "calculate, addField, intersect" which are command that you could run using arcpy. When you mention "instruments" I think of external hardware like a GPS unit, in which case you may have to go with a different process.  You mention your English is not your first language, so it may be something lost in translation. Can you clarify?

Also, if you have already started with your code and can post using https://community.esri.com/docs/DOC-8691-posting-code-with-syntax-highlighting-on-geonet?sr=search&s...‌ it would help other see what you have tried.

0 Kudos
DanPatterson_Retired
MVP Emeritus

split into separate tasks... I doubt if your workflow will be completely linear in any event... what happens when you want to undo an edit or something? you would have to program/account for that situation as well.  You can produce your own toolbox and have the tools available there in logical order so that you can proceed from one step to another or revisit any step at any time.

helloworld
Emerging Contributor

Yeah, you're right, this play/pause thing will be inconvenient... Bad idea:) Okay, I'll split it. Thanks Dan, thanks Rebecca!

0 Kudos