ModraUp Ruby API Documentation Ruby API Reference

Class: Layout::Page

Inherits:
Object
  • Object
show all

Overview

A drawing sheet. The paper size and margin settings are uniform across the entire document (Layout::Document#page_info), with the drawing frame derived from a template; The drawing number is automatically assigned in sequence from 1 to N by page.

Examples:

page = ModraUp.active_model.layout_document.pages.add("Floor plan")
page.name = "Ground-floor plan"

Instance Method Summary # collapse

Instance Method Details

page.name ⇒ String

Page name.

Returns:

  • (String)

Examples:

ModraUp.active_model.layout_document.pages.add("Elevation").name  #=> "Elevation"

page.name = name

Rename, up to 200 characters, with one-step undo.

Parameters:

  • name (String)

Returns:

  • (String)

Examples:

ModraUp.active_model.layout_document.pages.add.name = "Section"

page.entities ⇒ Layout::Entities

The objects shown on this page, including those on shared layers, are displayed from bottom to top, following the stacking order in the interface; hidden layers are not included.

Returns:

  • (Layout::Entities)

Examples:

ModraUp.active_model.layout_document.pages.add.entities.to_a

page.nonshared_entities ⇒ Layout::Entities

Objects on this page that are not part of shared layers.

Returns:

  • (Layout::Entities)

Examples:

ModraUp.active_model.layout_document.pages.add.nonshared_entities.length

page.document ⇒ Layout::Document

The owning document.

Returns:

  • (Layout::Document)

Examples:

ModraUp.active_model.layout_document.pages.add.document

page.layer_visible?(layer) ⇒ Boolean

Does the layer appear on this page.

Parameters:

  • layer (Layout::Layer)

Returns:

  • (Boolean)

Examples:

doc = ModraUp.active_model.layout_document
doc.pages.add.layer_visible?(doc.layers.active)  #=> true

page.set_layer_visibility(layer, visible) ⇒ Layout::Page

Set the visibility of layers in the current page, with one-step undo.

Parameters:

  • layer (Layout::Layer)
  • visible (Boolean)

Returns:

  • (Layout::Page)

Examples:

doc = ModraUp.active_model.layout_document
doc.pages.add.set_layer_visibility(doc.layers.active, false)

page == other ⇒ Boolean

Does the same page apply?

Parameters:

  • other (Object)

Returns:

  • (Boolean)

Examples:

pages = ModraUp.active_model.layout_document.pages
pages.add; pages[0] == pages[0]  #=> true

page.eql?(other) ⇒ Boolean

Like #==, used as a key in a Hash.

Parameters:

  • other (Object)

Returns:

  • (Boolean)

Examples:

pages = ModraUp.active_model.layout_document.pages
pages.add; { pages[0] => 1 }[pages[0]]  #=> 1

page.hash ⇒ Integer

Hash value consistent with #eql?.

Returns:

  • (Integer)

Examples:

ModraUp.active_model.layout_document.pages.add.hash

page.inspect ⇒ String

A brief description.

Returns:

  • (String)

Examples:

ModraUp.active_model.layout_document.pages.add.inspect