Class: Layout::Page

Inherits:
Object
  • Object
show all

Overview

Class for a single page in a LayOut document.

Version:

  • LayOut 2018

Instance Method Summary # collapse

Instance Method Details

#==(other) ⇒ Boolean

The #== method checks to see if the two Layout::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:

Returns:

  • (Boolean)

Version:

  • LayOut 2018

#documentLayout::Document

The #document method returns the Document that the Layout::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

Returns:

Version:

  • LayOut 2018

#entitiesLayout::Entities

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

Examples:

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

Returns:

Version:

  • LayOut 2018

#in_presentation=(in_presentation) ⇒ Object

The #in_presentation= method sets whether the Layout::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

The #in_presentation? method returns whether the Layout::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?

Returns:

  • (Boolean)
  • (Boolean)

Version:

  • LayOut 2018

#layer_instancesArray<Layout::LayerInstance>

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

Examples:

# An example of page.layer_instances

Returns:

Version:

  • LayOut 2018

#layer_visible?(layer) ⇒ Boolean

The #layer_visible? method returns whether a Layer is visible on the Layout::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:

Returns:

  • (Boolean)
  • (Boolean)

Raises:

  • (ArgumentError)

    if layer and page are not in the same document

Version:

  • LayOut 2018

#nameString

The #name method returns the name of the Layout::Page.

Examples:

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

Returns:

Version:

  • LayOut 2018

#name=(name) ⇒ Object

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

#nonshared_entitiesLayout::Entities

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

Examples:

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

Returns:

Version:

  • LayOut 2018

#set_layer_visibility(layer, visible) ⇒ Boolean

The #set_layer_visibility method sets whether a Layer is visible on the Layout::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:

Returns:

  • (Boolean)

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