2018 UI not updating when using include_in_animation from console

I am having troubles getting feedback from the user interface when I include scenes from the ruby console. I was using the following…

model = Sketchup.active_model
pages = model.pages
pages.selected_page.include_in_animation = false

This seems to be functioning, though the feedback from the UI is not encouraging.
The expected behavior I am missing would be the brackets (Scene) appearing around my scene name when the above is executed. Also the checkbox only updates when cycling through the scenes in the scene editor, though this is less of an issue.
Is there a refresh I should be using here?
I have found that after saving my file and opening it again the brackets appear correctly. This is why I was wondering about refresh. This is happening on a Windows 10 machine. I have not tested on Mac.

Ruby API Reference

try this twice…

Sketchup.send_action('togglePageTabsDsiplay:') ## Scene Tabs

and see if that updates them…

john

1 Like

For the scene tabs John’s “nugget” is apparently Mac ONLY. Ie, On Windows SU2016 …

Sketchup.send_action('togglePageTabsDsiplay:')
#=> false

For PC (Windows) you can use an automation integer ID thus:

Sketchup.send_action(10534)

so …

def refresh_page_tabs()
  Sketchup.send_action(10534)
  Sketchup.send_action(10534)
end

On Mac sometimes it is needed to refresh toolbars (but this is said to not be needed on Windows.)

For the Scenes Manager, I would suggest to try the API method:

Other than these, there is a refresh for the modeling viewport …

Sketchup::active_model.active_view.refresh
1 Like

Logged:

3 Likes

I had all but dismissed send actions, so that was a fun experiment. At this point, I am elated just to get as much function as I am with this API addition. I did not have too much success toggling the tabs via send actions, or manually through the UI.
At first I thought this was a typo:
(‘togglePageTabsDsiplay:’) vs (‘togglePageTabsDisplay:’)
But, after performing the same function manually realized there is more to the problem.

UI.refresh_inspectors did help the scene manager display properly, so I really appreciate this suggestion it was quite helpful. I also appreciate the follow through reporting the issue further, thanks Dan.

Sketchup.send_action(10534)

… seems to work for me. I also see all the inspectors get redrawn.

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.