sketchup-api-stubs 0.1.2 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/SketchUp/Geom/BoundingBox.rb +17 -20
- data/SketchUp/Geom/Bounds2d.rb +172 -0
- data/SketchUp/Geom/LatLong.rb +31 -16
- data/SketchUp/Geom/OrientedBounds2d.rb +102 -0
- data/SketchUp/Geom/Point2d.rb +365 -0
- data/SketchUp/Geom/Point3d.rb +121 -110
- data/SketchUp/Geom/PolygonMesh.rb +30 -21
- data/SketchUp/Geom/Transformation.rb +8 -4
- data/SketchUp/Geom/Transformation2d.rb +125 -0
- data/SketchUp/Geom/UTM.rb +43 -37
- data/SketchUp/Geom/Vector2d.rb +497 -0
- data/SketchUp/Geom/Vector3d.rb +143 -131
- data/SketchUp/Layout.rb +25 -0
- data/SketchUp/Layout/AngularDimension.rb +569 -0
- data/SketchUp/Layout/AutoTextDefinition.rb +417 -0
- data/SketchUp/Layout/AutoTextDefinitions.rb +186 -0
- data/SketchUp/Layout/ConnectionPoint.rb +70 -0
- data/SketchUp/Layout/Document.rb +458 -0
- data/SketchUp/Layout/Ellipse.rb +29 -0
- data/SketchUp/Layout/Entities.rb +155 -0
- data/SketchUp/Layout/Entity.rb +363 -0
- data/SketchUp/Layout/FormattedText.rb +349 -0
- data/SketchUp/Layout/Grid.rb +131 -0
- data/SketchUp/Layout/Group.rb +261 -0
- data/SketchUp/Layout/Image.rb +86 -0
- data/SketchUp/Layout/Label.rb +371 -0
- data/SketchUp/Layout/Layer.rb +222 -0
- data/SketchUp/Layout/LayerInstance.rb +128 -0
- data/SketchUp/Layout/Layers.rb +232 -0
- data/SketchUp/Layout/LinearDimension.rb +563 -0
- data/SketchUp/Layout/LockedEntityError.rb +10 -0
- data/SketchUp/Layout/LockedLayerError.rb +11 -0
- data/SketchUp/Layout/Page.rb +187 -0
- data/SketchUp/Layout/PageInfo.rb +393 -0
- data/SketchUp/Layout/Pages.rb +216 -0
- data/SketchUp/Layout/Path.rb +326 -0
- data/SketchUp/Layout/Rectangle.rb +174 -0
- data/SketchUp/Layout/SketchUpModel.rb +522 -0
- data/SketchUp/Layout/Style.rb +1520 -0
- data/SketchUp/Layout/Table.rb +290 -0
- data/SketchUp/Layout/TableCell.rb +149 -0
- data/SketchUp/Layout/TableColumn.rb +139 -0
- data/SketchUp/Layout/TableRow.rb +135 -0
- data/SketchUp/Sketchup/Animation.rb +7 -4
- data/SketchUp/Sketchup/ArcCurve.rb +10 -10
- data/SketchUp/Sketchup/AttributeDictionaries.rb +13 -4
- data/SketchUp/Sketchup/AttributeDictionary.rb +12 -12
- data/SketchUp/Sketchup/Color.rb +68 -78
- data/SketchUp/Sketchup/ComponentDefinition.rb +60 -60
- data/SketchUp/Sketchup/ComponentInstance.rb +57 -55
- data/SketchUp/Sketchup/DefinitionList.rb +34 -17
- data/SketchUp/Sketchup/Drawingelement.rb +19 -21
- data/SketchUp/Sketchup/Edge.rb +22 -24
- data/SketchUp/Sketchup/Entities.rb +173 -162
- data/SketchUp/Sketchup/Entity.rb +71 -55
- data/SketchUp/Sketchup/Face.rb +45 -44
- data/SketchUp/Sketchup/Group.rb +47 -49
- data/SketchUp/Sketchup/Image.rb +16 -0
- data/SketchUp/Sketchup/ImageRep.rb +226 -0
- data/SketchUp/Sketchup/InstancePath.rb +13 -13
- data/SketchUp/Sketchup/Layer.rb +15 -17
- data/SketchUp/Sketchup/Material.rb +40 -30
- data/SketchUp/Sketchup/Materials.rb +40 -22
- data/SketchUp/Sketchup/Menu.rb +5 -5
- data/SketchUp/Sketchup/Model.rb +230 -228
- data/SketchUp/Sketchup/Page.rb +32 -0
- data/SketchUp/Sketchup/Pages.rb +3 -4
- data/SketchUp/Sketchup/RenderingOptions.rb +21 -16
- data/SketchUp/Sketchup/SectionPlane.rb +64 -0
- data/SketchUp/Sketchup/Selection.rb +20 -28
- data/SketchUp/Sketchup/ShadowInfo.rb +14 -14
- data/SketchUp/Sketchup/Text.rb +24 -26
- data/SketchUp/Sketchup/Texture.rb +28 -12
- data/SketchUp/Sketchup/Vertex.rb +14 -11
- data/SketchUp/Sketchup/View.rb +126 -116
- data/SketchUp/UI/Command.rb +17 -17
- data/SketchUp/UI/HtmlDialog.rb +8 -5
- data/SketchUp/UI/Notification.rb +1 -1
- data/SketchUp/UI/Toolbar.rb +13 -14
- data/SketchUp/UI/WebDialog.rb +55 -59
- data/SketchUp/_top_level.rb +139 -27
- data/SketchUp/{Array.rb → array.rb} +167 -30
- data/SketchUp/{Geom.rb → geom.rb} +9 -7
- data/SketchUp/{LanguageHandler.rb → languagehandler.rb} +15 -15
- data/SketchUp/{Length.rb → length.rb} +15 -15
- data/SketchUp/{Numeric.rb → numeric.rb} +19 -19
- data/SketchUp/sketchup.rb +167 -156
- data/SketchUp/{SketchupExtension.rb → sketchupextension.rb} +27 -27
- data/SketchUp/{String.rb → string.rb} +1 -1
- data/SketchUp/ui.rb +113 -87
- metadata +46 -9
@@ -0,0 +1,70 @@
|
|
1
|
+
# Copyright:: Copyright 2017 Trimble Inc.
|
2
|
+
# License:: The MIT License (MIT)
|
3
|
+
|
4
|
+
# This is the interface to a LayOut Connection Point. A
|
5
|
+
# {Layout::ConnectionPoint} defines a target point to which a {Layout::Label}
|
6
|
+
# or {Layout::LinearDimension} can connect.
|
7
|
+
#
|
8
|
+
# @example
|
9
|
+
# doc = Layout::Document.open("C:/path/to/document.layout")
|
10
|
+
# entity = doc.pages.first.entities.first
|
11
|
+
# point = [2, 2]
|
12
|
+
# # Create a Connection Point to LayOut Entity in the document
|
13
|
+
# cp = Layout::ConnectionPoint.new(entity, point)
|
14
|
+
# # If the entity is a [Layout::SketchUpModel], then we can use a 3D point
|
15
|
+
# # in model space along with the PID of the entity in the model to make a
|
16
|
+
# # deep connection.
|
17
|
+
# point3D = [100, 200, 300]
|
18
|
+
# pid = "1345"
|
19
|
+
# cp2 = Layout::ConnectionPoint.new(entity, point3D, pid)
|
20
|
+
# # This point can then be used to connect a label or linear dimension to
|
21
|
+
# # the entity.
|
22
|
+
# leader_type = Layout::Label::LEADER_LINE_TYPE_BEZIER
|
23
|
+
# target_point = Geom::Point2d.new(1, 1)
|
24
|
+
# bounds = Geom::Bounds2d.new(2, 1, 1, 1)
|
25
|
+
# label = Layout::Label.new(text, leader_type, target_point, bounds)
|
26
|
+
# label.connect(cp)
|
27
|
+
#
|
28
|
+
# @version LayOut 2018
|
29
|
+
class Layout::ConnectionPoint
|
30
|
+
|
31
|
+
# Instance Methods
|
32
|
+
|
33
|
+
# The {#initialize} method creates a new {Layout::ConnectionPoint}.
|
34
|
+
#
|
35
|
+
# @example
|
36
|
+
# doc = Layout::Document.open("C:/path/to/document.layout")
|
37
|
+
# entity = doc.pages.first.entities.first
|
38
|
+
# point = [2, 2]
|
39
|
+
# # Create a Connection Point to LayOut Entity in the document
|
40
|
+
# cp = Layout::ConnectionPoint.new(entity, point)
|
41
|
+
#
|
42
|
+
# @overload initialize(entity, point, aperture = 0.0001)
|
43
|
+
#
|
44
|
+
# @param [Layout::Entity] entity
|
45
|
+
# @param [Geom::Point2d] point The position on the entity to connect to.
|
46
|
+
# @param [Numeric] aperture The search radius to find the entity provided. If
|
47
|
+
# no aperture value is provided, a default value of 0.0001 will be used.
|
48
|
+
# The value provided must be greater than zero.
|
49
|
+
# @return [Layout::ConnectionPoint]
|
50
|
+
#
|
51
|
+
# @raise [ArgumentError] if point passed in is not within the bounds of entity
|
52
|
+
# @raise [ArgumentError] if aperture is not greater than zero
|
53
|
+
# @raise [ArgumentError] if entity is not in a document
|
54
|
+
#
|
55
|
+
# @overload initialize(model, point3d, pid = nil)
|
56
|
+
#
|
57
|
+
# @param [Layout::SketchUpModel] model
|
58
|
+
# @param [Geom::Point3d] point3d The 3D point in model space to connect to.
|
59
|
+
# @param [String, nil] pid The persistent ID of the entity to connect to in
|
60
|
+
# the model, if any.
|
61
|
+
# @return [Layout::ConnectionPoint]
|
62
|
+
#
|
63
|
+
# @raise [ArgumentError] if entity is not in a document
|
64
|
+
# @raise [ArgumentError] if the provided pid does not exist in the model
|
65
|
+
#
|
66
|
+
# @version LayOut 2018
|
67
|
+
def initialize(*args)
|
68
|
+
end
|
69
|
+
|
70
|
+
end
|
@@ -0,0 +1,458 @@
|
|
1
|
+
# Copyright:: Copyright 2017 Trimble Inc.
|
2
|
+
# License:: The MIT License (MIT)
|
3
|
+
|
4
|
+
# This is the interface to a LayOut document. A {Layout::Document} is the 2D
|
5
|
+
# drawing that the user is working with, and it serves as the "entry point" for
|
6
|
+
# most Ruby API interactions. The {Layout::Document.open} method gives you a
|
7
|
+
# handle to a {Layout::Document}, and from there you can use the
|
8
|
+
# document-level methods to start getting information and making changes.
|
9
|
+
#
|
10
|
+
# @example
|
11
|
+
# # Grab a handle to an existing LayOut document.
|
12
|
+
# doc = Layout::Document.open("C:/path/to/document.layout")
|
13
|
+
#
|
14
|
+
# # Grab other handles to commonly used collections inside the model.
|
15
|
+
# layers = doc.layers
|
16
|
+
# pages = doc.pages
|
17
|
+
# entities = doc.shared_entities
|
18
|
+
#
|
19
|
+
# # Now that we have our handles, we can start pulling objects and making
|
20
|
+
# # method calls that are useful.
|
21
|
+
# first_entity = entities[0]
|
22
|
+
#
|
23
|
+
# number_pages = pages.count
|
24
|
+
#
|
25
|
+
# @version LayOut 2018
|
26
|
+
class Layout::Document
|
27
|
+
|
28
|
+
# Constants
|
29
|
+
|
30
|
+
DECIMAL_CENTIMETERS = nil # Stub value.
|
31
|
+
DECIMAL_FEET = nil # Stub value.
|
32
|
+
DECIMAL_INCHES = nil # Stub value.
|
33
|
+
DECIMAL_METERS = nil # Stub value.
|
34
|
+
DECIMAL_MILLIMETERS = nil # Stub value.
|
35
|
+
DECIMAL_POINTS = nil # Stub value.
|
36
|
+
|
37
|
+
FRACTIONAL_INCHES = nil # Stub value.
|
38
|
+
|
39
|
+
VERSION_1 = nil # Stub value.
|
40
|
+
VERSION_2 = nil # Stub value.
|
41
|
+
VERSION_2013 = nil # Stub value.
|
42
|
+
VERSION_2014 = nil # Stub value.
|
43
|
+
VERSION_2015 = nil # Stub value.
|
44
|
+
VERSION_2016 = nil # Stub value.
|
45
|
+
VERSION_2017 = nil # Stub value.
|
46
|
+
VERSION_2018 = nil # Stub value.
|
47
|
+
VERSION_3 = nil # Stub value.
|
48
|
+
VERSION_CURRENT = nil # Stub value.
|
49
|
+
|
50
|
+
# Class Methods
|
51
|
+
|
52
|
+
# The {.open} method creates a new {Layout::Document} by loading an existing
|
53
|
+
# .layout file.
|
54
|
+
#
|
55
|
+
# @example
|
56
|
+
# filename = File.join(ENV['Home'], 'Desktop', 'template.layout')
|
57
|
+
# doc = Layout::Document.open(filename)
|
58
|
+
#
|
59
|
+
# @param [String] path
|
60
|
+
# The path to the .layout file on disk.
|
61
|
+
#
|
62
|
+
# @raise [ArgumentError] if the file does not exist
|
63
|
+
#
|
64
|
+
# @return [Layout::Document] The {Layout::Document} created from the .layout
|
65
|
+
# file.
|
66
|
+
#
|
67
|
+
# @version LayOut 2018
|
68
|
+
def self.open(path)
|
69
|
+
end
|
70
|
+
|
71
|
+
# Instance Methods
|
72
|
+
|
73
|
+
# The {#==} method checks to see if the two {Layout::Document}s are equal.
|
74
|
+
# This checks whether the Ruby Objects are pointing to the same internal
|
75
|
+
# object.
|
76
|
+
#
|
77
|
+
# @example
|
78
|
+
# doc = Layout::Document.open("C:/path/to/document.layout")
|
79
|
+
# document = doc.pages.first.document
|
80
|
+
# doc == document
|
81
|
+
#
|
82
|
+
# @param [Layout::Document] other
|
83
|
+
#
|
84
|
+
# @return [Boolean]
|
85
|
+
#
|
86
|
+
# @version LayOut 2018
|
87
|
+
def ==(other)
|
88
|
+
end
|
89
|
+
|
90
|
+
# The {#add_entity} method adds an {Layout::Entity} to the {Layout::Document}
|
91
|
+
# and places it on the given {Layout::Layer} and {Layout::Page}. If layer is a
|
92
|
+
# shared {Layout::Layer} then page may be ommitted. The {Layout::Entity} must
|
93
|
+
# not already belong to a {Layout::Document}. If the {Layout::Entity} is a
|
94
|
+
# {Layout::Group}, then the {Layout::Group} along with all of its children will
|
95
|
+
# be added to the {Layout::Document}.
|
96
|
+
#
|
97
|
+
# @example
|
98
|
+
# doc = Layout::Document.open("C:/path/to/document.layout")
|
99
|
+
# rect = Layout::Rectangle.new([[1, 1], [2, 2]])
|
100
|
+
# all_layers = doc.layers
|
101
|
+
# all_pages = doc.pages
|
102
|
+
# doc.add_entity(rect, all_layers.first, all_pages.first)
|
103
|
+
#
|
104
|
+
# @overload add_entity(entity, layer, page)
|
105
|
+
#
|
106
|
+
# @param [Layout::Entity] entity The {Layout::Entity} to be added
|
107
|
+
# @param [Layout::Layer] layer The {Layout::Layer} to add the
|
108
|
+
# {Layout::Entity} to
|
109
|
+
# @param [Layout::Page] page The {Layout::Page} to add the {Layout::Entity}
|
110
|
+
# to
|
111
|
+
#
|
112
|
+
# @overload add_entity(entity, layer)
|
113
|
+
#
|
114
|
+
# @param [Layout::Entity] entity The {Layout::Entity} to be added
|
115
|
+
# @param [Layout::Layer] layer The shared {Layout::Layer} to add the
|
116
|
+
# {Layout::Entity} to
|
117
|
+
#
|
118
|
+
# @raise [ArgumentError] if no {Layout::Page} is passed in and layer is
|
119
|
+
# non-shared
|
120
|
+
#
|
121
|
+
# @raise [ArgumentError] if entity already belongs to a {Layout::Document}
|
122
|
+
#
|
123
|
+
# @raise [ArgumentError] if layer does not belong to the {Layout::Document}
|
124
|
+
#
|
125
|
+
# @raise [ArgumentError] if page does not belong to the {Layout::Document}
|
126
|
+
#
|
127
|
+
# @version LayOut 2018
|
128
|
+
def add_entity(*args)
|
129
|
+
end
|
130
|
+
|
131
|
+
# The {#auto_text_definitions} method returns an array of
|
132
|
+
# {Layout::AutoTextDefinition}'s in the {Layout::Document}.
|
133
|
+
#
|
134
|
+
# @example
|
135
|
+
# doc = Layout::Document.open("C:/path/to/document.layout")
|
136
|
+
# defs = doc.auto_text_definitions
|
137
|
+
#
|
138
|
+
# @return [Layout::AutoTextDefinitions]
|
139
|
+
#
|
140
|
+
# @version LayOut 2018
|
141
|
+
def auto_text_definitions
|
142
|
+
end
|
143
|
+
|
144
|
+
# The {#grid} method returns the {Layout::Grid} for a {Layout::Document}.
|
145
|
+
#
|
146
|
+
# @example
|
147
|
+
# doc = Layout::Document.open("C:/path/to/document.layout")
|
148
|
+
# grid = doc.grid
|
149
|
+
#
|
150
|
+
# @return [Layout::Grid]
|
151
|
+
#
|
152
|
+
# @version LayOut 2018
|
153
|
+
def grid
|
154
|
+
end
|
155
|
+
|
156
|
+
# The {#grid_snap_enabled=} method sets whether or not grid snap is enabled in
|
157
|
+
# the {Layout::Document}.
|
158
|
+
#
|
159
|
+
# @example
|
160
|
+
# doc = Layout::Document.open("C:/path/to/document.layout")
|
161
|
+
# doc.grid_snap_enabled = true
|
162
|
+
#
|
163
|
+
# @param [Boolean] enabled
|
164
|
+
# +true+ for enabled +false+ for disabled
|
165
|
+
#
|
166
|
+
# @version LayOut 2018
|
167
|
+
def grid_snap_enabled=(enabled)
|
168
|
+
end
|
169
|
+
|
170
|
+
# The {#grid_snap_enabled?} method returns whether or not grid snap is enabled
|
171
|
+
# in the {Layout::Document}.
|
172
|
+
#
|
173
|
+
# @example
|
174
|
+
# doc = Layout::Document.open("C:/path/to/document.layout")
|
175
|
+
# enabled = doc.grid_snap_enabled?
|
176
|
+
#
|
177
|
+
# @return [Boolean]
|
178
|
+
#
|
179
|
+
# @return [Boolean]
|
180
|
+
#
|
181
|
+
# @version LayOut 2018
|
182
|
+
def grid_snap_enabled?
|
183
|
+
end
|
184
|
+
|
185
|
+
# The {#initialize} method creates a new {Layout::Document}. Passing a path to
|
186
|
+
# an existing {Layout::Document} will use that file as a template. The new
|
187
|
+
# {Layout::Document} won't have a path until it is saved for the first time.
|
188
|
+
#
|
189
|
+
# @example
|
190
|
+
# doc = Layout::Document.new
|
191
|
+
# doc2 = Layout::Document.new("/path/to/template.layout")
|
192
|
+
#
|
193
|
+
# @overload initialize
|
194
|
+
#
|
195
|
+
# @return [Layout::Document] an empty {Layout::Document} with one
|
196
|
+
# {Layout::Layer} and one {Layout::Page}
|
197
|
+
#
|
198
|
+
# @overload initialize(template_path)
|
199
|
+
#
|
200
|
+
# @param [String] template_path The path to the {Layout::Document} to use as
|
201
|
+
# a template
|
202
|
+
# @return [Layout::Document] an unsaved {Layout::Document} based on the
|
203
|
+
# template
|
204
|
+
#
|
205
|
+
# @raise [ArgumentError] if the template file could not be found
|
206
|
+
#
|
207
|
+
# @raise [RuntimeError] if there was an error reading the template file
|
208
|
+
#
|
209
|
+
# @version LayOut 2018
|
210
|
+
def initialize(*args)
|
211
|
+
end
|
212
|
+
|
213
|
+
# The {#layers} method returns the {Layout::Layers} of the {Layout::Document}.
|
214
|
+
#
|
215
|
+
# @example
|
216
|
+
# doc = Layout::Document.open("C:/path/to/document.layout")
|
217
|
+
# layers = doc.layers
|
218
|
+
#
|
219
|
+
# @return [Layout::Layers]
|
220
|
+
#
|
221
|
+
# @version LayOut 2018
|
222
|
+
def layers
|
223
|
+
end
|
224
|
+
|
225
|
+
# The {#object_snap_enabled=} method enables or disables inference in the
|
226
|
+
# {Layout::Document}.
|
227
|
+
#
|
228
|
+
# @example
|
229
|
+
# doc = Layout::Document.open("C:/path/to/document.layout")
|
230
|
+
# doc.object_snap_enabled = false
|
231
|
+
#
|
232
|
+
# @param [Boolean] enabled
|
233
|
+
# +true+ for enabled +false+ for disabled
|
234
|
+
#
|
235
|
+
# @version LayOut 2018
|
236
|
+
def object_snap_enabled=(enabled)
|
237
|
+
end
|
238
|
+
|
239
|
+
# The {#object_snap_enabled?} method returns whether or not inference is
|
240
|
+
# enabled in the {Layout::Document}.
|
241
|
+
#
|
242
|
+
# @example
|
243
|
+
# doc = Layout::Document.open("C:/path/to/document.layout")
|
244
|
+
# enabled = doc.object_snap_enabled?
|
245
|
+
#
|
246
|
+
# @return [Boolean]
|
247
|
+
#
|
248
|
+
# @return [Boolean]
|
249
|
+
#
|
250
|
+
# @version LayOut 2018
|
251
|
+
def object_snap_enabled?
|
252
|
+
end
|
253
|
+
|
254
|
+
# The {#page_info} method returns a reference to the {Layout::PageInfo}
|
255
|
+
# settings of the {Layout::Document}.
|
256
|
+
#
|
257
|
+
# @example
|
258
|
+
# doc = Layout::Document.open("C:/path/to/document.layout")
|
259
|
+
# page_info = doc.page_info
|
260
|
+
#
|
261
|
+
# @return [Layout::PageInfo]
|
262
|
+
#
|
263
|
+
# @version LayOut 2018
|
264
|
+
def page_info
|
265
|
+
end
|
266
|
+
|
267
|
+
# The {#pages} method returns the {Layout::Pages} of the {Layout::Document}.
|
268
|
+
#
|
269
|
+
#
|
270
|
+
# @example:
|
271
|
+
# doc = Layout::Document.open("C:/path/to/document.layout")
|
272
|
+
# doc_pages = doc.pages
|
273
|
+
#
|
274
|
+
# @return [Layout::Pages] The {Layout::Pages} for the {Layout::Document}.
|
275
|
+
#
|
276
|
+
# @version LayOut 2018
|
277
|
+
def pages
|
278
|
+
end
|
279
|
+
|
280
|
+
# The {#path} method returns the full path of the {Layout::Document} file. An
|
281
|
+
# empty string is returned for a new {Layout::Document} (one which has not
|
282
|
+
# been saved and opened).
|
283
|
+
#
|
284
|
+
# @example
|
285
|
+
# doc = Layout::Document.open("C:/path/to/document.layout")
|
286
|
+
# path = doc.path
|
287
|
+
#
|
288
|
+
# @return [String]
|
289
|
+
#
|
290
|
+
# @version LayOut 2018
|
291
|
+
def path
|
292
|
+
end
|
293
|
+
|
294
|
+
# The {#precision} method returns the precision for the {Layout::Document}.
|
295
|
+
#
|
296
|
+
# @example
|
297
|
+
# doc = Layout::Document.open("C:/path/to/document.layout")
|
298
|
+
# precision = doc.precision
|
299
|
+
#
|
300
|
+
# @return [Float] the number specifying the precision for the
|
301
|
+
# {Layout::Document}
|
302
|
+
#
|
303
|
+
# @version LayOut 2018
|
304
|
+
def precision
|
305
|
+
end
|
306
|
+
|
307
|
+
# The {#precision=} method sets the precision for the {Layout::Document}.
|
308
|
+
#
|
309
|
+
# @example
|
310
|
+
# doc = Layout::Document.open("C:/path/to/document.layout")
|
311
|
+
# doc.precision = 0.0001
|
312
|
+
#
|
313
|
+
# @note LayOut only allows for a finite set of precision values for each units
|
314
|
+
# setting, so it will set the precision to the closest valid setting for the
|
315
|
+
# specified units. See the "Units" section of LayOut's "Document Setup"
|
316
|
+
# dialog for a reference of the available precisions for each units setting.
|
317
|
+
#
|
318
|
+
# @param [Float] precision
|
319
|
+
# The double specifying the precision for the
|
320
|
+
# {Layout::Document}
|
321
|
+
#
|
322
|
+
# @version LayOut 2018
|
323
|
+
def precision=(precision)
|
324
|
+
end
|
325
|
+
|
326
|
+
# The {#remove_entity} method removes an {Layout::Entity} from the
|
327
|
+
# {Layout::Document}. If entity is a {Layout::Group}, then the {Layout::Group}
|
328
|
+
# and all of its children will be removed from the {Layout::Document}.
|
329
|
+
#
|
330
|
+
# @example
|
331
|
+
# doc = Layout::Document.open("C:/path/to/document.layout")
|
332
|
+
# shared_entities = doc.shared_entities
|
333
|
+
# # Remove the first entity in the document
|
334
|
+
# doc.remove_entity(shared_entities.first)
|
335
|
+
#
|
336
|
+
# @param [Layout::Entity] entity
|
337
|
+
# The {Layout::Entity} to be removed
|
338
|
+
#
|
339
|
+
# @raise [ArgumentError] if entity does not belong to the {Layout::Document}
|
340
|
+
#
|
341
|
+
# @version LayOut 2018
|
342
|
+
def remove_entity(entity)
|
343
|
+
end
|
344
|
+
|
345
|
+
# The {#save} method saves the {Layout::Document} to a file at the given path.
|
346
|
+
# Passing an empty path string will save the {Layout::Document} at its current
|
347
|
+
# path.
|
348
|
+
#
|
349
|
+
# @example
|
350
|
+
# doc = Layout::Document.open("C:/path/to/document.layout")
|
351
|
+
# # Save the model using the current Layout format
|
352
|
+
# filename = File.join(ENV['Home'], 'Desktop', 'mydoc.layout')
|
353
|
+
# status = doc.save(filename)
|
354
|
+
# # Save the document to the current file using the current LayOut format
|
355
|
+
# status = doc.save
|
356
|
+
# # Save the document to the current file in LayOut 3 format
|
357
|
+
# status = doc.save(Layout::Document::VERSION_3)
|
358
|
+
# # Save the document in LayOut 2013 format
|
359
|
+
# filename = File.join(ENV['Home'], 'Desktop', 'mydoc_v2013.layout')
|
360
|
+
# status = doc.save(filename, Layout::Document::VERSION_2013)
|
361
|
+
#
|
362
|
+
# @overload save
|
363
|
+
#
|
364
|
+
# @raise [ArgumentError] if the {Layout::Document} hasn't been saved with a
|
365
|
+
# path yet
|
366
|
+
#
|
367
|
+
# @overload save(path, version = Layout::Document::VERSION_CURRENT)
|
368
|
+
#
|
369
|
+
# @param [String] path The path to the .layout file on disk.
|
370
|
+
# @param [Integer] version LayOut file format to save.
|
371
|
+
#
|
372
|
+
# @raise [ArgumentError] if version is not a valid version
|
373
|
+
#
|
374
|
+
# @version LayOut 2018
|
375
|
+
def save(*args)
|
376
|
+
end
|
377
|
+
|
378
|
+
# The {#shared_entities} method returns the {Layout::Entities}
|
379
|
+
# that exist on shared {Layout::Layer}s in the {Layout::Document}.
|
380
|
+
#
|
381
|
+
# @example
|
382
|
+
# doc = Layout::Document.open("C:/path/to/document.layout")
|
383
|
+
# entities = doc.shared_entities
|
384
|
+
#
|
385
|
+
# @return [Layout::Entities]
|
386
|
+
#
|
387
|
+
# @version LayOut 2018
|
388
|
+
def shared_entities
|
389
|
+
end
|
390
|
+
|
391
|
+
# The {#time_created} method returns the time when the {Layout::Document} was
|
392
|
+
# created.
|
393
|
+
#
|
394
|
+
# @example
|
395
|
+
# doc = Layout::Document.open("C:/path/to/document.layout")
|
396
|
+
# created_time = doc.time_created
|
397
|
+
#
|
398
|
+
# @return [Time] time when the {Layout::Document} was created
|
399
|
+
#
|
400
|
+
# @version LayOut 2018
|
401
|
+
def time_created
|
402
|
+
end
|
403
|
+
|
404
|
+
# The {#time_modified} method returns the last time the {Layout::Document} was
|
405
|
+
# modified.
|
406
|
+
#
|
407
|
+
# @example
|
408
|
+
# doc = Layout::Document.open("C:/path/to/document.layout")
|
409
|
+
# mod_time = doc.time_modified
|
410
|
+
#
|
411
|
+
# @return [Time] time when the {Layout::Document} was last modified
|
412
|
+
#
|
413
|
+
# @version LayOut 2018
|
414
|
+
def time_modified
|
415
|
+
end
|
416
|
+
|
417
|
+
# The {#time_published} method returns the time when the {Layout::Document} was
|
418
|
+
# published.
|
419
|
+
#
|
420
|
+
# @example
|
421
|
+
# doc = Layout::Document.open("C:/path/to/document.layout")
|
422
|
+
# pub_time = doc.time_published
|
423
|
+
#
|
424
|
+
# @return [Time] time when the {Layout::Document} was published
|
425
|
+
#
|
426
|
+
# @version LayOut 2018
|
427
|
+
def time_published
|
428
|
+
end
|
429
|
+
|
430
|
+
# The {#units} method returns the units for the {Layout::Document}.
|
431
|
+
#
|
432
|
+
# @example
|
433
|
+
# doc = Layout::Document.open("C:/path/to/document.layout")
|
434
|
+
# units = doc.units
|
435
|
+
#
|
436
|
+
# @return [Integer] The unit format of the {Layout::Document}
|
437
|
+
#
|
438
|
+
# @version LayOut 2018
|
439
|
+
def units
|
440
|
+
end
|
441
|
+
|
442
|
+
# The {#units=} method sets the units for the {Layout::Document}.
|
443
|
+
#
|
444
|
+
# @example
|
445
|
+
# doc = Layout::Document.open("C:/path/to/document.layout")
|
446
|
+
# units_format = LAYOUT::DOCUMENT::DECIMAL_MILLIMETERS
|
447
|
+
# doc.units = units_format
|
448
|
+
#
|
449
|
+
# @param [Integer] units_format
|
450
|
+
# The format of the units in the {Layout::Document}
|
451
|
+
#
|
452
|
+
# @raise [ArgumentError] if units format is not a valid format
|
453
|
+
#
|
454
|
+
# @version LayOut 2018
|
455
|
+
def units=(units_format)
|
456
|
+
end
|
457
|
+
|
458
|
+
end
|