Class: Layout::Entities
Relationships | |
Super Chains via Extension / Inclusion / Inheritance | |
Instance Chain:
self,
Enumerable
|
|
Inherits: | Object |
Overview
The Entities class is a container class for Entity
s. A Entities
object is different from a SketchUp::Entities object in that it is read-only. Adding or removing Entity
s from a Document
happens with the Document#add_entity and Document#remove_entity methods.
The Entities
from AngularDimension#entities, Label#entities, LinearDimension#entities, or Table#entities contains the Entity
s that represent the Entity
in its exploded form.
The Entities
from Group#entities contains all the Entity
s that belong to the Group
.
The Entities
from Page#entities contains all of the Entity
s on both shared and non-shared Layer
s. This class is used to iterate through the Entity
s in draw order or pick order (reverse draw order) using the #each and #reverse_each methods.
The Entities
from Document#shared_entities contains all of the Entity
s that belong on all shared Layer
s.
The Entities
from Page#nonshared_entities contains all of the Entity
s that belong to that Page
.
The Entities
from LayerInstance#entities contains all of the Entity
s that belong on that LayerInstance
.
Instance Method Summary
- #[](index) ⇒ Layout::Entity
- #each(flags = {}) {|entity| ... }
- #length ⇒ Integer (also: #size)
-
#reverse_each {|entity| ... }
The #reverse_each method iterates through all of the
Entity
s in reverse order. -
#size
Alias for #length.
Instance Method Details
#[](index) ⇒ Layout::Entity
#each(flags = {}) {|entity| ... }
Don’t remove content from this collection while iterating over it with #each
. This would change the size of the collection and cause elements to be skipped as the indices change. Instead copy the current collection to an array using to_a
and then use each
on the array, when removing content.
The #each
method iterates through all of the Entity
s. When iterating over a LayerInstance
‘s Entities
, it is not necessary to provide a flags Hash. When iterating over a Page
’s Entities
, the flags Hash is optional; providing no Hash will result in iterating over all Entity
s, including those on hidden or locked Layer
s. Valid symbols for the Hash are :skip_hidden
and :skip_locked
.
#length ⇒ Integer
Also known as: #size
The #length
method returns the number of Entity
s.
#reverse_each {|entity| ... }
#reverse_each(flags) {|entity| ... }
The #reverse_each
method iterates through all of the Entity
s in reverse order. When iterating over a LayerInstance
‘s Entities
, it is not necessary to provide a flags Hash. When iterating over a Page
’s Entities
, the flags Hash is optional; providing no Hash will result in iterating over all Entity
s, including those on hidden or locked Layer
s. Valid symbols for the Hash are :skip_hidden
and :skip_locked
.
#size
Alias for #length.