123456789_123456789_123456789_123456789_123456789_

Class: Layout::Page

Relationships
Inherits: Object

Overview

Class for a single page in a LayOut document.

Version:

  • LayOut 2018

Instance Attribute Summary

Instance Method Summary

Instance Attribute Details

#in_presentation=(in_presentation) (rw)

The #in_presentation= method sets whether the Page is included in presentations.

Examples:

doc = Layout::Document.open("C:/path/to/document.layout")
first_page = doc.pages.first
first_page.in_presentation = true

Parameters:

  • in_presentation (Boolean)

Version:

  • LayOut 2018

#in_presentation?Boolean (rw)

The #in_presentation? method returns whether the Page is included in presentations.

Examples:

doc = Layout::Document.open("C:/path/to/document.layout")
first_page = doc.pages.first
in_presentation = first_page.in_presentation?

Version:

  • LayOut 2018

#nameString (rw)

The #name method returns the name of the Page.

Examples:

doc = Layout::Document.open("C:/path/to/document.layout")
pages = doc.pages
first_page_name = pages.first.name

Version:

  • LayOut 2018

#name=(name) (rw)

The #name= method sets the name of a page.

Examples:

doc = Layout::Document.open("C:/path/to/document.layout")
pages = doc.pages
pages.first.name = "First page"

Parameters:

Raises:

  • (ArgumentError)

    if name is an empty string

Version:

  • LayOut 2018

Instance Method Details

#==(other) ⇒ Boolean

The #== method checks to see if the two Pages are equal. This checks whether the Ruby Objects are pointing to the same internal object.

Examples:

doc = Layout::Document.open("C:/path/to/document.layout")
document = doc.pages.first.document
doc.pages.first == document.pages.first

Parameters:

  • other (Page)

Version:

  • LayOut 2018

#documentLayout::Document

The #document method returns the Document that the Page belongs to.

Examples:

doc = Layout::Document.open("C:/path/to/document.layout")
first_page = doc.pages.first
# page_doc should reference the same document as doc
page_doc = first_page.document

Version:

  • LayOut 2018

#entitiesLayout::Entities

The #entities method returns all Entitys that are on the Page. This is the equivalent of iterating over all LayerInstances and using Layout::LayerInstance.entities.

Examples:

doc = Layout::Document.open("C:/path/to/document.layout")
first_page = doc.pages.first
entities = first_page.entities

Version:

  • LayOut 2018

#layer_instancesArray<Layout::LayerInstance>

The #layer_instances method returns an array of the LayerInstances for the Page.

Examples:

# An example of page.layer_instances

Version:

  • LayOut 2018

#layer_visible?(layer) ⇒ Boolean

The #layer_visible? method returns whether a Layer is visible on the Page.

Examples:

doc = Layout::Document.open("C:/path/to/document.layout")
first_page = doc.pages.first
layer = doc.layers.first
visible = first_page.layer_visible?(layer)

Parameters:

Raises:

  • (ArgumentError)

    if layer and page are not in the same document

Version:

  • LayOut 2018

#nonshared_entitiesLayout::Entities

The #nonshared_entities method returns the Entities unique to the Page.

Examples:

doc = Layout::Document.open("C:/path/to/document.layout")
first_page = doc.pages.first
entities = first_page.nonshared_entities

Version:

  • LayOut 2018

#set_layer_visibility(layer, visible) ⇒ Boolean

The #set_layer_visibility method sets whether a Layer is visible on the Page.

Examples:

doc = Layout::Document.open("C:/path/to/document.layout")
first_page = doc.pages.first
layer = doc.layers.first
first_page.set_layer_visibility(layer, false)

Parameters:

Raises:

  • (ArgumentError)

    if layer and page are not in the same document

  • (ArgumentError)

    if layer could not be hidden because there must be at least one unlocked, visible layer on each page

Version:

  • LayOut 2018