123456789_123456789_123456789_123456789_123456789_

Class: Layout::Style

Relationships
Inherits: Object

Overview

References a collection of style attributes that determine the visual appearance of Entitys. Style attributes are those attributes which the user can manipulate in LayOut’s inspector windows. For example, shape style attributes that define stroke and fill, or text style attributes that define the font for FormattedText. The Document maintains a default style for various types of Entitys, and it is possible to apply the style of one entity to another. Style objects are transient and do not belong to a Document.

Version:

  • LayOut 2018

Constant Summary

Class Method Summary

Instance Attribute Summary

Instance Method Summary

Constructor Details

.newStyle

The #initialize method creates a new Style.

Examples:

style = Layout::Style.new

Version:

  • LayOut 2018

Class Method Details

.arrow_type_filled?(arrow_type) ⇒ Boolean

The .arrow_type_filled? method returns whether the specified arrow type is filled or not.

The arrow type can be one of the following values:

Layout::Style::ARROW_NONE
Layout::Style::ARROW_FILLED_TRIANGLE
Layout::Style::ARROW_OPEN_TRIANGLE
Layout::Style::ARROW_FILLED_SKINNY_TRIANGLE
Layout::Style::ARROW_OPEN_SKINNY_TRIANGLE
Layout::Style::ARROW_OPEN_ARROW_90
Layout::Style::ARROW_OPEN_ARROW_120
Layout::Style::ARROW_FILLED_CIRCLE
Layout::Style::ARROW_OPEN_CIRCLE
Layout::Style::ARROW_FILLED_SQUARE
Layout::Style::ARROW_OPEN_SQUARE
Layout::Style::ARROW_FILLED_DIAMOND
Layout::Style::ARROW_OPEN_DIAMOND
Layout::Style::ARROW_STAR
Layout::Style::ARROW_T
Layout::Style::ARROW_SLASH_RIGHT
Layout::Style::ARROW_SLASH_LEFT
Layout::Style::ARROW_UNDERRUN
Layout::Style::ARROW_OVERRUN

Examples:

# Returns false
filled = Layout::Style.arrow_type_filled?(Layout::Style::ARROW_T)
# Returns true
filled = Layout::Style.arrow_type_filled?(Layout::Style::ARROW_FILLED_SQUARE)

Version:

  • LayOut 2018

Instance Attribute Details

#dimension_rotation_alignmentInteger? (rw)

The #dimension_rotation_alignment method returns the rotational text alignment for LinearDimension text, or nil if the Style does not have a value for that setting.

The rotational alignment type can be one of the following values:

Layout::Style::DIMENSION_TEXT_HORIZONTAL
Layout::Style::DIMENSION_TEXT_VERTICAL
Layout::Style::DIMENSION_TEXT_PARALLEL
Layout::Style::DIMENSION_TEXT_PERPENDICULAR

Examples:

doc = Layout::Document.open("C:/path/to/document.layout")
page = doc.pages.first
entity = page.entities.first
style = entity.style
dimension_alignment = style.dimension_rotation_alignment

Version:

  • LayOut 2018

#dimension_rotation_alignment=(alignment_type) (rw)

The #dimension_rotation_alignment= method sets the rotational text alignment.

The rotational alignment type can be one of the following values:

Layout::Style::DIMENSION_TEXT_HORIZONTAL
Layout::Style::DIMENSION_TEXT_VERTICAL
Layout::Style::DIMENSION_TEXT_PARALLEL
Layout::Style::DIMENSION_TEXT_PERPENDICULAR

Examples:

doc = Layout::Document.open("C:/path/to/document.layout")
page = doc.pages.first
entity = page.entities.first
style = entity.style
style.dimension_rotation_alignment = Layout::Style::DIMENSION_TEXT_HORIZONTAL
# Set the style to apply changes
entity.style = style

Parameters:

  • alignment_type (Integer)

Raises:

  • (ArgumentError)

    if alignment_type is not a valid alignment type

Version:

  • LayOut 2018

#dimension_vertical_alignmentInteger? (rw)

The #dimension_vertical_alignment method returns the vertical text alignment for LinearDimension text, or nil if the Style does not have a value for that setting.

The vertical alignment type can be one of the following values:

Layout::Style::DIMENSION_TEXT_ABOVE
Layout::Style::DIMENSION_TEXT_CENTER
Layout::Style::DIMENSION_TEXT_BELOW
Layout::Style::DIMENSION_TEXT_OFFSET

Examples:

doc = Layout::Document.open("C:/path/to/document.layout")
page = doc.pages.first
entity = page.entities.first
style = entity.style
dimension_alignment = style.dimension_vertical_alignment

Version:

  • LayOut 2018

#dimension_vertical_alignment=(alignment_type) (rw)

The #dimension_vertical_alignment= method sets the vertical text alignment for LinearDimension text.

The vertical alignment type can be one of the following values:

Layout::Style::DIMENSION_TEXT_ABOVE
Layout::Style::DIMENSION_TEXT_CENTER
Layout::Style::DIMENSION_TEXT_BELOW
Layout::Style::DIMENSION_TEXT_OFFSET

Examples:

doc = Layout::Document.open("C:/path/to/document.layout")
page = doc.pages.first
entity = page.entities.first
style = entity.style
style.dimension_vertical_alignment = Layout::Style::DIMENSION_TEXT_ABOVE
# Set the style to apply changes
entity.style = style

Parameters:

  • alignment_type (Integer)

Raises:

  • (ArgumentError)

    if alignment_type is not a valid alignment type

Version:

  • LayOut 2018

#end_arrow_sizeFloat? (rw)

The #end_arrow_size method returns the size of the end arrow, or nil if the Style does not have a value for that setting.

Examples:

doc = Layout::Document.open("C:/path/to/document.layout")
page = doc.pages.first
entity = page.entities.first
style = entity.style
arrow_size = style.start_arrow_size

Version:

  • LayOut 2018

#end_arrow_size=(arrow_size) (rw)

The #end_arrow_size= method sets the size of the end arrow. The minimum size is 0.25.

Examples:

doc = Layout::Document.open("C:/path/to/document.layout")
page = doc.pages.first
entity = page.entities.first
style = entity.style
style.end_arrow_size = 2.0
# Set the style to apply changes
entity.style = style

Parameters:

  • arrow_size (Float)

Raises:

  • (ArgumentError)

    if arrow_size is less than 0.25

Version:

  • LayOut 2018

#end_arrow_typeInteger? (rw)

The #end_arrow_type method returns the type of end arrow, or nil if the Style does not have a value for that setting.

The arrow type can be one of the following values:

Layout::Style::ARROW_NONE
Layout::Style::ARROW_FILLED_TRIANGLE
Layout::Style::ARROW_OPEN_TRIANGLE
Layout::Style::ARROW_FILLED_SKINNY_TRIANGLE
Layout::Style::ARROW_OPEN_SKINNY_TRIANGLE
Layout::Style::ARROW_OPEN_ARROW_90
Layout::Style::ARROW_OPEN_ARROW_120
Layout::Style::ARROW_FILLED_CIRCLE
Layout::Style::ARROW_OPEN_CIRCLE
Layout::Style::ARROW_FILLED_SQUARE
Layout::Style::ARROW_OPEN_SQUARE
Layout::Style::ARROW_FILLED_DIAMOND
Layout::Style::ARROW_OPEN_DIAMOND
Layout::Style::ARROW_STAR
Layout::Style::ARROW_T
Layout::Style::ARROW_SLASH_RIGHT
Layout::Style::ARROW_SLASH_LEFT
Layout::Style::ARROW_UNDERRUN
Layout::Style::ARROW_OVERRUN

Examples:

doc = Layout::Document.open("C:/path/to/document.layout")
page = doc.pages.first
entity = page.entities.first
style = entity.style
arrow_type = style.end_arrow_type

Version:

  • LayOut 2018

#end_arrow_type=(arrow_type) (rw)

The #end_arrow_type= method sets the type of end arrow.

The arrow type can be one of the following values:

Layout::Style::ARROW_NONE
Layout::Style::ARROW_FILLED_TRIANGLE
Layout::Style::ARROW_OPEN_TRIANGLE
Layout::Style::ARROW_FILLED_SKINNY_TRIANGLE
Layout::Style::ARROW_OPEN_SKINNY_TRIANGLE
Layout::Style::ARROW_OPEN_ARROW_90
Layout::Style::ARROW_OPEN_ARROW_120
Layout::Style::ARROW_FILLED_CIRCLE
Layout::Style::ARROW_OPEN_CIRCLE
Layout::Style::ARROW_FILLED_SQUARE
Layout::Style::ARROW_OPEN_SQUARE
Layout::Style::ARROW_FILLED_DIAMOND
Layout::Style::ARROW_OPEN_DIAMOND
Layout::Style::ARROW_STAR
Layout::Style::ARROW_T
Layout::Style::ARROW_SLASH_RIGHT
Layout::Style::ARROW_SLASH_LEFT
Layout::Style::ARROW_UNDERRUN
Layout::Style::ARROW_OVERRUN

Examples:

doc = Layout::Document.open("C:/path/to/document.layout")
page = doc.pages.first
entity = page.entities.first
style = entity.style
style.end_arrow_type = Layout::Style::ARROW_SLASH_LEFT
# Set the style to apply changes
entity.style = style

Parameters:

  • arrow_type (Integer)

Raises:

  • (ArgumentError)

    if arrow_type is not a valid arrow type

Version:

  • LayOut 2018

#fill_colorSketchup::Color? (rw)

The #fill_color method returns the solid file color, or nil if the Style does not have a value for that setting.

Examples:

doc = Layout::Document.open("C:/path/to/document.layout")
page = doc.pages.first
entity = page.entities.first
style = entity.style
color = style.fill_color

Version:

  • LayOut 2018

#fill_color=(fill_color) (rw)

The #fill_color= method sets the solid fill color.

Examples:

doc = Layout::Document.open("C:/path/to/document.layout")
page = doc.pages.first
entity = page.entities.first
style = entity.style
style.solid_filled = true
style.fill_color = Sketchup::Color.new(0, 255, 0, 255)
# Set the style to apply changes
entity.style = style

Parameters:

Version:

  • LayOut 2018

#font_familyString? (rw)

The #font_family method returns the text font name, or nil if the Style does not have a value for that setting.

Examples:

doc = Layout::Document.open("C:/path/to/document.layout")
page = doc.pages.first
entity = page.entities.first
style = entity.style
font_name = style.font_family

Version:

  • LayOut 2018

#font_family=(font_family) (rw)

The #font_family= method sets the text font name.

Examples:

doc = Layout::Document.open("C:/path/to/document.layout")
page = doc.pages.first
entity = page.entities.first
style = entity.style
style.font_family = "Verdana"
# Set the style to apply changes
entity.style = style

Parameters:

Version:

  • LayOut 2018

#font_sizeFloat? (rw)

The #font_size method returns the font size, or nil if the Style does not have a value for that setting.

Examples:

doc = Layout::Document.open("C:/path/to/document.layout")
page = doc.pages.first
entity = page.entities.first
style = entity.style
font_size = style.font_size

Version:

  • LayOut 2018

#font_size=(font_size) (rw)

The #font_size= method sets the font size.

Examples:

doc = Layout::Document.open("C:/path/to/document.layout")
page = doc.pages.first
entity = page.entities.first
style = entity.style
style.font_size = 12.0
# Set the style to apply changes
entity.style = style

Parameters:

  • font_size (Float)

Version:

  • LayOut 2018

#pattern_fill_originGeom::Point2d? (rw)

The #pattern_fill_origin method returns the starting piont for the pattern fill, or nil if the Style does not have a value for that setting.

Examples:

doc = Layout::Document.open("C:/path/to/document.layout")
page = doc.pages.first
entity = page.entities.first
style = entity.style
origin = style.pattern_fill_origin

Version:

  • LayOut 2018

#pattern_fill_origin=(origin) (rw)

The #pattern_fill_origin= method sets the starting point for the pattern fill.

Examples:

doc = Layout::Document.open("C:/path/to/document.layout")
page = doc.pages.first
entity = page.entities.first
style = entity.style
style.pattern_filled = true
style.pattern_fill_path = "C:/path/to/pattern.png"
style.pattern_fill_origin = [2, 1]
# Set the style to apply changes
entity.style = style

Parameters:

Version:

  • LayOut 2018

#pattern_fill_pathString? (rw)

The #pattern_fill_path method returns the file path to the pattern fill image, or nil if the Style does not have a value for that setting.

Examples:

doc = Layout::Document.open("C:/path/to/document.layout")
page = doc.pages.first
entity = page.entities.first
style = entity.style
path = style.pattern_fill_path

Version:

  • LayOut 2018

#pattern_fill_path=(path) (rw)

The #pattern_fill_path= method sets the path to the image to use for the pattern fill.

Examples:

doc = Layout::Document.open("C:/path/to/document.layout")
page = doc.pages.first
entity = page.entities.first
style = entity.style
style.pattern_filled = true
style.pattern_fill_path = "C:/path/to/pattern.png"
# Set the style to apply changes
entity.style = style

Parameters:

Raises:

  • (ArgumentError)

    if the image specified by path could not be loaded

Version:

  • LayOut 2018

#pattern_fill_rotationFloat? (rw)

The #pattern_fill_rotation method returns the rotation of the pattern fill image in degrees, or nil if the Style does not have a value for that setting.

Examples:

doc = Layout::Document.open("C:/path/to/document.layout")
page = doc.pages.first
entity = page.entities.first
style = entity.style
rotation = style.pattern_fill_rotation

Version:

  • LayOut 2018

#pattern_fill_rotation=(rotation) (rw)

The #pattern_fill_rotation= method sets the rotation in degrees of the pattern fill image.

Examples:

doc = Layout::Document.open("C:/path/to/document.layout")
page = doc.pages.first
entity = page.entities.first
style = entity.style
style.pattern_filled = true
style.pattern_fill_path = "C:/path/to/pattern.png"
style.pattern_fill_rotation = -90.0
# Set the style to apply changes
entity.style = style

Parameters:

  • rotation (Float)

Version:

  • LayOut 2018

#pattern_fill_scaleFloat? (rw)

The #pattern_fill_scale method returns the pattern fill scale, or nil if the Style does not have a value for that setting.

Examples:

doc = Layout::Document.open("C:/path/to/document.layout")
page = doc.pages.first
entity = page.entities.first
style = entity.style
scale = style.pattern_fill_scale

Version:

  • LayOut 2018

#pattern_fill_scale=(scale) (rw)

The #pattern_fill_scale= method sets the pattern fill scale.

Examples:

doc = Layout::Document.open("C:/path/to/document.layout")
page = doc.pages.first
entity = page.entities.first
style = entity.style
style.pattern_filled = true
style.pattern_fill_path = "C:/path/to/pattern.png"
style.pattern_fill_scale = 2.0
# Set the style to apply changes
entity.style = style

Parameters:

  • scale (Float)

Raises:

  • (ArgumentError)

    if scale is less than 0.1 or greater than 9999.0

Version:

  • LayOut 2018

#pattern_filledBoolean? (rw)

The #pattern_filled method returns whether the Style has a pattern fill, or nil if the Style does not have a value for that setting.

Examples:

doc = Layout::Document.open("C:/path/to/document.layout")
page = doc.pages.first
entity = page.entities.first
style = entity.style
is_filled = style.pattern_filled

Version:

  • LayOut 2018

#pattern_filled=(filled) (rw)

The #pattern_filled= method sets whether the Style has a pattern fill.

Examples:

doc = Layout::Document.open("C:/path/to/document.layout")
page = doc.pages.first
entity = page.entities.first
style = entity.style
style.pattern_filled = true
style.pattern_fill_path = "C:/path/to/pattern.png"
# Set the style to apply changes
entity.style = style

Parameters:

  • filled (Boolean)

Version:

  • LayOut 2018

#solid_filledBoolean? (rw)

The #solid_filled method returns whether the Style has a solid fill, or nil if the Style does not have a value for that setting.

Examples:

doc = Layout::Document.open("C:/path/to/document.layout")
page = doc.pages.first
entity = page.entities.first
style = entity.style
is_filled = style.solid_filled

Version:

  • LayOut 2018

#solid_filled=(filled) (rw)

The #solid_filled= method sets whether the Style has a solid fill.

Examples:

doc = Layout::Document.open("C:/path/to/document.layout")
page = doc.pages.first
entity = page.entities.first
style = entity.style
style.solid_filled = true
style.fill_color = Sketchup::Color.new(0, 255, 0, 255)
# Set the style to apply changes
entity.style = style

Parameters:

  • filled (Boolean)

Version:

  • LayOut 2018

#start_arrow_sizeFloat? (rw)

The #start_arrow_size method returns the size of the start arrow, or nil if the Style does not have a value for that setting.

Examples:

doc = Layout::Document.open("C:/path/to/document.layout")
page = doc.pages.first
entity = page.entities.first
style = entity.style
arrow_size = style.start_arrow_size

Version:

  • LayOut 2018

#start_arrow_size=(arrow_size) (rw)

The #start_arrow_size= method sets the size of the start arrow. The minimum size is 0.25.

Examples:

doc = Layout::Document.open("C:/path/to/document.layout")
page = doc.pages.first
entity = page.entities.first
style = entity.style
style.start_arrow_size = 2.0
# Set the style to apply changes
entity.style = style

Parameters:

  • arrow_size (Float)

Raises:

  • (ArgumentError)

    if arrow_size is less than 0.25

Version:

  • LayOut 2018

#start_arrow_typeInteger? (rw)

The #start_arrow_type method returns the type of start arrow, or nil if the Style does not have a value for that setting.

The arrow type can be one of the following values:

Layout::Style::ARROW_NONE
Layout::Style::ARROW_FILLED_TRIANGLE
Layout::Style::ARROW_OPEN_TRIANGLE
Layout::Style::ARROW_FILLED_SKINNY_TRIANGLE
Layout::Style::ARROW_OPEN_SKINNY_TRIANGLE
Layout::Style::ARROW_OPEN_ARROW_90
Layout::Style::ARROW_OPEN_ARROW_120
Layout::Style::ARROW_FILLED_CIRCLE
Layout::Style::ARROW_OPEN_CIRCLE
Layout::Style::ARROW_FILLED_SQUARE
Layout::Style::ARROW_OPEN_SQUARE
Layout::Style::ARROW_FILLED_DIAMOND
Layout::Style::ARROW_OPEN_DIAMOND
Layout::Style::ARROW_STAR
Layout::Style::ARROW_T
Layout::Style::ARROW_SLASH_RIGHT
Layout::Style::ARROW_SLASH_LEFT
Layout::Style::ARROW_UNDERRUN
Layout::Style::ARROW_OVERRUN

Examples:

doc = Layout::Document.open("C:/path/to/document.layout")
page = doc.pages.first
entity = page.entities.first
style = entity.style
arrow_type = style.start_arrow_type

Version:

  • LayOut 2018

#start_arrow_type=(arrow_type) (rw)

The #start_arrow_type= method sets the type of start arrow.

The arrow type can be one of the following values:

Layout::Style::ARROW_NONE
Layout::Style::ARROW_FILLED_TRIANGLE
Layout::Style::ARROW_OPEN_TRIANGLE
Layout::Style::ARROW_FILLED_SKINNY_TRIANGLE
Layout::Style::ARROW_OPEN_SKINNY_TRIANGLE
Layout::Style::ARROW_OPEN_ARROW_90
Layout::Style::ARROW_OPEN_ARROW_120
Layout::Style::ARROW_FILLED_CIRCLE
Layout::Style::ARROW_OPEN_CIRCLE
Layout::Style::ARROW_FILLED_SQUARE
Layout::Style::ARROW_OPEN_SQUARE
Layout::Style::ARROW_FILLED_DIAMOND
Layout::Style::ARROW_OPEN_DIAMOND
Layout::Style::ARROW_STAR
Layout::Style::ARROW_T
Layout::Style::ARROW_SLASH_RIGHT
Layout::Style::ARROW_SLASH_LEFT
Layout::Style::ARROW_UNDERRUN
Layout::Style::ARROW_OVERRUN

Examples:

doc = Layout::Document.open("C:/path/to/document.layout")
page = doc.pages.first
entity = page.entities.first
style = entity.style
style.start_arrow_type = Layout::Style::ARROW_SLASH_RIGHT
# Set the style to apply changes
entity.style = style

Parameters:

  • arrow_type (Integer)

Raises:

  • (ArgumentError)

    if arrow_type is not a valid arrow type

Version:

  • LayOut 2018

#stroke_cap_styleInteger? (rw)

The #stroke_cap_style method returns the stroke cap style, or nil if the Style does not have a value for that setting.

The cap style can be one of the following:

Layout::Style::CAP_STYLE_FLAT
Layout::Style::CAP_STYLE_ROUND
Layout::Style::CAP_STYLE_SQUARE

Examples:

doc = Layout::Document.open("C:/path/to/document.layout")
page = doc.pages.first
entity = page.entities.first
style = entity.style
cap_style = style.stroke_cap_style

Version:

  • LayOut 2018

#stroke_cap_style=(cap_style) (rw)

The #stroke_cap_style= method sets the stroke cap style.

The cap style can be one of the following:

Layout::Style::CAP_STYLE_FLAT
Layout::Style::CAP_STYLE_ROUND
Layout::Style::CAP_STYLE_SQUARE

Examples:

doc = Layout::Document.open("C:/path/to/document.layout")
page = doc.pages.first
entity = page.entities.first
style = entity.style
style.stroke_cap_style = Layout::Style::CAP_STYLE_SQUARE
# Set the style to apply changes
entity.style = style

Parameters:

  • cap_style (Integer)

Raises:

  • (ArgumentError)

    if cap_style is not a valid cap style

Version:

  • LayOut 2018

#stroke_colorSketchup::Color? (rw)

The #stroke_color method returns the stroke color, or nil if the Style does not have a value for that setting.

Examples:

doc = Layout::Document.open("C:/path/to/document.layout")
page = doc.pages.first
entity = page.entities.first
style = entity.style
color = style.stroke_color

Version:

  • LayOut 2018

#stroke_color=(stroke_color) (rw)

The #stroke_color= method sets the stroke color.

Examples:

doc = Layout::Document.open("C:/path/to/document.layout")
page = doc.pages.first
entity = page.entities.first
style = entity.style
style.stroke_color = Sketchup::Color.new(128, 128, 128, 255)
# Set the style to apply changes
entity.style = style

Parameters:

Version:

  • LayOut 2018

#stroke_join_styleInteger? (rw)

The #stroke_join_style method returns the stroke join style, or nil if the Style does not have a value for that setting.

The join style can be one of the following:

Layout::Style::JOIN_STYLE_MITER
Layout::Style::JOIN_STYLE_ROUND
Layout::Style::JOIN_STYLE_BEVEL

Examples:

doc = Layout::Document.open("C:/path/to/document.layout")
page = doc.pages.first
entity = page.entities.first
style = entity.style
join_style = style.stroke_join_style

Version:

  • LayOut 2018

#stroke_join_style=(join_style) (rw)

The #stroke_join_style= method sets the stroke join style.

The join style can be one of the following:

Layout::Style::JOIN_STYLE_MITER
Layout::Style::JOIN_STYLE_ROUND
Layout::Style::JOIN_STYLE_BEVEL

Examples:

doc = Layout::Document.open("C:/path/to/document.layout")
page = doc.pages.first
entity = page.entities.first
style = entity.style
style.stroke_join_style = Layout::Style::JOIN_STYLE_BEVEL
# Set the style to apply changes
entity.style = style

Parameters:

  • join_style (Integer)

Raises:

  • (ArgumentError)

    if join_style is not a valid join style

Version:

  • LayOut 2018

#stroke_patternInteger? (rw)

The #stroke_pattern method returns the stroke pattern, or nil if the Style does not have a value for that setting.

The stroke pattern can be one of the following:

Layout::Style::STROKE_PATTERN_SOLID
Layout::Style::STROKE_PATTERN_DASH
Layout::Style::STROKE_PATTERN_DOT
Layout::Style::STROKE_PATTERN_DASH_DOT
Layout::Style::STROKE_PATTERN_DASH_DOT_DOT
Layout::Style::STROKE_PATTERN_DASH_SPACE
Layout::Style::STROKE_PATTERN_DASH_DOT_DOT_DOT
Layout::Style::STROKE_PATTERN_DASH_DASH_DOT
Layout::Style::STROKE_PATTERN_DASH_DASH_DOT_DOT
Layout::Style::STROKE_PATTERN_DASH_DASH_DOT_DOT_DOT
Layout::Style::STROKE_PATTERN_CENTER
Layout::Style::STROKE_PATTERN_PHANTOM

Examples:

doc = Layout::Document.open("C:/path/to/document.layout")
page = doc.pages.first
entity = page.entities.first
style = entity.style
pattern = style.stroke_pattern

Version:

  • LayOut 2018

#stroke_pattern=(pattern) (rw)

The #stroke_pattern= method sets the stroke pattern.

The stroke pattern can be one of the following:

Layout::Style::STROKE_PATTERN_SOLID
Layout::Style::STROKE_PATTERN_DASH
Layout::Style::STROKE_PATTERN_DOT
Layout::Style::STROKE_PATTERN_DASH_DOT
Layout::Style::STROKE_PATTERN_DASH_DOT_DOT
Layout::Style::STROKE_PATTERN_DASH_SPACE
Layout::Style::STROKE_PATTERN_DASH_DOT_DOT_DOT
Layout::Style::STROKE_PATTERN_DASH_DASH_DOT
Layout::Style::STROKE_PATTERN_DASH_DASH_DOT_DOT
Layout::Style::STROKE_PATTERN_DASH_DASH_DOT_DOT_DOT
Layout::Style::STROKE_PATTERN_CENTER
Layout::Style::STROKE_PATTERN_PHANTOM

Examples:

doc = Layout::Document.open("C:/path/to/document.layout")
page = doc.pages.first
entity = page.entities.first
style = entity.style
style.stroke_pattern = Layout::Style::CAP_STYLE_SQUARE
# Set the style to apply changes
entity.style = style

Parameters:

  • pattern (Integer)

Raises:

  • (ArgumentError)

    if pattern is not a valid stroke pattern

Version:

  • LayOut 2018

#stroke_pattern_scaleFloat? (rw)

The #stroke_pattern_scale method returns the stroke pattern scale, or nil if the Style does not have a value for that setting.

Examples:

doc = Layout::Document.open("C:/path/to/document.layout")
page = doc.pages.first
entity = page.entities.first
style = entity.style
pattern_scale = style.stroke_pattern_scale

Version:

  • LayOut 2018

#stroke_pattern_scale=(scale) (rw)

The #stroke_pattern_scale= method sets the stroke pattern scale.

Examples:

doc = Layout::Document.open("C:/path/to/document.layout")
page = doc.pages.first
entity = page.entities.first
style = entity.style
style.stroke_pattern_scale = 2.0
# Set the style to apply changes
entity.style = style

Parameters:

  • scale (Float)

Raises:

  • (ArgumentError)

    if scale is less than 0.1 or greater than 9999.0

Version:

  • LayOut 2018

#stroke_widthFloat? (rw)

The #stroke_width method returns the stroke width, or nil if the Style does not have a value for that setting.

Examples:

doc = Layout::Document.open("C:/path/to/document.layout")
page = doc.pages.first
entity = page.entities.first
style = entity.style
stroke_width = style.stroke_width

Version:

  • LayOut 2018

#stroke_width=(stroke_width) (rw)

The #stroke_width= method sets the stroke width.

Examples:

doc = Layout::Document.open("C:/path/to/document.layout")
page = doc.pages.first
entity = page.entities.first
style = entity.style
style.stroke_width = 2.0
# Set the style to apply changes
entity.style = style

Parameters:

  • stroke_width (Float)

Raises:

  • (ArgumentError)

    if stroke_width is less than 0.0

Version:

  • LayOut 2018

#strokedBoolean? (rw)

The #stroked method returns whether the Style has a stroke, or nil if the Style does not have a value for that setting.

Examples:

doc = Layout::Document.open("C:/path/to/document.layout")
page = doc.pages.first
entity = page.entities.first
style = entity.style
has_stroke = style.stroked

Version:

  • LayOut 2018

#stroked=(stroked) (rw)

The #stroked= method sets whether the Style has a stroke.

Examples:

doc = Layout::Document.open("C:/path/to/document.layout")
page = doc.pages.first
entity = page.entities.first
style = entity.style
style.stroked = true
# Set the style to apply changes
entity.style = style

Parameters:

  • stroked (Boolean)

Version:

  • LayOut 2018

#suppress_dimension_unitsBoolean? (rw)

The #suppress_dimension_units method returns whether the units for dimensions are suppressed, or nil if the Style does not have a value for that setting.

Examples:

doc = Layout::Document.open("C:/path/to/document.layout")
page = doc.pages.first
entity = page.entities.first
style = entity.style
suppressed = style.suppress_dimension_units

Version:

  • LayOut 2018

#suppress_dimension_units=(suppress) (rw)

The #suppress_dimension_units= method sets whether the units for dimensions are suppressed.

Examples:

doc = Layout::Document.open("C:/path/to/document.layout")
page = doc.pages.first
entity = page.entities.first
style = entity.style
style.suppress_dimension_units = true

Parameters:

  • suppress (Boolean)

Version:

  • LayOut 2018

#text_alignmentInteger? (rw)

The #text_alignment method returns the text alignment, or nil if the Style does not have a value for that setting.

The alignment type can be one of the following values:

Layout::Style::ALIGN_LEFT
Layout::Style::ALIGN_RIGHT
Layout::Style::ALIGN_CENTER

Examples:

doc = Layout::Document.open("C:/path/to/document.layout")
page = doc.pages.first
entity = page.entities.first
style = entity.style
alignment = style.text_alignment

Version:

  • LayOut 2018

#text_alignment=(alignment_type) (rw)

The #text_alignment= method sets the text alignment.

The alignment type can be one of the following values:

Layout::Style::ALIGN_LEFT
Layout::Style::ALIGN_RIGHT
Layout::Style::ALIGN_CENTER

Examples:

doc = Layout::Document.open("C:/path/to/document.layout")
page = doc.pages.first
entity = page.entities.first
style = entity.style
style.text_alignment = Layout::Style::ALIGN_CENTER
# Set the style to apply changes
entity.style = style

Parameters:

  • alignment_type (Integer)

Raises:

  • (ArgumentError)

    if alignment_type is not a valid alignment type

Version:

  • LayOut 2018

#text_anchorInteger? (rw)

The #text_anchor method returns the text anchor type, or nil if the Style does not have a value for that setting.

The anchor type can be one of the following values:

Layout::Style::ANCHOR_TOP
Layout::Style::ANCHOR_CENTER
Layout::Style::ANCHOR_BOTTOM

Examples:

doc = Layout::Document.open("C:/path/to/document.layout")
page = doc.pages.first
entity = page.entities.first
style = entity.style
anchor_type = style.text_anchor

Version:

  • LayOut 2018

#text_anchor=(anchor_type) (rw)

The #text_anchor= method sets the text anchor type.

The anchor type can be one of the following values:

Layout::Style::ANCHOR_TOP
Layout::Style::ANCHOR_CENTER
Layout::Style::ANCHOR_BOTTOM

Examples:

doc = Layout::Document.open("C:/path/to/document.layout")
page = doc.pages.first
entity = page.entities.first
style = entity.style
style.text_anchor = Layout::Style::ANCHOR_BOTTOM
# Set the style to apply changes
entity.style = style

Parameters:

  • anchor_type (Integer)

Raises:

  • (ArgumentError)

    if anchor_type is not a valid anchor type

Version:

  • LayOut 2018

#text_boldBoolean? (rw)

The #text_bold method returns whether text is bold, or nil if the Style does not have a value for that setting.

Examples:

doc = Layout::Document.open("C:/path/to/document.layout")
page = doc.pages.first
entity = page.entities.first
style = entity.style
bold = style.text_bold

Version:

  • LayOut 2018

#text_bold=(bold) (rw)

The #text_bold= method sets whether text is bold.

Examples:

doc = Layout::Document.open("C:/path/to/document.layout")
page = doc.pages.first
entity = page.entities.first
style = entity.style
style.text_bold = true
# Set the style to apply changes
entity.style = style

Parameters:

  • bold (Boolean)

Version:

  • LayOut 2018

#text_colorSketchup::Color? (rw)

The #text_color method returns the text color, or nil if the Style does not have a value for that setting.

Examples:

doc = Layout::Document.open("C:/path/to/document.layout")
page = doc.pages.first
entity = page.entities.first
style = entity.style
color = style.text_color

Version:

  • LayOut 2018

#text_color=(color) (rw)

The #text_color= method sets the text color.

Examples:

doc = Layout::Document.open("C:/path/to/document.layout")
page = doc.pages.first
entity = page.entities.first
style = entity.style
style.text_color = Sketchup::Color.new(255, 0, 0, 255)
# Set the style to apply changes
entity.style = style

Parameters:

Version:

  • LayOut 2018

#text_elevationInteger? (rw)

The #text_elevation method returns the text elevation, or nil if the Style does not have a value for that setting.

The elevation type can be one of the following values:

Layout::Style::NORMAL_SCRIPT
Layout::Style::SUPER_SCRIPT
Layout::Style::SUB_SCRIPT

Examples:

doc = Layout::Document.open("C:/path/to/document.layout")
page = doc.pages.first
entity = page.entities.first
style = entity.style
elevation = style.text_elevation

Version:

  • LayOut 2018

#text_elevation=(elevation_type) (rw)

The #text_elevation= method sets the text elevation.

The elevation type can be one of the following values:

Layout::Style::NORMAL_SCRIPT
Layout::Style::SUPER_SCRIPT
Layout::Style::SUB_SCRIPT

Examples:

doc = Layout::Document.open("C:/path/to/document.layout")
page = doc.pages.first
entity = page.entities.first
style = entity.style
style.text_elevation = Layout::Style::SUB_SCRIPT
# Set the style to apply changes
entity.style = style

Parameters:

  • elevation_type (Integer)

Raises:

  • (ArgumentError)

    if elevation_type is not a valid elevation type

Version:

  • LayOut 2018

#text_italicBoolean? (rw)

The #text_italic method returns whether text is italic, or nil if the Style does not have a value for that setting.

Examples:

doc = Layout::Document.open("C:/path/to/document.layout")
page = doc.pages.first
entity = page.entities.first
style = entity.style
italic = style.text_italic

Version:

  • LayOut 2018

#text_italic=(italic) (rw)

The #text_italic= method sets whether text is italic.

Examples:

doc = Layout::Document.open("C:/path/to/document.layout")
page = doc.pages.first
entity = page.entities.first
style = entity.style
style.text_italic = true
# Set the style to apply changes
entity.style = style

Parameters:

  • italic (Boolean)

Version:

  • LayOut 2018

#text_underlineInteger? (rw)

The #text_underline method returns the text underline type, or nil if the Style does not have a value for that setting.

The underline type can be one of the following values:

Layout::Style::UNDERLINE_NONE
Layout::Style::UNDERLINE_SINGLE
Layout::Style::UNDERLINE_DOUBLE

Examples:

doc = Layout::Document.open("C:/path/to/document.layout")
page = doc.pages.first
entity = page.entities.first
style = entity.style
underline_type = style.text_underline

Version:

  • LayOut 2018

#text_underline=(underline_type) (rw)

The #text_underline= method sets the text underline type.

The underline type can be one of the following values:

Layout::Style::UNDERLINE_NONE
Layout::Style::UNDERLINE_SINGLE
Layout::Style::UNDERLINE_DOUBLE

Examples:

doc = Layout::Document.open("C:/path/to/document.layout")
page = doc.pages.first
entity = page.entities.first
style = entity.style
style.text_underline = Layout::Style::UNDERLINE_DOUBLE
# Set the style to apply changes
entity.style = style

Parameters:

  • underline_type (Integer)

Raises:

  • (ArgumentError)

    if underline_type is not a valid underline type

Version:

  • LayOut 2018

Instance Method Details

#dimension_unitsArray(Integer, Float)?

The #dimension_units method returns the unit format and precision for dimensions, or nil if the Style does not have a value for that setting. Units may be for either LinearDimensions or AngularDimensions, but not both.

The units can be one of the following values:

Layout::Style::FRACTIONAL_INCHES
Layout::Style::ARCHITECTURAL_INCHES
Layout::Style::ENGINEERING_FEET
Layout::Style::DECIMAL_INCHES
Layout::Style::DECIMAL_FEET
Layout::Style::DECIMAL_MILLIMETERS
Layout::Style::DECIMAL_CENTIMETERS
Layout::Style::DECIMAL_METERS
Layout::Style::DECIMAL_POINTS
Layout::Style::DEGREES
Layout::Style::RADIANS

Examples:

doc = Layout::Document.open("C:/path/to/document.layout")
page = doc.pages.first
entity = page.entities.first
style = entity.style
units, precision = style.dimension_units

Version:

  • LayOut 2018

#get_sub_style(type) ⇒ Style

The #get_sub_style method returns the Style for a sub-entity from the Style. This would be used to get the current style of a LinearDimension‘s text, for example.

Examples:

doc = Layout::Document.open("C:/path/to/document.layout")
page = doc.pages.first
entity = page.entities.first
style = entity.style
sub_style = style.get_sub_style(Layout::Style::DIMENSION_TEXT)

Parameters:

  • type (Integer)

Raises:

  • (ArgumentError)

    if type is not a valid sub-entity type.

Version:

  • LayOut 2018

#set_dimension_units(units, precision)

The #set_dimension_units method sets the unit format and precision for dimensions. Units may be for either LinearDimensions or AngularDimensions, but not both.

The units can be one of the following values:

Layout::Style::FRACTIONAL_INCHES
Layout::Style::ARCHITECTURAL_INCHES
Layout::Style::ENGINEERING_FEET
Layout::Style::DECIMAL_INCHES
Layout::Style::DECIMAL_FEET
Layout::Style::DECIMAL_MILLIMETERS
Layout::Style::DECIMAL_CENTIMETERS
Layout::Style::DECIMAL_METERS
Layout::Style::DECIMAL_POINTS
Layout::Style::DEGREES
Layout::Style::RADIANS

Examples:

doc = Layout::Document.open("C:/path/to/document.layout")
page = doc.pages.first
entity = page.entities.first
style = entity.style
precision = 0.0001
units = Layout::Style::DECIMAL_MILLIMETERS
style.set_dimension_units(units, precision)

Parameters:

  • units (Integer)
  • precision (Float)

Raises:

  • (ArgumentError)

    if units is not a valid unit format

Version:

  • LayOut 2018

#set_sub_style(type, sub_style)

The #set_sub_style method adds a Style to apply to a Entity‘s sub-entity. This would be used to set the arrow type for extension lines of a LinearDimension, for example.

Examples:

doc = Layout::Document.open("C:/path/to/document.layout")
page = doc.pages.first
entity = page.entities.first
style = entity.style
sub_style = style.get_sub_style(Layout::Style::DIMENSION_TEXT)
sub_style.dimension_vertical_alignment = Layout::Style::DIMENSION_TEXT_BELOW
style.set_sub_style(Layout::Style::DIMENSION_TEXT, sub_style)
# Set the style to apply changes
entity.style = style

Parameters:

  • type (Integer)
  • sub_style (Style)

Raises:

  • (ArgumentError)

    if type is not a valid sub-entity type.

Version:

  • LayOut 2018