Class: Layout::ReferenceEntity

Inherits:
Entity
  • Object
show all

Overview

An entity that represents the data inserted from an external file.

Examples:

doc = Layout::Document.open("C:/path/to/document.layout")
reference_entity = doc.pages.first.entities.first
clip_mask = reference_entity.clip_mask
if clip_mask.is_a?(Layout::Rectangle)
  point1 = Geom::Point2d.new(1, 1)
  point2 = Geom::Point2d.new(2, 2)
  bounds = [point1, point2]
  reference_entity.clip_mask = Layout::Ellipse.new(bounds)
end

Version:

  • LayOut 2023.0

Instance Method Summary # collapse

Methods inherited from Entity

#==, #bounds, #document, #drawing_bounds, #group, #layer_instance, #locked=, #locked?, #move_to_group, #move_to_layer, #on_shared_layer?, #page, #style, #style=, #transform!, #transformation, #untransformed_bounds, #untransformed_bounds=

Instance Method Details

#clip_maskLayout::Entity

The #clip_mask method returns the clip mask of the Layout::ReferenceEntity, or nil if it does not have a clip mask.

Examples:

doc = Layout::Document.open("C:/path/to/document.layout")
reference_entity = doc.pages.first.entities.first
clip_mask = image.clip_mask

Returns:

Version:

  • LayOut 2023.0

#clip_mask=(clip_mask) ⇒ Object

The #clip_mask= method sets the clip mask of the Layout::ReferenceEntity. clip_mask can be a Layout::Rectangle, Ellipse, or Path, or nil, and it must not currently exist in a Document, or Group.

Examples:

doc = Layout::Document.open("C:/path/to/document.layout")
reference_entity = doc.pages.first.entities.first
point1 = Geom::Point2d.new(1, 1)
point2 = Geom::Point2d.new(2, 2)
bounds = [point1, point2]
clip_mask = Layout::Rectangle.new(bounds)
reference_entity.clip_mask = clip_mask

Parameters:

Raises:

Version:

  • LayOut 2023.0

#entitiesLayout::Group

The #entities method returns the Group that represents the Layout::ReferenceEntity in its exploded form.

Examples:

doc = Layout::Document.open("C:/path/to/document.layout")
reference_entity = doc.pages.first.entities.first
entities = reference_entity.entities

Returns:

Version:

  • LayOut 2023.0