SketchUp  Ruby API Reference 

Class Index

Method Index

Developers Guide

Examples

Page class

 

The Page class contains methods to extract information and modify the properties of an individual page. 

Parent:Entity 

Methods: camera, delay_time, delay_time=, description, description=, hidden_entities, label, layers, name, name=, rendering_options, set_visibility, shadow_info, style, transition_time, transition_time=, update, use_axes=, use_axes?, use_camera=, use_camera?, use_hidden=, use_hidden?, use_hidden_layers=, use_hidden_layers?, use_rendering_options=, use_rendering_options?, use_section_planes=, use_section_planes?, use_shadow_info=, use_shadow_info?, use_style=, use_style?

Example Code: pagetests.rb

Instance Methods


camera

The camera method retrieves the camera for a particular page.

Syntax

camera = page.camera

Return Value

camera – a Camera object if successful, nil if the page does not save camera information

Example 

model = Sketchup.active_model
pages = model.pages
page = pages.add “My Page”
camera = page.camera

 

 


delay_time

The delay_time method retrieves the amount of time, in seconds, that a page will be displayed (before transition to another page).

Syntax

time = page.delay_time

Return Value

time – the number of seconds of delay

Comments

The delay can be modified in the Model Info > Tourguide panel of the SketchUp User Interface. If this method returns –1, the default delay time of 3.5 seconds is used.

 Example

model = Sketchup.active_model
pages = model.pages
page = page.add “My Page”
time = page.delay_time


 


delay_time=

The delay_time= method sets the amount of time, in seconds, that a page will be displayed (before transitioning to another page).

Syntax

time = page.delay_time=seconds

Arguments

seconds – the number of seconds to set as the delay time.

Return Value

time – the number of seconds of delay

Comments

The delay can be modified in the Model Info > Tourguide panel of the SketchUp User Interface.

 Example

model = Sketchup.active_model
pages = model.pages
page = page.add “My Page”
time = page.delay_time=10

 

 


description

The description method retrieves the description for a page as found in the Window > Pages manager.

Syntax

description = page.description

Return Value

description – a textual description for the page.

Example

model = Sketchup.active_model
pages = model.pages
page = page.add “My Page”
description = page.description

 

 


description=

The description method sets the description for a page as found in the Window > Pages manager.

Syntax

description = page.description “description”

Arguments

description – a string description for the page

Return Value

description – the new string description for the page

Example

model = Sketchup.active_model
pages = model.pages
page = page.add “My Page”
description = page.description=”This is my first page”

 

 


hidden_entities 

The hidden_entities method retrieves all hidden entities within a page.

Syntax

entities = page.hidden_entities

Return Value

entities – an Entities object containing hidden entities on the page.

Example

model = Sketchup.active_model
pages = model.pages
page = page.add “My Page”
entities = page.hidden_entities

 

 


label 

The label method retrieves the label for a page from the page tab.

Syntax

label = page.label

Return Value

label – a string label for the page tab

Example 

model = Sketchup.active_model
pages = model.pages
page = page.add “My Page”
lable = page.label

 

 


layers 

The layers method retrieves the layers associated with a page.

Syntax

layers = page.layers

Return Value

layers = a Layers object with zero or more layers.

Example

model = Sketchup.active_model
pages = model.pages
page = page.add “My Page”
layers = page.layers

 

 


name

The name method retrieves the name for a page from the page tab.

Syntax

name = page.name

Return Value

label – a string name for the page tab

Example

model = Sketchup.active_model
pages = model.pages
page = page.add “My Page”
name= page.name

 

 


name= 

The name= method sets the name for a page’s tab

Syntax

name = page.name=”name”

Arguments

“name” – the name of the page to be set

Return Value

name – the name that you have set

Example 

model = Sketchup.active_model
pages = model.pages
page = page.add “My Page” # We change the page name below
name = page.name=”Your Page”

 

 


rendering_options 

The rendering_options method retrieves a RenderingOptions object for the page.

Syntax

renderingoptions = page.rendering_options

Return Value

renderingoptions – a RenderingOptions object

Example

model = Sketchup.active_model
pages = model.pages
page = page.add “My Page”
renderingoptions = page.rendering_options

 

 


set_visibility 

The set_visibility method sets the visibility for a layer on a page.

Syntax

page = page.set_visibility layer visibility

Arguments

layer – the layer whose visibility you are setting

visibility – true if you want items on the layer to be visible, false if you do not want items visible.

Return Value

page – the page whose visibility was set.

Example 

model = Sketchup.active_model
pages = model.pages
page = pages.add "My Page"
page = page.set_visibility

 

 

style

The style method retrieves the style associated with the page.

Syntax

style = page.style

Return Value

style – the Style object if successful

Example

 

 

 


shadow_info 

The shadow_info method retrieves the ShadowInfo object for the page.

Syntax

shadowinfo = page.shadow_info

Return Value

shadowinfo - a ShadowInfo object if successful, nil if the page does not save shadow information

Example

model = Sketchup.active_model
pages = model.pages
page = pages.add "My Page"
shadowinfo = page.shadow_info  

 

 


transition_time 

Syntax

transitiontime = page.transition_time 
 

Return Value

transitiontime - the amount of time it takes to transition to this page during a slideshow or animation export.

Comments

The default transition time is used if this value is equal to -1.

Example

model = Sketchup.active_model
pages = model.pages
page = pages.add "My Page"
time = page.transition_time

 

 


transition_time= 

The transition_time= method is used to set the transition time.

Syntax

transitiontime = page.transition_time = transitiontime

Arguments

transitiontime - the transition time in seconds

Return Value

transitiontime - the new transition time

Example

model = Sketchup.active_model
pages = model.pages
page = pages.add "My Page"
time = page.transition_time=20

 

 


update 

The update method performs an update on the page properties

Syntax

status = page.update

Return Value

status - true if successful, false if unsuccessful

Example

model = Sketchup.active_model
pages = model.pages
page = pages.add "My Page"
status = page.update    

 

 


use_axes=       

The use_axes= method sets the page to store the axes property.

Syntax

status = page.use_axes = pagesetting

Arguments

pagesetting - true if you want your page to save this property, false if you do not want your page to save this property.

Return Value

status - true if you are saving the property, false if you are not saving the property.

 Example

model = Sketchup.active_model
pages = model.pages
page = pages.add "My Page"
# Set use_axes to false
status = page.use_axes=false  

 

 


use_axes? 

The use_axes? method determines whether you are storing the axes property with the page.

Syntax

status = page.use_axes?

Return Value

status - true if you are storing the this property with the page, false if you are not storing this property with the page.

Example

model = Sketchup.active_model
pages = model.pages
page = pages.add "My Page"
status = page.use_axes?      

 

 


use_camera=     

The use_camera= method sets the page to store the camera property.

Syntax

status = page.use_camera = setting

Arguments

setting - true if you want your page to save this property, false if you do not want your page to save this property.

Return Value

status - true if you are saving the property, false if you are not saving the property.

Example 

model = Sketchup.active_model
pages = model.pages
page = pages.add "My Page"
status = page.use_camera=false  

 

 


use_camera? 

The use_camera? method determines whether you are storing the camera property with the page.

Syntax

status = page.use_camera?

Return Value

status - true if you are storing the this property with the page, false if you are not storing this property with the page.

Example

model = Sketchup.active_model
pages = model.pages
page = pages.add "My Page"
status = page.use_camera

 


use_hidden= 


use_hidden=

The use_hidden= method sets the page to store the hidden property.

Syntax

status = page.use_hidden = setting 

Arguments

setting  - true if you want your page to save this property, false if you do not want your page to save this property.

Return Value

status - true if you are saving the property, false if you are not saving the property.

 Example

model = Sketchup.active_model
pages = model.pages
page = pages.add "My Page"
status = page.use_hidden=false

 

 


use_hidden?    

The use_hidden? method determines whether you are storing the hidden property with the page.

Syntax

status = page.use_hidden?

Return Value

status - true if you are storing the this property with the page, false if you are not storing this property with the page.

Example

model = Sketchup.active_model
pages = model.pages
page = pages.add "My Page"
status = page.use_hidden  

 

 


use_hidden_layers=         

The use_hidden_layers= method sets the page to store the hidden layers property.

Syntax

status = page.use_hidden_layers = setting 
 

Arguments

setting  - true if you want your page to save this property, false if you do not want your page to save this property.

Return Value

status - true if you are saving the property, false if you are not saving the property.

Example

model = Sketchup.active_model
pages = model.pages
page = pages.add "My Page"
status = page.use_hidden_layers=false

 

 


use_hidden_layers?

The use_hidden_layers? method determines whether you are storing the hidden layers property with the page.

Syntax

status = page.use_hidden_layers?

Return Value

status - true if you are storing the this property with the page, false if you are not storing this property with the page.

Example

model = Sketchup.active_model
pages = model.pages
page = pages.add "My Page"
status = page.use_hidden_layers

 

 


use_rendering_options=          

The use_rendering_optoins= method sets the page to store the display settings property.

Syntax

status = page.use_rendering_optoins = setting 

Arguments

setting  - true if you want your page to save this property, false if you do not want your page to save this property.

Return Value

status - true if you are saving the property, false if you are not saving the property.

Example

model = Sketchup.active_model
pages = model.pages
page = pages.add "My Page"
status = page.use_rendering_options=false

 

 


use_rendering_options? 

The use_rendering_options? method determines whether you are storing the rendering options property with the page.

Syntax

status = page.use_rendering_options?

Return Value

status - true if you are storing the this property with the page, false if you are not storing this property with the page.

Example

model = Sketchup.active_model
pages = model.pages
page = pages.add "My Page"
status = page.use_rendering_options

 

 


use_section_planes= 

The use_section_planes= method sets the page to store the section planes property.

Syntax

status = page.use_section_planes = setting 
 

Arguments

setting - true if you want your page to save this property, false if you do not want your page to save this property.

Return Value

status - true if you are saving the property, false if you are not saving the property.

Example

model = Sketchup.active_model
pages = model.pages
page = pages.add "My Page"
status = page.use_section_planes=false

 

 


use_section_planes?

The use_section_planes? method determines whether you are storing the section planes property with the page.

Syntax

status = page.use_section_planes?

Return Value

status - true if you are storing the this property with the page, false if you are not storing this property with the page.

Example

model = Sketchup.active_model
pages = model.pages
page = pages.add "My Page"
status = page.use_section_planes

 

 


use_shadow_info= 

The use_shadow_info= method sets the page to store the shadow info property.

Syntax

status = page.use_shadow_info = setting 
 

Arguments

setting - true if you want your page to save this property, false if you do not want your page to save this property.

Return Value

status - true if you are saving the property, false if you are not saving the property.

Example

model = Sketchup.active_model
pages = model.pages
page = pages.add "My Page"
status = page.use_shadow_info=false

 

 


use_shadow_info? 

The use_shadow_info? method determines whether you are storing the shadow info property with the page.

Syntax

status = page.use_shadow_info?

Return Value

status - true if you are storing the this property with the page, false if you are not storing this property with the page.

Example 

model = Sketchup.active_model
pages = model.pages
page = pages.add "My Page"
status = page.use_shadow_info

 

 


use_style= 

The use_style= method sets the style to be used by the page.

Syntax

page.use_style=style

Arguments

style – the Style object to use.

Example

 

 

 


use_style?  

The use_style? retrieves the style used by the page.

Syntax

Style page.use_style?

Return Value

style – the Style object being used.

Example