Class: Layout::Document
- Inherits:
-
Object
- Object
- Layout::Document
- Defined in:
- SketchUp/Layout/Document.rb
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 Document.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 collapse
- 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_3 =
Stub value.
nil- VERSION_CURRENT =
Stub value.
nil
Class Method Summary collapse
-
.open(path) ⇒ Layout::Document
The Document.open method creates a new Document by loading an existing .layout file.
Instance Method Summary collapse
- #==(other) ⇒ Boolean
-
#add_entity(*args) ⇒ Object
The #add_entity method adds an Entity to the Document and places it on the given Layer and Page.
-
#auto_text_definitions ⇒ Layout::AutoTextDefinitions
The #auto_text_definitions method returns an array of AutoTextDefinition‘s in the Document.
- #grid ⇒ Layout::Grid
-
#grid_snap_enabled=(enabled) ⇒ Object
The #grid_snap_enabled= method sets whether or not grid snap is enabled in the Document.
-
#grid_snap_enabled? ⇒ Boolean
The #grid_snap_enabled? method returns whether or not grid snap is enabled in the Document.
-
#initialize(*args) ⇒ Document
constructor
The #initialize method creates a new Document.
- #layers ⇒ Layout::Layers
-
#object_snap_enabled=(enabled) ⇒ Object
The #object_snap_enabled= method enables or disables inference in the Document.
-
#object_snap_enabled? ⇒ Boolean
The #object_snap_enabled? method returns whether or not inference is enabled in 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
-
#precision ⇒ Float
The #precision method returns the precision for the Document.
-
#precision=(precision) ⇒ Object
The #precision= method sets the precision for the Document.
-
#remove_entity(entity) ⇒ Object
The #remove_entity method removes an Entity from the Document.
- #save(*args) ⇒ Object
-
#shared_entities ⇒ Layout::Entities
The #shared_entities method returns the Entities that exist on shared Layers in the Document.
-
#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.
- #units ⇒ Integer
- #units=(units_format) ⇒ Object
Constructor Details
#initialize ⇒ Layout::Document #initialize(template_path) ⇒ Layout::Document
The #initialize method creates a new Layout::Document. Passing a path to an existing Layout::Document will use that file as a template. The new Layout::Document won’t have a path until it is saved for the first time.
210 211 |
# File 'SketchUp/Layout/Document.rb', line 210 def initialize(*args) end |
Class Method Details
.open(path) ⇒ Layout::Document
The open method creates a new Layout::Document by loading an existing .layout file.
68 69 |
# File 'SketchUp/Layout/Document.rb', line 68 def self.open(path) end |
Instance Method Details
#==(other) ⇒ Boolean
The #== method checks to see if the two Layout::Documents are equal. This checks whether the Ruby Objects are pointing to the same internal object.
87 88 |
# File 'SketchUp/Layout/Document.rb', line 87 def ==(other) end |
#add_entity(entity, layer, page) ⇒ Object #add_entity(entity, layer) ⇒ Object
The #add_entity method adds an Entity to the Layout::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 Layout::Document. If the Entity is a Group, then the Group along with all of its children will be added to the Layout::Document.
128 129 |
# File 'SketchUp/Layout/Document.rb', line 128 def add_entity(*args) end |
#auto_text_definitions ⇒ Layout::AutoTextDefinitions
The #auto_text_definitions method returns an array of AutoTextDefinition‘s in the Layout::Document.
141 142 |
# File 'SketchUp/Layout/Document.rb', line 141 def auto_text_definitions end |
#grid ⇒ Layout::Grid
The #grid method returns the Grid for a Layout::Document.
153 154 |
# File 'SketchUp/Layout/Document.rb', line 153 def grid end |
#grid_snap_enabled=(enabled) ⇒ Object
The #grid_snap_enabled= method sets whether or not grid snap is enabled in the Layout::Document.
167 168 |
# File 'SketchUp/Layout/Document.rb', line 167 def grid_snap_enabled=(enabled) end |
#grid_snap_enabled? ⇒ Boolean
The #grid_snap_enabled? method returns whether or not grid snap is enabled in the Layout::Document.
182 183 |
# File 'SketchUp/Layout/Document.rb', line 182 def grid_snap_enabled? end |
#layers ⇒ Layout::Layers
The #layers method returns the Layers of the Layout::Document.
222 223 |
# File 'SketchUp/Layout/Document.rb', line 222 def layers end |
#object_snap_enabled=(enabled) ⇒ Object
The #object_snap_enabled= method enables or disables inference in the Layout::Document.
236 237 |
# File 'SketchUp/Layout/Document.rb', line 236 def object_snap_enabled=(enabled) end |
#object_snap_enabled? ⇒ Boolean
The #object_snap_enabled? method returns whether or not inference is enabled in the Layout::Document.
251 252 |
# File 'SketchUp/Layout/Document.rb', line 251 def object_snap_enabled? end |
#page_info ⇒ Layout::PageInfo
The #page_info method returns a reference to the PageInfo settings of the Layout::Document.
264 265 |
# File 'SketchUp/Layout/Document.rb', line 264 def page_info end |
#pages ⇒ Layout::Pages
The #pages method returns the Pages of the Layout::Document.
@example:
doc = Layout::Document.open("C:/path/to/document.layout")
doc_pages = doc.pages
277 278 |
# File 'SketchUp/Layout/Document.rb', line 277 def pages end |
#path ⇒ String
The #path method returns the full path of the Layout::Document file. An empty string is returned for a new Layout::Document (one which has not been saved and opened).
291 292 |
# File 'SketchUp/Layout/Document.rb', line 291 def path end |
#precision ⇒ Float
The #precision method returns the precision for the Layout::Document.
304 305 |
# File 'SketchUp/Layout/Document.rb', line 304 def precision end |
#precision=(precision) ⇒ Object
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 Layout::Document.
323 324 |
# File 'SketchUp/Layout/Document.rb', line 323 def precision=(precision) end |
#remove_entity(entity) ⇒ Object
The #remove_entity method removes an Entity from the Layout::Document. If entity is a Group, then the Group and all of its children will be removed from the Layout::Document.
342 343 |
# File 'SketchUp/Layout/Document.rb', line 342 def remove_entity(entity) end |
#save ⇒ Object #save(path, version = Layout::Document::VERSION_CURRENT) ⇒ Object
The #save method saves the Layout::Document to a file at the given path. Passing an empty path string will save the Layout::Document at its current path.
375 376 |
# File 'SketchUp/Layout/Document.rb', line 375 def save(*args) end |
#shared_entities ⇒ Layout::Entities
The #shared_entities method returns the Entities that exist on shared Layers in the Layout::Document.
388 389 |
# File 'SketchUp/Layout/Document.rb', line 388 def shared_entities end |
#time_created ⇒ Time
The #time_created method returns the time when the Layout::Document was created.
401 402 |
# File 'SketchUp/Layout/Document.rb', line 401 def time_created end |
#time_modified ⇒ Time
The #time_modified method returns the last time the Layout::Document was modified.
414 415 |
# File 'SketchUp/Layout/Document.rb', line 414 def time_modified end |
#time_published ⇒ Time
The #time_published method returns the time when the Layout::Document was published.
427 428 |
# File 'SketchUp/Layout/Document.rb', line 427 def time_published end |
#units ⇒ Integer
The #units method returns the units for the Layout::Document.
439 440 |
# File 'SketchUp/Layout/Document.rb', line 439 def units end |
#units=(units_format) ⇒ Object
The #units= method sets the units for the Layout::Document.
455 456 |
# File 'SketchUp/Layout/Document.rb', line 455 def units=(units_format) end |