Class: Layout::Entities
- Inherits:
-
Object
- Object
- Layout::Entities
- Includes:
- Enumerable
Overview
The Entities class is a container class for Entitys. A Entities object is different from a SketchUp::Entities object in that it is read-only. Adding or removing Entitys 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 Entitys that represent the Entity in its exploded form.
The Entities from Group#entities contains all the Entitys that belong to the Group.
The Entities from Page#entities contains all of the Entitys on both shared and non-shared Layers. This class is used to iterate through the Entitys 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 Entitys that belong on all shared Layers.
The Entities from Page#nonshared_entities contains all of the Entitys that belong to that Page.
The Entities from LayerInstance#entities contains all of the Entitys that belong on that LayerInstance.
Instance Method Summary # collapse
- #[](index) ⇒ Layout::Entity
- #each(flags = {}) {|entity| ... } ⇒ Object
- #length ⇒ Integer (also: #size)
-
#reverse_each(*args) ⇒ Object
The #reverse_each method iterates through all of the Entitys in reverse order.
Instance Method Details
↑ #[](index) ⇒ Layout::Entity
The #[] method returns the Layout::Entity at the given index. This method is not valid for use when the Layout::Entities object came from a Page.
↑ #each(flags = {}) {|entity| ... } ⇒ Object
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 Layout::Entitys. When iterating over a LayerInstance's Layout::Entities, it is not necessary to provide a flags Hash. When iterating over a Page's Layout::Entities, the flags Hash is optional; providing no Hash will result in iterating over all Layout::Entitys, including those on hidden or locked Layers. Valid symbols for the Hash are :skip_hidden
and :skip_locked
.
↑ #length ⇒ Integer Also known as: size
The #length method returns the number of Layout::Entitys.
↑ #reverse_each {|entity| ... } ⇒ Object #reverse_each(flags) {|entity| ... } ⇒ Object
The #reverse_each method iterates through all of the Layout::Entitys in reverse order. When iterating over a LayerInstance's Layout::Entities, it is not necessary to provide a flags Hash. When iterating over a Page's Layout::Entities, the flags Hash is optional; providing no Hash will result in iterating over all Layout::Entitys, including those on hidden or locked Layers. Valid symbols for the Hash are :skip_hidden
and :skip_locked
.