Class: Layout::Document
Relationships | |
Inherits: | Object |
Overview
This is the interface to a LayOut document. A Document
is the 2D drawing that the user is working with, and it serves as the “entry point” for most Ruby API interactions. The .open method gives you a handle to a Document
, and from there you can use the document-level methods to start getting information and making changes.
Constant Summary
-
DECIMAL_CENTIMETERS =
Constants
nil
-
DECIMAL_FEET =
Stub value.
nil
-
DECIMAL_INCHES =
Stub value.
nil
-
DECIMAL_METERS =
Stub value.
nil
-
DECIMAL_MILLIMETERS =
Stub value.
nil
-
DECIMAL_POINTS =
Stub value.
nil
-
FRACTIONAL_INCHES =
Stub value.
nil
-
VERSION_1 =
Stub value.
nil
-
VERSION_2 =
Stub value.
nil
-
VERSION_2013 =
Stub value.
nil
-
VERSION_2014 =
Stub value.
nil
-
VERSION_2015 =
Stub value.
nil
-
VERSION_2016 =
Stub value.
nil
-
VERSION_2017 =
Stub value.
nil
-
VERSION_2018 =
Stub value.
nil
-
VERSION_2019 =
Stub value.
nil
-
VERSION_2020 =
Stub value.
nil
-
VERSION_2021 =
Stub value.
nil
-
VERSION_2022 =
Stub value.
nil
-
VERSION_2023 =
Stub value.
nil
-
VERSION_3 =
Stub value.
nil
-
VERSION_CURRENT =
Stub value.
nil
Class Method Summary
-
.new ⇒ Layout::Document
constructor
The
#initialize
method creates a newDocument
. -
.open(path) ⇒ Layout::Document
The .open method creates a new
Document
by loading an existing .layout file.
Instance Attribute Summary
-
#grid_snap_enabled=(enabled)
rw
The #grid_snap_enabled= method sets whether or not grid snap is enabled in the
Document
. -
#grid_snap_enabled? ⇒ Boolean
rw
The #grid_snap_enabled? method returns whether or not grid snap is enabled in the
Document
. -
#object_snap_enabled=(enabled)
rw
The #object_snap_enabled= method enables or disables inference in the
Document
. -
#object_snap_enabled? ⇒ Boolean
rw
The #object_snap_enabled? method returns whether or not inference is enabled in the
Document
. -
#precision ⇒ Float
rw
The #precision method returns the precision for the
Document
. -
#precision=(precision)
rw
The #precision= method sets the precision for the
Document
. -
#render_mode_override ⇒ Integer
rw
The #render_mode_override method returns the override setting for output render modes of
SketchUpModel
s in theDocument
. -
#render_mode_override=(render_mode)
rw
The #render_mode_override= method sets the override setting for output render modes of
SketchUpModel
s in theDocument
. -
#units ⇒ Integer
rw
The #units method returns the units for the
Document
. -
#units=(units_format)
rw
The #units= method sets the units for the
Document
.
Instance Method Summary
-
#==(other) ⇒ Boolean
The #== method checks to see if the two
Document
s are equal. -
#add_entity(entity, layer, page)
The #add_entity method adds an
Entity
to theDocument
and places it on the givenLayer
andPage
. -
#auto_text_definitions ⇒ Layout::AutoTextDefinitions
The #auto_text_definitions method returns an array of
AutoTextDefinition
‘s in theDocument
. -
#export(file_path, options = nil)
The #export method exports the
Document
to a given file format. - #grid ⇒ Layout::Grid
- #layers ⇒ Layout::Layers
-
#page_info ⇒ Layout::PageInfo
The #page_info method returns a reference to the
PageInfo
settings of theDocument
. - #pages ⇒ Layout::Pages
-
#path ⇒ String
The #path method returns the full path of the
Document
file. -
#remove_entity(entity)
The #remove_entity method removes an
Entity
from theDocument
. -
#save
The #save method saves the
Document
to a file at the given path. -
#shared_entities ⇒ Layout::Entities
The #shared_entities method returns the
Entities
that exist on sharedLayer
s in theDocument
. -
#time_created ⇒ Time
The #time_created method returns the time when the
Document
was created. -
#time_modified ⇒ Time
The #time_modified method returns the last time the
Document
was modified. -
#time_published ⇒ Time
The #time_published method returns the time when the
Document
was published.
Constructor Details
.new ⇒ Document
.new(template_path) ⇒ Document
Document
.new(template_path) ⇒ Document
The #initialize
method creates a new Document
. Passing a path to an existing Document
will use that file as a template. The new Document
won’t have a path until it is saved for the first time.
Class Method Details
.open(path) ⇒ Document
The .open
method creates a new Document
by loading an existing .layout file.
Instance Attribute Details
#grid_snap_enabled=(enabled) (rw)
The #grid_snap_enabled=
method sets whether or not grid snap is enabled in the Document
.
#grid_snap_enabled? ⇒ Boolean
(rw)
The #grid_snap_enabled?
method returns whether or not grid snap is enabled in the Document
.
#object_snap_enabled=(enabled) (rw)
The #object_snap_enabled=
method enables or disables inference in the Document
.
#object_snap_enabled? ⇒ Boolean
(rw)
The #object_snap_enabled?
method returns whether or not inference is enabled in the Document
.
#precision ⇒ Float
(rw)
The #precision
method returns the precision for the Document
.
#precision=(precision) (rw)
LayOut only allows for a finite set of precision values for each units setting, so it will set the precision to the closest valid setting for the specified units. See the “Units” section of LayOut’s “Document Setup” dialog for a reference of the available precisions for each units setting.
The #precision=
method sets the precision for the Document
.
#render_mode_override ⇒ Integer
(rw)
The #render_mode_override
method returns the override setting for output render modes of SketchUpModel
s in the Document
.
#render_mode_override=(render_mode) (rw)
The #render_mode_override=
method sets the override setting for output render modes of SketchUpModel
s in the Document
. Setting this to NO_OVERRIDE
will prevent overriding the individual SketchUpModel
render mode setting during export. This override will only affect raster rendered SketchUpModel
s, if a viewport is set to vector or hybrid, it will retain that render mode as its output render mode.
#units ⇒ Integer
(rw)
The #units
method returns the units for the Document
.
#units=(units_format) (rw)
The #units=
method sets the units for the Document
.
Instance Method Details
#==(other) ⇒ Boolean
The #==
method checks to see if the two Document
s are equal. This checks whether the Ruby Objects are pointing to the same internal object.
#add_entity(entity, layer, page)
#add_entity(entity, layer)
The #add_entity
method adds an Entity
to the Document
and places it on the given Layer
and Page
. If layer is a shared Layer
then page may be ommitted. The Entity
must not already belong to a Document
. If the Entity
is a Group
, then the Group
along with all of its children will be added to the Document
.
#auto_text_definitions ⇒ Layout::AutoTextDefinitions
The #auto_text_definitions
method returns an array of AutoTextDefinition
‘s in the Document
.
#export(file_path, options = nil)
The #export
method exports the Document
to a given file format. It knows which format to export based on the file extension you place on the file name. For example, a filename of “thing.pdf” will export a PDF file, whereas “thing.png” will export a set of PNG images.
For LayOut version 2020.1, valid extensions include .pdf, .jpg, and .png.
#grid ⇒ Layout::Grid
The #grid
method returns the Grid
for a Document
.
#layers ⇒ Layout::Layers
The #layers
method returns the Layers
of the Document
.
#page_info ⇒ Layout::PageInfo
The #page_info
method returns a reference to the PageInfo
settings of the Document
.
#pages ⇒ Layout::Pages
#path ⇒ String
The #path
method returns the full path of the Document
file. An empty string is returned for a new Document
(one which has not been saved and opened).
#remove_entity(entity)
#save
#save(path, version = Layout::Document::VERSION_CURRENT)
The #save
method saves the Document
to a file at the given path. Passing an empty path string will save the Document
at its current path.
#time_created ⇒ Time
The #time_created
method returns the time when the Document
was created.
#time_modified ⇒ Time
The #time_modified
method returns the last time the Document
was modified.
#time_published ⇒ Time
The #time_published
method returns the time when the Document
was published.