Hi, I have a problem when writing ghpython in Grasshopper. The script editor window auto shut down every time I save my python script (pressing ctri+s or the save buttom), but I haven’t completed my code so I have to reopen it, which is annoying. Is there any way to keep the window on after saving?
Perhaps Grasshopper is trying to run it, and the code and Grasshopper set up then causes the crash.
Disconnect the seed 5946
and F X V
components while working on your code.
Mine either, R8.5. Ctrl+S will shut down the script component.
Shouldn’t Ctrl+S be Save, Ctrl+W be Shut-down?
Hi, @eirannejad, I think this is against common usage of the shortcuts.
Grasshopper Editor auto-closes on Save (Ctrl+S). This is the same behaviour as the older script editor:
Sorry, I begun to learn GHPython from R8. I didn’t notice that.
Is it possible I can save the script without closing it?
Some tests might crash Rhino, so I like save it beforehand, but I also don’t like to shut down the Script window, because I need to test(experiment) a lot to see and understand.
Of couse. I made a ticket for this and will take care of it for 8.6:
RH-80898 Add Option to avoid closing editor window when saving in GH
Thank you very much!
Do I need to save twice both in Script Editor and GH file before tests? Does the autosave in GH recognize the saving behavior in Script Editor, so if I save in Editor the GH temp file in Autosave folder will be updated automatically?
If you keep hitting F5 or Play button in the dashboard, that runs your script and grasshopper definition without closing the editor. That’s the equivalent of the Test button in the older editor
I just did two small tests.
- I tested (F5) a GHPython script(cannot save the script anymore), and closed the GH file without save. The autosave folder didn’t generate GH temp file.
- I saved a GHPython script, It saved and closed the Editor window. The autosave folder generated GH temp file, but inside the GH there is no Script Editor.
I think GH’s autosave function doesn’t recognize the Script Editor’s save/test behavior. Then what if Script Editor crashes Rhino? Where can I retrieve the autosaved python script?
Currently GH autosave function recognizes and autosaves on the events that are are listed in the options as you are showing in the screen capture.
I am not sure what is the problem here. You added a component to the canvas, then closed the file and when GH asked whether you want to save it or not, clicked “No”!? Any component that has been added to the canvas is not going to be saved this way.
On every change to the script, the editor will record a undo step with GH and also marks the GH document as “edited” so if you try to close that GH will prompt with the question.
I created a ticket to add an auto-save event for script editor changes in GH:
RH-80899 Add autosave event to GH for script editor changes
On then next 8.6, I added an option to toggle “Close on Save” since both behaviours are wanted.
- Editor does not close on save by default anymore
- Toggling the close on save is persistent, and affects all open editors
RH-80898 and RH-81303 should be fixed in Rhino 8 Service Release 6 Release Candidate.
…and just to follow up, RH-81303 and RH-80898 are also fixed in Rhino 8 Service Release 6.