Ruby bug or documentation correction; SU 2020.1 page.update(16) vs page.update(384)

Just noticed a problem in 2020.1.
Trying to hide a group on multiple pages using Page.update(16). It doesn’t work anymore as in 2020.0. To get it working again I used page.update(384).

Api documentation may need a slight correction.

  • 16 - Hidden Geometry & Objects,
  • 128 - Hidden Geometry,
  • 256 - Hidden Objects
1 Like

I’d call this a bug. I think 16 should be interpreted as 384, and existing plugins would work without being changed.

Even better would of course be if the API from the starts had constants PAGE_HIDDEN, PAGE_CAMERA etc, and PAGE_HIDDEN being redefined from 16 to PAGE_HIDDEN_GEOMETRY & PAGE_HIDDEN_OBEJCTS in SketchUp 2020.

Hmmm … but in older versions 16 will still only be toplevel geometry and objects.

Please open an issue in the API Issue Tracker.

1 Like

Just entered the issue in the tracker.

1 Like

Any movement on this issue? I may or may not be experiencing issues with update in 2020. Am I correct that if I run update with no arguments, this issue should not be a problem?

Is there “movement” shown in the API Release Notes …

Was the issue that was opened on 5 MAY closed ? (Looks as though it’s still open.)

And it’s more likely you’ll get an answer closer to the root, if you ask in the open Issue.

The answer was did not appear to be in the dialog in the “API Tracker”.

I gather that the discussion over there was about how Sketchup will distinguish between update calls that don’t honor the hidden object/geometry split in 2020. But I think that only would be an issue if you passed a bitcode as the argument to update?

I am assuming that using update without an argument would update EVERYTHING about a page, no?

EDIT: You are semi-correct … the answer is KIND OF.

A good lesson in not assuming things. A page object has update flags.
There are setters for these flags, such as #use_camera=,
… and boolean getters, such as use_camera?.

The #update method lets you update a scene page targeting specific flags as those flags are set.

But if you call #update without a numeric argument, then all the flags as set (ie, as you see them checked in the Scenes inspector) for that scene page, will be used.

This can be a bit confusing (as it just confused me.) If the #use_camera? flag is set false by unchecking the “Camera Location” box in the Scenes inspector, then no amount of calling page.update(1) will update the camera location for that scene.

1 Like