|
SketchUp Ruby API Reference |
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
The camera method retrieves the camera for a particular page.
camera = page.camera
camera – a Camera object if successful, nil if the page does not save camera information
model = Sketchup.active_model
pages = model.pages
page = pages.add “My Page”
camera = page.camera
The delay_time method retrieves the amount of time, in seconds, that a page will be displayed (before transition to another page).
time = page.delay_time
time – the number of seconds of delay
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.
model = Sketchup.active_model
pages = model.pages
page = page.add “My Page”
time = page.delay_time
The delay_time= method sets the amount of time, in seconds, that a page will be displayed (before transitioning to another page).
time = page.delay_time=seconds
seconds – the number of seconds to set as the delay time.
time – the number of seconds of delay
The delay can be modified in the Model Info > Tourguide panel of the SketchUp User Interface.
model = Sketchup.active_model
pages = model.pages
page = page.add “My Page”
time = page.delay_time=10
The description method retrieves the description for a page as found in the Window > Pages manager.
description = page.description
description – a textual description for the page.
model = Sketchup.active_model
pages = model.pages
page = page.add “My Page”
description = page.description
The description method sets the description for a page as found in the Window > Pages manager.
description = page.description “description”
description – a string description for the page
description – the new string description for the page
model = Sketchup.active_model
pages = model.pages
page = page.add “My Page”
description = page.description=”This is my first page”
The hidden_entities method retrieves all hidden entities within a page.
entities = page.hidden_entities
entities – an Entities object containing hidden entities on the page.
model = Sketchup.active_model
pages = model.pages
page = page.add “My Page”
entities = page.hidden_entities
The label method retrieves the label for a page from the page tab.
label = page.label
label – a string label for the page tab
model = Sketchup.active_model
pages = model.pages
page = page.add “My Page”
lable = page.label
The layers method retrieves the layers associated with a page.
layers = page.layers
layers = a Layers object with zero or more layers.
model = Sketchup.active_model
pages = model.pages
page = page.add “My Page”
layers = page.layers
The name method retrieves the name for a page from the page tab.
name = page.name
label – a string name for the page tab
model = Sketchup.active_model
pages = model.pages
page = page.add “My Page”
name= page.name
The name= method sets the name for a page’s tab
name = page.name=”name”
“name” – the name of the page to be set
name – the name that you have set
model = Sketchup.active_model
pages = model.pages
page = page.add “My Page” # We change the page name below
name = page.name=”Your Page”
The rendering_options method retrieves a RenderingOptions object for the page.
renderingoptions = page.rendering_options
renderingoptions – a RenderingOptions object
model = Sketchup.active_model
pages = model.pages
page = page.add “My Page”
renderingoptions = page.rendering_options
The set_visibility method sets the visibility for a layer on a page.
page = page.set_visibility layer visibility
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.
page – the page whose visibility was set.
model = Sketchup.active_model
pages = model.pages
page = pages.add "My Page"
page = page.set_visibility
The style method retrieves the style associated with the page.
style = page.style
style – the Style object if successful
The shadow_info method retrieves the ShadowInfo object for the page.
shadowinfo = page.shadow_info
shadowinfo - a ShadowInfo object if successful, nil if the page does not save shadow information
model = Sketchup.active_model
pages = model.pages
page = pages.add "My Page"
shadowinfo = page.shadow_info
transitiontime = page.transition_time
transitiontime - the amount of time it takes to transition to this page during a slideshow or animation export.
The default transition time is used if this value is equal to -1.
model = Sketchup.active_model
pages = model.pages
page = pages.add "My Page"
time = page.transition_time
The transition_time= method is used to set the transition time.
transitiontime = page.transition_time = transitiontime
transitiontime - the transition time in seconds
transitiontime - the new transition time
model = Sketchup.active_model
pages = model.pages
page = pages.add "My Page"
time = page.transition_time=20
The update method performs an update on the page properties
status = page.update
status - true if successful, false if unsuccessful
model = Sketchup.active_model
pages = model.pages
page = pages.add "My Page"
status = page.update
The use_axes= method sets the page to store the axes property.
status = page.use_axes = pagesetting
pagesetting - true if you want your page to save this property, false if you do not want your page to save this property.
status - true if you are saving the property, false if you are not saving the property.
model = Sketchup.active_model
pages = model.pages
page = pages.add "My Page"# Set use_axes to falsestatus = page.use_axes=false
The use_axes? method determines whether you are storing the axes property with the page.
status = page.use_axes?
status - true if you are storing the this property with the page, false if you are not storing this property with the page.
model = Sketchup.active_model
pages = model.pages
page = pages.add "My Page"
status = page.use_axes?
The use_camera= method sets the page to store the camera property.
status = page.use_camera = setting
setting - true if you want your page to save this property, false if you do not want your page to save this property.
status - true if you are saving the property, false if you are not saving the property.
model = Sketchup.active_model
pages = model.pages
page = pages.add "My Page"
status = page.use_camera=false
The use_camera? method determines whether you are storing the camera property with the page.
status = page.use_camera?
status - true if you are storing the this property with the page, false if you are not storing this property with the page.
model = Sketchup.active_model
pages = model.pages
page = pages.add "My Page"status = page.use_camera
use_hidden=
The use_hidden= method sets the page to store the hidden property.
status = page.use_hidden = setting
setting - true if you want your page to save this property, false if you do not want your page to save this property.
status - true if you are saving the property, false if you are not saving the property.
model = Sketchup.active_model
pages = model.pages
page = pages.add "My Page"
status = page.use_hidden=false
The use_hidden? method determines whether you are storing the hidden property with the page.
status = page.use_hidden?
status - true if you are storing the this property with the page, false if you are not storing this property with the page.
model = Sketchup.active_model
pages = model.pages
page = pages.add "My Page"
status = page.use_hidden
The use_hidden_layers= method sets the page to store the hidden layers property.
status = page.use_hidden_layers = setting
setting - true if you want your page to save this property, false if you do not want your page to save this property.
status - true if you are saving the property, false if you are not saving the property.
model = Sketchup.active_model
pages = model.pages
page = pages.add "My Page"status = page.use_hidden_layers=false
The use_hidden_layers? method determines whether you are storing the hidden layers property with the page.
status = page.use_hidden_layers?
status - true if you are storing the this property with the page, false if you are not storing this property with the page.
model = Sketchup.active_model
pages = model.pages
page = pages.add "My Page"
status = page.use_hidden_layers
The use_rendering_optoins= method sets the page to store the display settings property.
status = page.use_rendering_optoins = setting
setting - true if you want your page to save this property, false if you do not want your page to save this property.
model = Sketchup.active_model
pages = model.pages
page = pages.add "My Page"
status = page.use_rendering_options=false
The use_rendering_options? method determines whether you are storing the rendering options property with the page.
status = page.use_rendering_options?
status - true if you are storing the this property with the page, false if you are not storing this property with the page.
model = Sketchup.active_model
pages = model.pages
page = pages.add "My Page"
status = page.use_rendering_options
The use_section_planes= method sets the page to store the section planes property.
status = page.use_section_planes = setting
setting - true if you want your page to save this property, false if you do not want your page to save this property.
status - true if you are saving the property, false if you are not saving the property.
model = Sketchup.active_model
pages = model.pages
page = pages.add "My Page"
status = page.use_section_planes=false
The use_section_planes? method determines whether you are storing the section planes property with the page.
status = page.use_section_planes?
status - true if you are storing the this property with the page, false if you are not storing this property with the page.
model = Sketchup.active_model
pages = model.pages
page = pages.add "My Page"
status = page.use_section_planes
The use_shadow_info= method sets the page to store the shadow info property.
status = page.use_shadow_info = setting
setting - true if you want your page to save this property, false if you do not want your page to save this property.
status - true if you are saving the property, false if you are not saving the property.
model = Sketchup.active_model
pages = model.pages
page = pages.add "My Page"
status = page.use_shadow_info=false
The use_shadow_info? method determines whether you are storing the shadow info property with the page.
status = page.use_shadow_info?
status - true if you are storing the this property with the page, false if you are not storing this property with the page.
model = Sketchup.active_model
pages = model.pages
page = pages.add "My Page"
status = page.use_shadow_info
The use_style= method sets the style to be used by the page.
page.use_style=style
style – the Style object to use.
The use_style? retrieves the style used by the page.
Style page.use_style?
style – the Style object being used.
|
SketchUp Ruby API Reference: Page |
© Google Inc. 2007 sketchup.google.com |