123456789_123456789_123456789_123456789_123456789_

Class: Layout::Grid

Relationships
Inherits: Object

Overview

Class that references a Document‘s grid settings.

Version:

  • LayOut 2018

Instance Attribute Summary

Instance Attribute Details

#clip_to_margins=(clip) (rw)

The #clip_to_margins= method sets whether or not the grid is clipped to the page margins.

Examples:

doc = Layout::Document.open("C:/path/to/document.layout")
grid = doc.grid
grid.clip_to_margins = true

Parameters:

  • clip (Boolean)

Version:

  • LayOut 2020.1

#clip_to_margins?Boolean (rw)

The #clip_to_margins? method returns whether or not the grid is clipped to the page margins.

Examples:

doc = Layout::Document.open("C:/path/to/document.layout")
grid = doc.grid
in_front = grid.clip_to_margins?

Version:

  • LayOut 2020.1

#in_front=(in_front) (rw)

The #in_front= method sets whether or not the grid is drawn on top of entities.

Examples:

doc = Layout::Document.open("C:/path/to/document.layout")
grid = doc.grid
grid.in_front = true

Parameters:

  • in_front (Boolean)

Version:

  • LayOut 2020.1

#in_front?Boolean (rw)

The #in_front? method returns whether or not the grid is drawn on top of entities.

Examples:

doc = Layout::Document.open("C:/path/to/document.layout")
grid = doc.grid
in_front = grid.in_front?

Version:

  • LayOut 2020.1

#major_colorSketchup::Color (rw)

The #major_color method returns the ::Sketchup::Color for the major grid lines.

Examples:

doc = Layout::Document.open("C:/path/to/document.layout")
grid = doc.grid
color = grid.major_color

Version:

  • LayOut 2018

#major_color=(color) (rw)

The #major_color= method sets the ::Sketchup::Color for the major grid lines.

Examples:

doc = Layout::Document.open("C:/path/to/document.layout")
grid = doc.grid
grid.major_color = Sketchup::Color.new(255, 0, 0)
grid.major_color = 255
grid.major_color = 0x0000ff
grid.major_color = "red"
grid.major_color = "#ff0000"
grid.major_color = [1.0, 0.0, 0.0]
grid.major_color = [255, 0, 0]

Parameters:

Version:

  • LayOut 2020.1

#major_spacingNumeric (rw)

The #major_spacing method returns the major space size of the Grid.

Examples:

doc = Layout::Document.open("C:/path/to/document.layout")
grid = doc.grid
major_spacing = grid.major_spacing

Version:

  • LayOut 2018

#major_spacing=(spacing) (rw)

The #major_spacing= method sets the major space size of the Grid.

Examples:

doc = Layout::Document.open("C:/path/to/document.layout")
grid = doc.grid
grid.major_spacing = 1.25

Parameters:

  • spacing (Float)

    The double specifying the space size for the Grid

Raises:

  • (ArgumentError)

    if spacing is not greater than zero

Version:

  • LayOut 2020.1

#minor_colorSketchup::Color (rw)

The #minor_color method returns the ::Sketchup::Color for the minor grid lines.

Examples:

doc = Layout::Document.open("C:/path/to/document.layout")
grid = doc.grid
color = grid.minor_color

Version:

  • LayOut 2018

#minor_color=(color) (rw)

The #minor_color= method sets the ::Sketchup::Color for the minor grid lines.

Examples:

doc = Layout::Document.open("C:/path/to/document.layout")
grid = doc.grid
grid.minor_color = Sketchup::Color.new(255, 0, 0)
grid.minor_color = 255
grid.minor_color = 0x0000ff
grid.minor_color = "red"
grid.minor_color = "#ff0000"
grid.minor_color = [1.0, 0.0, 0.0]
grid.minor_color = [255, 0, 0]

Parameters:

Version:

  • LayOut 2020.1

#minor_divisionsInteger (rw)

The #minor_divisions method returns the number of minor divisions of the Grid.

Examples:

doc = Layout::Document.open("C:/path/to/document.layout")
grid = doc.grid
minor_divisions = grid.minor_divisions

Version:

  • LayOut 2018

#minor_divisions=(divisions) (rw)

The #minor_divisions= method sets the number of minor divisions of the Grid.

Examples:

doc = Layout::Document.open("C:/path/to/document.layout")
grid = doc.grid
grid.major_spacing = 1.25

Parameters:

  • divisions (Integer)

    The number of minor divisions for the Grid

Raises:

  • (ArgumentError)

    if divisions is negative

Version:

  • LayOut 2020.1

#print=(print) (rw)

The #print= method sets whether or not the Grid is printed.

Examples:

doc = Layout::Document.open("C:/path/to/document.layout")
grid = doc.grid
grid.print = false

Parameters:

  • print (Boolean)

Version:

  • LayOut 2020.1

#print?Boolean (rw)

The #print? method returns whether or not the Grid is printed.

Examples:

doc = Layout::Document.open("C:/path/to/document.layout")
grid = doc.grid
print = grid.print?

Version:

  • LayOut 2018

#show=(show) (rw)

The #show= method sets whether or not the Grid is visible.

Examples:

doc = Layout::Document.open("C:/path/to/document.layout")
grid = doc.grid
grid.show = true

Parameters:

  • show (Boolean)

Version:

  • LayOut 2020.1

#show?Boolean (rw)

The #show? method returns whether or not the Grid is visible.

Examples:

doc = Layout::Document.open("C:/path/to/document.layout")
grid = doc.grid
show = grid.show?

Version:

  • LayOut 2018

#show_major=(show) (rw)

The #show_major= method sets whether or not the major grid lines are visible.

Examples:

doc = Layout::Document.open("C:/path/to/document.layout")
grid = doc.grid
grid.show_major = true

Parameters:

  • show (Boolean)

Version:

  • LayOut 2020.1

#show_major?Boolean (rw)

The #show_major? method returns whether or not the major grid lines are visible.

Examples:

doc = Layout::Document.open("C:/path/to/document.layout")
grid = doc.grid
show_major = grid.show_major?

Version:

  • LayOut 2018

#show_minor=(show) (rw)

The #show_minor= method sets whether or not the minor grid lines are visible.

Examples:

doc = Layout::Document.open("C:/path/to/document.layout")
grid = doc.grid
grid.show_minor = false

Parameters:

  • show (Boolean)

Version:

  • LayOut 2020.1

#show_minor?Boolean (rw)

The #show_minor? method returns whether or not the minor grid lines are visible.

Examples:

doc = Layout::Document.open("C:/path/to/document.layout")
grid = doc.grid
show_minor = grid.show_minor?

Version:

  • LayOut 2018