I have something like this:
Sketchup.active_model.pages.add('Main')
# scena rzut
page = Sketchup.active_model.pages.add('Top')
Sketchup.send_action('viewTop:')
Sketchup.active_model.active_view.zoom_extents
page.update
page.update(1)
And after this view in scene Top is the same like in the scene Main (iso view)
You need to wait for the UI to change the view.
Kernel.sleep(0.5) # more if model is complex
OR,⌠use a ViewObserer
to trigger the scene update call.
OR, use a timer:
UI::start_timer(0.5,false) { page.update(1) }
Dan,
it works for:
Sketchup.active_model.pages.add(âMainâ)
# scena rzut
page = Sketchup.active_model.pages.add(âTopâ)
Sketchup.active_model.active_view.zoom_extents
Sketchup::send_action(âviewTop:â)
UI::start_timer(0.5,false) { page.update(1) }
but doesnât work for:
Sketchup.active_model.pages.add('Main')
# scena rzut
page = Sketchup.active_model.pages.add('Top')
Sketchup.active_model.active_view.zoom_extents
Sketchup::send_action("viewTop:")
UI::start_timer(0.5,false) { page.update(1) }
page = Sketchup.active_model.pages.add(âLeftâ)
Sketchup.send_action(âviewLeft:â)
Sketchup.active_model.active_view.zoom_extents
UI::start_timer(0.5,false) { page.update(1) }
Page âLeftâ is OK but âTopâ Is not.
Or, try this:
Sketchup::send_action(âviewTop:â)
Kernel.sleep(5)
changing view into top is making after 5 sec.
Iâve asked you before to properly format code in the forums:
```ruby
# code
```
Using lines beginning with > is a quotation, not a code block.
You will have to be more creative, and wait until the first page update is done, before reusing the page
reference, and changing the page again. You may need to use a FrameChangeObserver
in combination with a ViewObserver
.
Try temporarily setting the transition time to zero before setting the view and updating the page, and then reset the transition time. Just a thoughtâŚ
1 Like
Thanks, Jim.
I tried it, but doesnât work.