Scripts and Undo question / wish

Hi @Dale,

I recently ran into a problem where undo-like behavior while running a script would be very helpful. For any string or number values, implementing my own undo inside the script is not a big problem, but when it comes to geometry changes, especially modifying geometry, it is much harder or impractical to do. For example, I have a solid that I interactively add holes to within the script runtime. Being able to undo each hole would be great, but now in order to do it I would need to somehow store each geometry piece in some tricky way (temp export, hide somehow etc.)

In general I like the current state that the entire RhinoScript runtime is a single Undo stack step. But wondering if there could be a method to force record Undo during script runtime (and actually run Undo while in the script). Or maybe there is a better way to do it? Would you have any suggestions ?

Thanks–

jarek

Hi Jarek,

I’m curious why you would not consider to step over to python?
The type of functionality you describe is possible via drawing the temporary geometry yourself, without the need to ever add it to the document in the first place.

-Willem

I don’t have any suggestions, other than to track what you’ve done and try undo it yourself…

Got it, thanks Dale.
@Willem, several reasons but obviously I don’t need more convincing that this is a way to go. It has been done already both by McNeelies and also by looking at amazing things that you, @Clement, @Mitch (former RhinoScripters) and many others can do in Python already.

But since you are curious - currently my studio’s workflow is heavily based on tools developed in RhinoScript that have been created and improved over many years. There is a lot of it, some of them quite complex. It would be a major effort to translate all of it from RS, especially that most of them get updated regularly.
I also have several new larger script projects that are half-way there that started in RS and I have decided it is better to finish them first before stepping over.
Also, as it has been noted in other posts, while you can do most anything with Python by diving deep into RhinoCommon, the RhinoScript Syntax is not 100% there where RhinoScript is (I was hoping it would catch up by now which would be a good motivator to try to transition for me), so translating everything 1:1 is not possible. That’s the longer answer.

Short one: Time :wink:

–jarek

1 Like