Class: Sketchup::Pages
- Includes:
- Enumerable
- Defined in:
- lib/sketchup-api-stubs/stubs/Sketchup/Pages.rb
Overview
The Pages class contains methods for manipulating a collection of Pages (Named “scenes” in the UI.) in a model.
You get a handle to this collection by calling Model.pages.
Constant Summary collapse
- ImageEmbedded =
Constants
nil
- ImageEmbeddedAndLinked =
Stub value.
nil
- ImageLinked =
Stub value.
nil
- UnitsNormalizedX =
Stub value.
nil
- UnitsNormalizedY =
Stub value.
nil
- UnitsPixels =
Stub value.
nil
Class Method Summary collapse
-
.add_frame_change_observer(object) ⇒ Integer
The Pages.add_frame_change_observer method is used to add a new frame change observer that is called with each frame of an animation, meaning the end user has clicked on a Scene tab (aka Page) inside SketchUp and the camera is animating to that scene.
-
.remove_frame_change_observer(observer_id) ⇒ Boolean
The Pages.remove_frame_change_observer method is used to remove a frame change observer.
Instance Method Summary collapse
-
#[](index_or_name) ⇒ Object
The [] method retrieves a page by either name or index.
-
#add(name = nil, flags = PAGE_USE_ALL, index = self.size) ⇒ Sketchup::Page
The #add method is used to add a new Page object to the collection.
-
#add_matchphoto_page(image_filename, camera = nil, page_name = nil) ⇒ Sketchup::Page
The #add_matchphoto_page method is used to add a photomatch page to the model.
-
#add_observer(observer) ⇒ Object
The add_observer method is used to add an observer to the Pages object.
- #count ⇒ Integer
-
#each {|page| ... } ⇒ nil
The #each method is used to iterate through pages in the model.
-
#erase(page) ⇒ Boolean
The #erase method is used to remove a page from the collection.
- #length ⇒ Integer
-
#parent ⇒ Object
The parent method is used to determine the model for the Pages collection.
-
#remove_observer(observer) ⇒ Object
The remove_observer method is used to remove an observer from the current object.
-
#selected_page ⇒ Object
The selected_page method is used to retrieve the currently selected page.
-
#selected_page=(page) ⇒ Object
The selected_page method is used to set the currently selected page.
-
#show_frame_at(seconds) ⇒ Array(Sketchup::Page, Float)?
The #show_frame_at method is used to show a frame in animation (of the slide show) at a given time in seconds.
-
#size ⇒ Integer
The #size method is used to retrieve the number of pages.
-
#slideshow_time ⇒ Object
The slideshow_time method is used to get the amount of time that a slideshow of all of the pages will take.
Methods inherited from Entity
#attribute_dictionaries, #attribute_dictionary, #delete_attribute, #deleted?, #entityID, #get_attribute, #inspect, #model, #persistent_id, #set_attribute, #to_s, #typename, #valid?
Class Method Details
.add_frame_change_observer(object) ⇒ Integer
The add_frame_change_observer method is used to add a new frame change observer that is called with each frame of an animation, meaning the end user has clicked on a Scene tab (aka Page) inside SketchUp and the camera is animating to that scene.
The method returns an integer id that can be stored and later used to remove the observer with the remove_frame_change_observer method.
57 58 |
# File 'lib/sketchup-api-stubs/stubs/Sketchup/Pages.rb', line 57 def self.add_frame_change_observer(object) end |
.remove_frame_change_observer(observer_id) ⇒ Boolean
The remove_frame_change_observer method is used to remove a frame change observer
72 73 |
# File 'lib/sketchup-api-stubs/stubs/Sketchup/Pages.rb', line 72 def self.remove_frame_change_observer(observer_id) end |
Instance Method Details
#[](index_or_name) ⇒ Object
The [] method retrieves a page by either name or index.
97 98 |
# File 'lib/sketchup-api-stubs/stubs/Sketchup/Pages.rb', line 97 def [](index_or_name) end |
#add(name = nil, flags = PAGE_USE_ALL, index = self.size) ⇒ Sketchup::Page
The #add method is used to add a new Page object to the collection.
If no name is given, then a new name is generated using the default name for new Pages. If a name is given, then a new Page with that name is added.
If the flags parameter is given, it controls which properties are saved with the Page. See the Sketchup::Page#update method for a description of the flags that can be set.
If index is given, it specifies the position in the page list that the new page is added. Otherwise the new page is added to the end.
136 137 |
# File 'lib/sketchup-api-stubs/stubs/Sketchup/Pages.rb', line 136 def add(name = nil, flags = PAGE_USE_ALL, index = self.size) end |
#add_matchphoto_page(image_filename, camera = nil, page_name = nil) ⇒ Sketchup::Page
The #add_matchphoto_page method is used to add a photomatch page to the model. This is an advanced feature that was added to support internal SketchUp work, so it is unlikely to be useful to you.
157 158 |
# File 'lib/sketchup-api-stubs/stubs/Sketchup/Pages.rb', line 157 def add_matchphoto_page(image_filename, camera = nil, page_name = nil) end |
#add_observer(observer) ⇒ Object
The add_observer method is used to add an observer to the Pages object. See the PagesObserver interface for more details.
173 174 |
# File 'lib/sketchup-api-stubs/stubs/Sketchup/Pages.rb', line 173 def add_observer(observer) end |
#count ⇒ Integer
192 193 |
# File 'lib/sketchup-api-stubs/stubs/Sketchup/Pages.rb', line 192 def count end |
#each {|page| ... } ⇒ nil
The #each method is used to iterate through pages in the model.
209 210 |
# File 'lib/sketchup-api-stubs/stubs/Sketchup/Pages.rb', line 209 def each end |
#erase(page) ⇒ Boolean
The #erase method is used to remove a page from the collection.
223 224 |
# File 'lib/sketchup-api-stubs/stubs/Sketchup/Pages.rb', line 223 def erase(page) end |
#length ⇒ Integer
239 240 |
# File 'lib/sketchup-api-stubs/stubs/Sketchup/Pages.rb', line 239 def length end |
#parent ⇒ Object
The parent method is used to determine the model for the Pages collection.
254 255 |
# File 'lib/sketchup-api-stubs/stubs/Sketchup/Pages.rb', line 254 def parent end |
#remove_observer(observer) ⇒ Object
The remove_observer method is used to remove an observer from the current object. See the PagesObserver interface for more details.
270 271 |
# File 'lib/sketchup-api-stubs/stubs/Sketchup/Pages.rb', line 270 def remove_observer(observer) end |
#selected_page ⇒ Object
The selected_page method is used to retrieve the currently selected page.
285 286 |
# File 'lib/sketchup-api-stubs/stubs/Sketchup/Pages.rb', line 285 def selected_page end |
#selected_page=(page) ⇒ Object
The selected_page method is used to set the currently selected page. Once you set this, SketchUp will animate to that page as if the user had clicked on its scene tab.
304 305 |
# File 'lib/sketchup-api-stubs/stubs/Sketchup/Pages.rb', line 304 def selected_page=(page) end |
#show_frame_at(seconds) ⇒ Array(Sketchup::Page, Float)?
In versions prior to SketchUp 2019 this method will crash if called when there are no pages in the model.
The #show_frame_at method is used to show a frame in animation (of the slide show) at a given time in seconds.
328 329 |
# File 'lib/sketchup-api-stubs/stubs/Sketchup/Pages.rb', line 328 def show_frame_at(seconds) end |
#size ⇒ Integer
The #size method is used to retrieve the number of pages.
344 345 |
# File 'lib/sketchup-api-stubs/stubs/Sketchup/Pages.rb', line 344 def size end |
#slideshow_time ⇒ Object
The slideshow_time method is used to get the amount of time that a slideshow of all of the pages will take. This takes into account the transition time for each Page and the amount of time that each Page is displayed.
358 359 |
# File 'lib/sketchup-api-stubs/stubs/Sketchup/Pages.rb', line 358 def end |