Class: Layout::Grid

Inherits:
Object
  • Object
show all
Defined in:
lib/sketchup-api-stubs/stubs/Layout/Grid.rb

Overview

Class that references a Document‘s grid settings.

Version:

  • LayOut 2018

Instance Method Summary collapse

Instance Method Details

#clip_to_margins=(clip) ⇒ Object

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



22
23
# File 'lib/sketchup-api-stubs/stubs/Layout/Grid.rb', line 22

def clip_to_margins=(clip)
end

#clip_to_margins?Boolean

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?

Returns:

  • (Boolean)

Version:

  • LayOut 2020.1



36
37
# File 'lib/sketchup-api-stubs/stubs/Layout/Grid.rb', line 36

def clip_to_margins?
end

#in_front=(in_front) ⇒ Object

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



50
51
# File 'lib/sketchup-api-stubs/stubs/Layout/Grid.rb', line 50

def in_front=(in_front)
end

#in_front?Boolean

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?

Returns:

  • (Boolean)

Version:

  • LayOut 2020.1



64
65
# File 'lib/sketchup-api-stubs/stubs/Layout/Grid.rb', line 64

def in_front?
end

#major_colorSketchup::Color

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

Returns:

Version:

  • LayOut 2018



78
79
# File 'lib/sketchup-api-stubs/stubs/Layout/Grid.rb', line 78

def major_color
end

#major_color=(color) ⇒ Object

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



98
99
# File 'lib/sketchup-api-stubs/stubs/Layout/Grid.rb', line 98

def major_color=(color)
end

#major_spacingNumeric

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

Examples:

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

Returns:

Version:

  • LayOut 2018



112
113
# File 'lib/sketchup-api-stubs/stubs/Layout/Grid.rb', line 112

def major_spacing
end

#major_spacing=(spacing) ⇒ Object

The #major_spacing= method sets the major space size of the Layout::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 Layout::Grid

Raises:

  • (ArgumentError)

    if spacing is not greater than zero

Version:

  • LayOut 2020.1



130
131
# File 'lib/sketchup-api-stubs/stubs/Layout/Grid.rb', line 130

def major_spacing=(spacing)
end

#minor_colorSketchup::Color

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

Returns:

Version:

  • LayOut 2018



144
145
# File 'lib/sketchup-api-stubs/stubs/Layout/Grid.rb', line 144

def minor_color
end

#minor_color=(color) ⇒ Object

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



164
165
# File 'lib/sketchup-api-stubs/stubs/Layout/Grid.rb', line 164

def minor_color=(color)
end

#minor_divisionsInteger

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

Examples:

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

Returns:

  • (Integer)

Version:

  • LayOut 2018



178
179
# File 'lib/sketchup-api-stubs/stubs/Layout/Grid.rb', line 178

def minor_divisions
end

#minor_divisions=(divisions) ⇒ Object

The #minor_divisions= method sets the number of minor divisions of the Layout::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 Layout::Grid

Raises:

  • (ArgumentError)

    if divisions is negative

Version:

  • LayOut 2020.1



196
197
# File 'lib/sketchup-api-stubs/stubs/Layout/Grid.rb', line 196

def minor_divisions=(divisions)
end

#print=(print) ⇒ Object

The #print= method sets whether or not the Layout::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



210
211
# File 'lib/sketchup-api-stubs/stubs/Layout/Grid.rb', line 210

def print=(print)
end

#print?Boolean

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

Examples:

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

Returns:

  • (Boolean)

Version:

  • LayOut 2018



224
225
# File 'lib/sketchup-api-stubs/stubs/Layout/Grid.rb', line 224

def print?
end

#show=(show) ⇒ Object

The #show= method sets whether or not the Layout::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



238
239
# File 'lib/sketchup-api-stubs/stubs/Layout/Grid.rb', line 238

def show=(show)
end

#show?Boolean

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

Examples:

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

Returns:

  • (Boolean)

Version:

  • LayOut 2018



252
253
# File 'lib/sketchup-api-stubs/stubs/Layout/Grid.rb', line 252

def show?
end

#show_major=(show) ⇒ Object

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



266
267
# File 'lib/sketchup-api-stubs/stubs/Layout/Grid.rb', line 266

def show_major=(show)
end

#show_major?Boolean

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?

Returns:

  • (Boolean)

Version:

  • LayOut 2018



280
281
# File 'lib/sketchup-api-stubs/stubs/Layout/Grid.rb', line 280

def show_major?
end

#show_minor=(show) ⇒ Object

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



294
295
# File 'lib/sketchup-api-stubs/stubs/Layout/Grid.rb', line 294

def show_minor=(show)
end

#show_minor?Boolean

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?

Returns:

  • (Boolean)

Version:

  • LayOut 2018



308
309
# File 'lib/sketchup-api-stubs/stubs/Layout/Grid.rb', line 308

def show_minor?
end