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 =
# File 'lib/sketchup-api-stubs/stubs/Layout/Document.rb', line 30
Constants
nil -
DECIMAL_FEET =
# File 'lib/sketchup-api-stubs/stubs/Layout/Document.rb', line 31
Stub value.
nil -
DECIMAL_INCHES =
# File 'lib/sketchup-api-stubs/stubs/Layout/Document.rb', line 32
Stub value.
nil -
DECIMAL_METERS =
# File 'lib/sketchup-api-stubs/stubs/Layout/Document.rb', line 33
Stub value.
nil -
DECIMAL_MILLIMETERS =
# File 'lib/sketchup-api-stubs/stubs/Layout/Document.rb', line 34
Stub value.
nil -
DECIMAL_POINTS =
# File 'lib/sketchup-api-stubs/stubs/Layout/Document.rb', line 35
Stub value.
nil -
FRACTIONAL_INCHES =
# File 'lib/sketchup-api-stubs/stubs/Layout/Document.rb', line 37
Stub value.
nil -
VERSION_1 =
# File 'lib/sketchup-api-stubs/stubs/Layout/Document.rb', line 39
Stub value.
nil -
VERSION_2 =
# File 'lib/sketchup-api-stubs/stubs/Layout/Document.rb', line 40
Stub value.
nil -
VERSION_2013 =
# File 'lib/sketchup-api-stubs/stubs/Layout/Document.rb', line 41
Stub value.
nil -
VERSION_2014 =
# File 'lib/sketchup-api-stubs/stubs/Layout/Document.rb', line 42
Stub value.
nil -
VERSION_2015 =
# File 'lib/sketchup-api-stubs/stubs/Layout/Document.rb', line 43
Stub value.
nil -
VERSION_2016 =
# File 'lib/sketchup-api-stubs/stubs/Layout/Document.rb', line 44
Stub value.
nil -
VERSION_2017 =
# File 'lib/sketchup-api-stubs/stubs/Layout/Document.rb', line 45
Stub value.
nil -
VERSION_2018 =
# File 'lib/sketchup-api-stubs/stubs/Layout/Document.rb', line 46
Stub value.
nil -
VERSION_2019 =
# File 'lib/sketchup-api-stubs/stubs/Layout/Document.rb', line 47
Stub value.
nil -
VERSION_2020 =
# File 'lib/sketchup-api-stubs/stubs/Layout/Document.rb', line 48
Stub value.
nil -
VERSION_2021 =
# File 'lib/sketchup-api-stubs/stubs/Layout/Document.rb', line 49
Stub value.
nil -
VERSION_2022 =
# File 'lib/sketchup-api-stubs/stubs/Layout/Document.rb', line 50
Stub value.
nil -
VERSION_2023 =
# File 'lib/sketchup-api-stubs/stubs/Layout/Document.rb', line 51
Stub value.
nil -
VERSION_3 =
# File 'lib/sketchup-api-stubs/stubs/Layout/Document.rb', line 52
Stub value.
nil -
VERSION_CURRENT =
# File 'lib/sketchup-api-stubs/stubs/Layout/Document.rb', line 53
Stub value.
nil
Class Method Summary
-
.new ⇒ Layout::Document
constructor
The
#initializemethod creates a newDocument. -
.open(path) ⇒ Layout::Document
The .open method creates a new
Documentby 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
SketchUpModels in theDocument. -
#render_mode_override=(render_mode)
rw
The #render_mode_override= method sets the override setting for output render modes of
SketchUpModels 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
Documents are equal. -
#add_entity(entity, layer, page)
The #add_entity method adds an
Entityto theDocumentand places it on the givenLayerandPage. -
#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
Documentto a given file format. - #grid ⇒ Layout::Grid
- #layers ⇒ Layout::Layers
-
#page_info ⇒ Layout::PageInfo
The #page_info method returns a reference to the
PageInfosettings of theDocument. - #pages ⇒ Layout::Pages
-
#path ⇒ String
The #path method returns the full path of the
Documentfile. -
#remove_entity(entity)
The #remove_entity method removes an
Entityfrom theDocument. -
#save
The #save method saves the
Documentto a file at the given path. -
#shared_entities ⇒ Layout::Entities
The #shared_entities method returns the
Entitiesthat exist on sharedLayers in theDocument. -
#time_created ⇒ Time
The #time_created method returns the time when the
Documentwas created. -
#time_modified ⇒ Time
The #time_modified method returns the last time the
Documentwas modified. -
#time_published ⇒ Time
The #time_published method returns the time when the
Documentwas 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 SketchUpModels in the Document.
#render_mode_override=(render_mode) (rw)
The #render_mode_override= method sets the override setting for output render modes of SketchUpModels 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 SketchUpModels, 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 Documents 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.