Class: Layout::Entity
| Relationships | |
| Extension / Inclusion / Inheritance Descendants | |
|
Subclasses:
|
|
| Inherits: | Object |
Overview
An entity is an object shown on a page of a LayOut document.
Instance Attribute Summary
-
#locked=(is_locked)
rw
The #locked= method sets the
Entityas locked or unlocked. -
#locked? ⇒ Boolean
rw
The #locked? method returns whether the
Entityis locked or unlocked. -
#on_shared_layer? ⇒ Boolean
readonly
The #on_shared_layer? method returns whether or not the
Entityis on a sharedLayer. - #style ⇒ Layout::Style? rw
- #style=(style) rw
-
#untransformed_bounds ⇒ Geom::Bounds2d
rw
The #untransformed_bounds method returns the untransformed bounds of the
Entity. -
#untransformed_bounds=(bounds)
rw
The #untransformed_bounds= method sets the untransformed bounds of the
Entity.
Instance Method Summary
-
#==(other) ⇒ Boolean
The #== method checks to see if the two
Entitys are equal. -
#attribute_dictionary(name) ⇒ Layout::Dictionary?
The #attribute_dictionary method returns a copy of the entity’s attribute dictionary with the given name.
-
#bounds ⇒ Geom::Bounds2d
The #bounds method returns the 2D rectangular bounds of the
Entity. -
#delete_attribute(dictionary_name) ⇒ Boolean
The #delete_attribute method is used to delete an attribute from an entity.
- #document ⇒ Layout::Document?
-
#drawing_bounds ⇒ Geom::OrientedBounds2d
The #drawing_bounds method returns the 2D rectangular drawing bounds of the
Entity. -
#get_attribute(name, key, default_value = nil) ⇒ String, ...
The #get_attribute method is used to retrieve the value of an attribute in the entity’s attribute dictionary.
- #group ⇒ Layout::Group?
-
#layer_instance ⇒ Layout::LayerInstance?
The #layer_instance method returns the
LayerInstancethat theEntityis on, ornilif it is not associated with aLayerInstance. -
#move_to_group(group)
The #move_to_group method moves the
Entityinto aGroup. -
#move_to_layer(layer)
The #move_to_layer method moves the
Entityto the givenLayer. - #page ⇒ Layout::Page?
-
#set_attribute(name, key, value)
The #set_attribute method adds an attribute to the entity’s attribute dictionary.
-
#transform!(transformation)
The #transform! method transforms the
Entitywith a given::Geom::Transformation2d. -
#transformation ⇒ Geom::Transformation2d?
The #transformation method returns the explicit
::Geom::Transformation2d.
Instance Attribute Details
#locked=(is_locked) (rw)
The #locked= method sets the Entity as locked or unlocked. When locked, the Entity cannot be modified directly.
#locked? ⇒ Boolean (rw)
The #locked? method returns whether the Entity is locked or unlocked.
#style ⇒ Layout::Style? (rw)
#style=(style) (rw)
The #style= method sets the Style of the Entity.
#untransformed_bounds ⇒ Geom::Bounds2d (rw)
The #untransformed_bounds method returns the untransformed bounds of the Entity. This is the bounds of the Entity before its explicit ::Geom::Transformation2d is applied.
#untransformed_bounds=(bounds) (rw)
The #untransformed_bounds= method sets the untransformed bounds of the Entity. This is the bounds of the Entity before its explicit ::Geom::Transformation2d is applied.
Instance Method Details
#==(other) ⇒ Boolean
The #== method checks to see if the two Entitys are equal. This checks whether the Ruby Objects are pointing to the same internal object.
#attribute_dictionary(name) ⇒ Layout::Dictionary?
The #attribute_dictionary method returns a copy of the entity’s attribute dictionary with the given name.
no attribute dictionary
#bounds ⇒ Geom::Bounds2d
The #bounds method returns the 2D rectangular bounds of the Entity.
#delete_attribute(dictionary_name) ⇒ Boolean
#delete_attribute(dictionary_name, key) ⇒ Boolean
Boolean
#delete_attribute(dictionary_name, key) ⇒ Boolean
The #delete_attribute method is used to delete an attribute from an entity.
#document ⇒ Layout::Document?
#drawing_bounds ⇒ Geom::OrientedBounds2d
The #drawing_bounds method returns the 2D rectangular drawing bounds of the Entity.
#get_attribute(name, key, default_value = nil) ⇒ String, ...
The #get_attribute method is used to retrieve the value of an attribute in the entity’s attribute dictionary.
If the third parameter, default_value, is not passed and there is no attribute that matches the given name, it returns nil.
If default_value is provided and there is no matching attribute it returns the given value. It does not create an attribute with that name though.
#group ⇒ Layout::Group?
#layer_instance ⇒ Layout::LayerInstance?
Groups are never associated with a LayerInstance.
The #layer_instance method returns the LayerInstance that the Entity is on, or nil if it is not associated with a LayerInstance.
#move_to_group(group)
The #move_to_group method moves the Entity into a Group. If the Entity is already in a Group, it will be removed from that Group prior to being added to the new one. If this action results in the old Group containing only one Entity, the old Group will be collapsed and the remaining Entity will be moved to the old Group‘s parent.
#move_to_layer(layer)
#move_to_layer(layer, pages)
The #move_to_layer method moves the Entity to the given Layer. If the Layer is non-shared and the Entity is currently on a shared Layer, an array of Pages must be provided to move the Entity to. In all other cases, passing in an array of Pages is not necessary. The Entity must belong to the same Document as the the Layer and the Pages.
#page ⇒ Layout::Page?
#set_attribute(name, key, value)
The #set_attribute method adds an attribute to the entity’s attribute dictionary.
#transform!(transformation)
Since LayOut 2026.1, passing a non-invertible transformation raises an ArgumentError.
The #transform! method transforms the Entity with a given ::Geom::Transformation2d.
#transformation ⇒ Geom::Transformation2d?
The #transformation method returns the explicit ::Geom::Transformation2d.