ModraUp Ruby API Documentation Ruby API Reference

Class: Layout::Entities

Inherits:
Object
  • Object
show all
Includes:
Enumerable

Overview

A collection of drawing entities obtained from Layout::Page#entities, Layout::Page#nonshared_entities, or Layout::Document#shared_entities. Iteration proceeds from bottom to top in stacking order. Each access reflects the current drawing.

Examples:

doc = ModraUp.active_model.layout_document
doc.pages.add.entities.grep(Layout::SketchUpModel)

Instance Method Summary # collapse

Instance Method Details

entities.length ⇒ Integer

Number of objects.

Returns:

  • (Integer)

Examples:

ModraUp.active_model.layout_document.pages.add.entities.length  #=> 0

entities.size ⇒ Integer

Alias for #length.

Returns:

  • (Integer)

Examples:

ModraUp.active_model.layout_document.shared_entities.size

entities.each { |entity| ... } ⇒ Layout::Entities

Traverse from bottom to top.

Returns:

  • (Layout::Entities)

Yields:

  • @yieldparam [Layout::Entity] entity

Examples:

ModraUp.active_model.layout_document.shared_entities.each { |e| p e.bounds }

entities[index] ⇒ Layout::Entity, nil

Retrieve objects by position, with 0 being at the bottom.

Parameters:

  • index (Integer)

Returns:

  • (Layout::Entity, nil)

Examples:

ModraUp.active_model.layout_document.shared_entities[0]