Class: Sketchup::Page

Inherits:
Entity
  • Object
show all
Defined in:
SketchUp/Sketchup/Page.rb

Overview

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

Note that inside the SketchUp user interface pages are called “Scenes”.

Version:

  • SketchUp 6.0

Instance Method Summary collapse

Methods inherited from Entity

#add_observer, #attribute_dictionaries, #attribute_dictionary, #delete_attribute, #deleted?, #entityID, #get_attribute, #inspect, #model, #parent, #persistent_id, #remove_observer, #set_attribute, #to_s, #typename, #valid?

Instance Method Details

#axesObject

The axes method returns the drawing axes for the page.

Examples:

page = Sketchup.active_model.pages.add("Example Page")
xaxis = Geom::Vector3d.new(3, 5, 0)
yaxis = xaxis * Z_AXIS
page.axes.set([10,0,0], xaxis, yaxis, Z_AXIS)

Version:

  • SketchUp 2016



25
26
# File 'SketchUp/Sketchup/Page.rb', line 25

def axes
end

#cameraObject

The camera method retrieves the camera for a particular page.

Examples:

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

Version:

  • SketchUp 6.0



40
41
# File 'SketchUp/Sketchup/Page.rb', line 40

def camera
end

#delay_timeObject

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

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

Examples:

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

Version:

  • SketchUp 6.0



59
60
# File 'SketchUp/Sketchup/Page.rb', line 59

def delay_time
end

#delay_time=(seconds) ⇒ Object

The delay_time= method sets the amount of time, in seconds, that a page will be displayed before transitioning to another page during a tour. If you set the delay for a page to be -1, the default delay time will be used.

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

Examples:

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

Version:

  • SketchUp 6.0



81
82
# File 'SketchUp/Sketchup/Page.rb', line 81

def delay_time=(seconds)
end

#descriptionObject

The description method retrieves the description for a page as found in the Scenes manager dialog.

Examples:

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

Version:

  • SketchUp 6.0



96
97
# File 'SketchUp/Sketchup/Page.rb', line 96

def description
end

#description=(description) ⇒ Object

The description method sets the description for a page as found in the Scenes manager dialog.

Examples:

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

Version:

  • SketchUp 6.0



114
115
# File 'SketchUp/Sketchup/Page.rb', line 114

def description=(description)
end

#hidden_entitiesObject

The hidden_entities method retrieves all hidden entities within a page.

Examples:

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

Version:

  • SketchUp 6.0



129
130
# File 'SketchUp/Sketchup/Page.rb', line 129

def hidden_entities
end

#include_in_animation=(include) ⇒ Sketchup::Page

The #include_in_animation= method controls whether the page should be included when exporting an animation from the model.

Examples:

Turn off animation for all pages.

model = Sketchup.active_model
model.pages.each { |page|
  page.include_in_animation = false
}

Version:

  • SketchUp 2018



146
147
# File 'SketchUp/Sketchup/Page.rb', line 146

def include_in_animation=(include)
end

#include_in_animation?Boolean

The #include_in_animation? method determines whether the page should be included when exporting an animation from the model.

Examples:

Toggle inclusion in animation for all pages.

model = Sketchup.active_model
in_animation = model.pages.select { |page| page.include_in_animation? }

Version:

  • SketchUp 2018



161
162
# File 'SketchUp/Sketchup/Page.rb', line 161

def include_in_animation?
end

#labelObject

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

Examples:

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

Version:

  • SketchUp 6.0



175
176
# File 'SketchUp/Sketchup/Page.rb', line 175

def label
end

#layersObject

The layers method retrieves the non-visible layers associated with a page.

Examples:

model = Sketchup.active_model
pages = model.pages
page = pages.add "My Page"
layers = page.layers
# layers now contains the layers in the model that are
# set to non-visible on the page

Version:

  • SketchUp 6.0



191
192
# File 'SketchUp/Sketchup/Page.rb', line 191

def layers
end

#nameObject

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

Examples:

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

Version:

  • SketchUp 6.0



205
206
# File 'SketchUp/Sketchup/Page.rb', line 205

def name
end

#name=(name) ⇒ Object

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

Examples:

model = Sketchup.active_model
pages = model.pages
page = pages.add "My Page"
name = page.name = "Page Name"

Version:

  • SketchUp 6.0



222
223
# File 'SketchUp/Sketchup/Page.rb', line 222

def name=(name)
end

#rendering_optionsObject

The rendering_options method retrieves a RenderingOptions object for the page.

Examples:

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

Version:

  • SketchUp 6.0



237
238
# File 'SketchUp/Sketchup/Page.rb', line 237

def rendering_options
end

#set_visibility(layer, visibility) ⇒ Object

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

Examples:

model = Sketchup.active_model
pages = model.pages
page = pages.add "My Page"
layer = page.layers[0]
visibility = true
page = page.set_visibility layer, visibility

Version:

  • SketchUp 6.0



259
260
# File 'SketchUp/Sketchup/Page.rb', line 259

def set_visibility(layer, visibility)
end

#shadow_infoObject

The shadow_info method retrieves the ShadowInfo object for the page.

Examples:

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

Version:

  • SketchUp 6.0



274
275
# File 'SketchUp/Sketchup/Page.rb', line 274

def shadow_info
end

#styleObject

The style method retrieves the style associated with the page.

Examples:

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

Version:

  • SketchUp 6.0



288
289
# File 'SketchUp/Sketchup/Page.rb', line 288

def style
end

#transition_timeObject

Get the amount of time that it takes to transition to this page during a slideshow or animation export. If this value is -1, it means to use the default transition time.

Examples:

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

Version:

  • SketchUp 6.0



306
307
# File 'SketchUp/Sketchup/Page.rb', line 306

def transition_time
end

#transition_time=(trans_time) ⇒ Object

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

Examples:

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

Version:

  • SketchUp 6.0



323
324
# File 'SketchUp/Sketchup/Page.rb', line 323

def transition_time=(trans_time)
end

#update(flags) ⇒ Object

The update method performs an update on the page properties based on the current view that the user has. Which parts of the Page get updated are controlled via an integer whose bits represent which parts to update. You can determine the integer you need to pass by adding these numbers together:

- 1 - Camera Location,
- 2 - Drawing Style,
- 4 - Shadow Settings,
- 8 - Axes Location,
- 16 - Hidden Geometry,
- 32 - Visible Layers,
- 64 - Active Section Planes.

The bit code values are added together to provide the flags value. For example, to update the Camera Location, Axes Location, and Active Section Planes properties, the flag would be 73 (1 + 8 + 64).

Examples:

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

# Updates Camera Location (+1), Shadow Settings(+4),
# and Visible Layers (+32).
status = page.update(37)

Version:

  • SketchUp 6.0



359
360
# File 'SketchUp/Sketchup/Page.rb', line 359

def update(flags)
end

#use_axes=(pagesettings) ⇒ Object

The use_axes= method sets the page’s axes property.

Examples:

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

Version:

  • SketchUp 6.0



379
380
# File 'SketchUp/Sketchup/Page.rb', line 379

def use_axes=(pagesettings)
end

#use_axes?Boolean

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

Examples:

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

Version:

  • SketchUp 6.0



398
399
# File 'SketchUp/Sketchup/Page.rb', line 398

def use_axes?
end

#use_camera=(setting) ⇒ Object

The use_camera= method sets the page’s camera property.

Examples:

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

Version:

  • SketchUp 6.0



417
418
# File 'SketchUp/Sketchup/Page.rb', line 417

def use_camera=(setting)
end

#use_camera?Boolean

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

Examples:

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

Version:

  • SketchUp 6.0



436
437
# File 'SketchUp/Sketchup/Page.rb', line 436

def use_camera?
end

#use_hidden=(setting) ⇒ Object

The use_hidden= method sets the page’s hidden property.

Examples:

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

Version:

  • SketchUp 6.0



455
456
# File 'SketchUp/Sketchup/Page.rb', line 455

def use_hidden=(setting)
end

#use_hidden?Boolean

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

Examples:

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

Version:

  • SketchUp 6.0



474
475
# File 'SketchUp/Sketchup/Page.rb', line 474

def use_hidden?
end

#use_hidden_layers=(setting) ⇒ Object

The use_hidden_layers= method sets the page’s hidden layers property.

Examples:

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

Version:

  • SketchUp 6.0



494
495
# File 'SketchUp/Sketchup/Page.rb', line 494

def use_hidden_layers=(setting)
end

#use_hidden_layers?Boolean

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

Examples:

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

Version:

  • SketchUp 6.0



513
514
# File 'SketchUp/Sketchup/Page.rb', line 513

def use_hidden_layers?
end

#use_rendering_options=(setting) ⇒ Object

The use_rendering_optoins= method sets the page’s display settings property.

Examples:

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

Version:

  • SketchUp 6.0



533
534
# File 'SketchUp/Sketchup/Page.rb', line 533

def use_rendering_options=(setting)
end

#use_rendering_options?Boolean

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

Examples:

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

Version:

  • SketchUp 6.0



552
553
# File 'SketchUp/Sketchup/Page.rb', line 552

def use_rendering_options?
end

#use_section_planes=(setting) ⇒ Object

The use_section_planes= method sets the page’s section planes property.

Examples:

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

Version:

  • SketchUp 6.0



572
573
# File 'SketchUp/Sketchup/Page.rb', line 572

def use_section_planes=(setting)
end

#use_section_planes?Boolean

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

Examples:

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

Version:

  • SketchUp 6.0



591
592
# File 'SketchUp/Sketchup/Page.rb', line 591

def use_section_planes?
end

#use_shadow_info=(setting) ⇒ Object

The use_shadow_info= method sets the page’s shadow info property.

Examples:

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

Version:

  • SketchUp 6.0



610
611
# File 'SketchUp/Sketchup/Page.rb', line 610

def use_shadow_info=(setting)
end

#use_shadow_info?Boolean

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

Examples:

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

Version:

  • SketchUp 6.0



629
630
# File 'SketchUp/Sketchup/Page.rb', line 629

def use_shadow_info?
end

#use_style=(style) ⇒ Object

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

Examples:

model = Sketchup.active_model
pages = model.pages
page = pages.add "My Page"
style = model.styles[0]
page.use_style = style

Version:

  • SketchUp 6.0



647
648
# File 'SketchUp/Sketchup/Page.rb', line 647

def use_style=(style)
end

#use_style?Boolean

The use_style? method determines whether storing a style with the page.

Examples:

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

Version:

  • SketchUp 6.0



665
666
# File 'SketchUp/Sketchup/Page.rb', line 665

def use_style?
end