Bug in Undo - Active cut not restored to scene tab

If you have a scene with an active section cut, and you delete the section cut, then undo the delete, the section cut will come back, but it will no longer be the active cut on that scene. Easy to reproduce.

I did not reproduce on Win 10.

If the both the scene and the style that the scene uses are updated after the cut is made active, but before the Delete operation, then the Undo also restores the active cut.

I think that this works as intended.

@colin might check on Mac.

I didn’t do anything with styles. Just added scenes.

Here’s a video showing what I did.

I’m on Windows 11.

Again, I cannot reproduce on Win 10 even if I uncheck “Active Section Planes” the scene properties.
The Undo restores the section plane and reactivates it as the active section cut.

Okay, I watched the video. I had it correct in my initial reply.

You did not update either scene after creating (and activating) the section plane.

The behavior you see has nothing to do with undo. The section plane will be deactivated simply by switching scenes, because neither scene was updated to save the active section cut, so the view is restored to no section cuts active.

There is no bug. It is “pilot error”. This is working as intended.
EDIT: There definitely is a way to see weirdness. See following discussion.

That’s interesting. I actually discovered this as part of plugin development. I have a situation where I delete most of the items in the model, and count on the undo to put them all back. One of my users reported that all their scenes lost their active cut. He’s on a mac. I’ve had the same thing happen. The workaround is for my code to leave the section cuts alone for this operation.

In the style I’m using, Section Planes and Section Cuts are both on, and Section Fill is off.

Hmm. In the video, at about 20 seconds in, I switch back and forth between scenes, and the cut stays active. In my experience, if there’s an active cut when you create the scene, then it’s preserved. In fact, I can even save the model and exit SU, then reload it, and the cut is still there and active.

I get the same behavior even if I update the scene manually after creating the cut.

What settings are saved with a scene or not is determined by the checkboxes in scene properties. In some SketchUp templates, by default, all of the boxes are not checked.

In this video, you can see me updating the scenes after creating the cut. And you can also see the checkboxes in my style settings.

This is what I see in this latest video:

  1. I see you creating “Scene 1” before you create the section plane in “Scene 1”.
  2. Then you created the section plane, (which is activated by default,) but you failed to update “Scene 1” which will not save it as the active section plane, because …
  3. … you then created “Scene 2”(again, without updating “Scene 1” first,) which changed the active scene to the new “Scene 2”. Since this was created with the active section plane, it saved it within its internal collection of active section planes.
  4. Then you frivolously updated “Scene 2” from its scene tab context menu.
  5. Then you switched back to “Scene 1” using its scene tab, and it correctly deactivated the active section plane for “Scene 2” as no planes were saved as being active for “Scene 1”.
  6. Then you selected the inactive section plane in “Scene 1” and did a delete from the Edit menu.

This delete (apparently) caused the section plane to be removed from all section plane property lists.

I now see what you see however there is a catch.

I see “Scene 2” losing its active section plane only when I do the delete and Undo from “Scene 1”.
When I do the delete and Undo from “Scene 2”, its active section plane is restored.

That’s not true either. You need to actually select the scene tab as I do at the end of this video (after a frivolous flourish :laughing:). It doesn’t matter what you are viewing when you delete a section plane, then undo it. It will no longer be the active cut on any scene that was using it.

When I do what you did in post 9, in a newly opened file, I get this warning the moment I create scene 2:

As I said, I did reproduce what you did exactly as you did it.

But I also did not by staying in “Scene 2” and doing the delete and undo from “Scene 2”.

It is obvious that most users would have multiple scenes that may have differing section planes active, and from your described codeflow, that a model cannot have every scene active at the same time. So yes there would be an issue here, whether the result on the user’s machine is like your machine or mine.

That said, using undo in this manner my not have been envisioned by the authors of the API.

Would using an undo operation and then aborting it be any better ?

What about copying what you need to the clipboard, then temporarily opening a empty model, do “your thing”, then reopen the previous model ?

Oh, I’ve found a suitable workaround in my code. I was just wondering if the same bug existed in the UI, and it does. So I’m just trying to do my duty and report the bug.

Thank you then.

FYI, there is a discussion (from 6 years ago) of a missing feature in the API regarding getting arrays of what a scene page’s active section planes are and what scene pages a particular section plane is active on.

Please add any comments or wishes to this GitHub thread. Perhaps even a link to this forum topic?

Ie: See what scenes a section is used in · Issue #25 · SketchUp/api-issue-tracker · GitHub

I see this now too. When selecting ‘do nothing to save changes’ in the shown popup screen, Sketchup actually quite consistently crashes: