sketchup-api-stubs 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/SketchUp/Geom/BoundingBox.rb +335 -0
- data/SketchUp/Geom/LatLong.rb +123 -0
- data/SketchUp/Geom/Point3d.rb +643 -0
- data/SketchUp/Geom/PolygonMesh.rb +478 -0
- data/SketchUp/Geom/Transformation.rb +476 -0
- data/SketchUp/Geom/UTM.rb +135 -0
- data/SketchUp/Geom/Vector3d.rb +684 -0
- data/SketchUp/Sketchup/Animation.rb +137 -0
- data/SketchUp/Sketchup/AppObserver.rb +157 -0
- data/SketchUp/Sketchup/ArcCurve.rb +209 -0
- data/SketchUp/Sketchup/AttributeDictionaries.rb +146 -0
- data/SketchUp/Sketchup/AttributeDictionary.rb +280 -0
- data/SketchUp/Sketchup/Axes.rb +149 -0
- data/SketchUp/Sketchup/Behavior.rb +338 -0
- data/SketchUp/Sketchup/Camera.rb +594 -0
- data/SketchUp/Sketchup/ClassificationSchema.rb +63 -0
- data/SketchUp/Sketchup/Classifications.rb +118 -0
- data/SketchUp/Sketchup/Color.rb +291 -0
- data/SketchUp/Sketchup/ComponentDefinition.rb +562 -0
- data/SketchUp/Sketchup/ComponentInstance.rb +597 -0
- data/SketchUp/Sketchup/Console.rb +78 -0
- data/SketchUp/Sketchup/ConstructionLine.rb +257 -0
- data/SketchUp/Sketchup/ConstructionPoint.rb +32 -0
- data/SketchUp/Sketchup/Curve.rb +196 -0
- data/SketchUp/Sketchup/DefinitionList.rb +312 -0
- data/SketchUp/Sketchup/DefinitionObserver.rb +73 -0
- data/SketchUp/Sketchup/DefinitionsObserver.rb +102 -0
- data/SketchUp/Sketchup/Dimension.rb +167 -0
- data/SketchUp/Sketchup/DimensionLinear.rb +232 -0
- data/SketchUp/Sketchup/DimensionObserver.rb +38 -0
- data/SketchUp/Sketchup/DimensionRadial.rb +87 -0
- data/SketchUp/Sketchup/Drawingelement.rb +400 -0
- data/SketchUp/Sketchup/Edge.rb +517 -0
- data/SketchUp/Sketchup/EdgeUse.rb +213 -0
- data/SketchUp/Sketchup/Entities.rb +1011 -0
- data/SketchUp/Sketchup/EntitiesObserver.rb +125 -0
- data/SketchUp/Sketchup/Entity.rb +522 -0
- data/SketchUp/Sketchup/EntityObserver.rb +59 -0
- data/SketchUp/Sketchup/ExtensionsManager.rb +129 -0
- data/SketchUp/Sketchup/Face.rb +737 -0
- data/SketchUp/Sketchup/FrameChangeObserver.rb +104 -0
- data/SketchUp/Sketchup/Group.rb +705 -0
- data/SketchUp/Sketchup/Http.rb +27 -0
- data/SketchUp/Sketchup/Http/Request.rb +285 -0
- data/SketchUp/Sketchup/Http/Response.rb +62 -0
- data/SketchUp/Sketchup/Image.rb +393 -0
- data/SketchUp/Sketchup/Importer.rb +192 -0
- data/SketchUp/Sketchup/InputPoint.rb +393 -0
- data/SketchUp/Sketchup/InstanceObserver.rb +82 -0
- data/SketchUp/Sketchup/InstancePath.rb +297 -0
- data/SketchUp/Sketchup/Layer.rb +240 -0
- data/SketchUp/Sketchup/Layers.rb +235 -0
- data/SketchUp/Sketchup/LayersObserver.rb +136 -0
- data/SketchUp/Sketchup/Licensing.rb +47 -0
- data/SketchUp/Sketchup/Licensing/ExtensionLicense.rb +88 -0
- data/SketchUp/Sketchup/Loop.rb +141 -0
- data/SketchUp/Sketchup/Material.rb +384 -0
- data/SketchUp/Sketchup/Materials.rb +283 -0
- data/SketchUp/Sketchup/MaterialsObserver.rb +141 -0
- data/SketchUp/Sketchup/Menu.rb +97 -0
- data/SketchUp/Sketchup/Model.rb +1459 -0
- data/SketchUp/Sketchup/ModelObserver.rb +356 -0
- data/SketchUp/Sketchup/OptionsManager.rb +135 -0
- data/SketchUp/Sketchup/OptionsProvider.rb +277 -0
- data/SketchUp/Sketchup/OptionsProviderObserver.rb +58 -0
- data/SketchUp/Sketchup/Page.rb +636 -0
- data/SketchUp/Sketchup/Pages.rb +349 -0
- data/SketchUp/Sketchup/PagesObserver.rb +76 -0
- data/SketchUp/Sketchup/PickHelper.rb +457 -0
- data/SketchUp/Sketchup/RegionalSettings.rb +43 -0
- data/SketchUp/Sketchup/RenderingOptions.rb +337 -0
- data/SketchUp/Sketchup/RenderingOptionsObserver.rb +44 -0
- data/SketchUp/Sketchup/SectionPlane.rb +88 -0
- data/SketchUp/Sketchup/Selection.rb +470 -0
- data/SketchUp/Sketchup/SelectionObserver.rb +115 -0
- data/SketchUp/Sketchup/Set.rb +253 -0
- data/SketchUp/Sketchup/ShadowInfo.rb +257 -0
- data/SketchUp/Sketchup/ShadowInfoObserver.rb +57 -0
- data/SketchUp/Sketchup/Style.rb +77 -0
- data/SketchUp/Sketchup/Styles.rb +204 -0
- data/SketchUp/Sketchup/Text.rb +241 -0
- data/SketchUp/Sketchup/Texture.rb +211 -0
- data/SketchUp/Sketchup/TextureWriter.rb +237 -0
- data/SketchUp/Sketchup/Tool.rb +808 -0
- data/SketchUp/Sketchup/Tools.rb +120 -0
- data/SketchUp/Sketchup/ToolsObserver.rb +154 -0
- data/SketchUp/Sketchup/UVHelper.rb +61 -0
- data/SketchUp/Sketchup/Vertex.rb +143 -0
- data/SketchUp/Sketchup/View.rb +965 -0
- data/SketchUp/Sketchup/ViewObserver.rb +40 -0
- data/SketchUp/UI/Command.rb +307 -0
- data/SketchUp/UI/HtmlDialog.rb +346 -0
- data/SketchUp/UI/Notification.rb +229 -0
- data/SketchUp/UI/Toolbar.rb +243 -0
- data/SketchUp/UI/WebDialog.rb +623 -0
- data/SketchUp/_top_level.rb +193 -0
- data/SketchUp/array.rb +593 -0
- data/SketchUp/geom.rb +231 -0
- data/SketchUp/languagehandler.rb +92 -0
- data/SketchUp/length.rb +210 -0
- data/SketchUp/numeric.rb +249 -0
- data/SketchUp/sketchup.rb +1290 -0
- data/SketchUp/sketchupextension.rb +355 -0
- data/SketchUp/string.rb +24 -0
- data/SketchUp/ui.rb +637 -0
- metadata +176 -0
@@ -0,0 +1,167 @@
|
|
1
|
+
# Copyright:: Copyright 2017 Trimble Inc.
|
2
|
+
# License:: The MIT License (MIT)
|
3
|
+
|
4
|
+
# The Dimension class provides base functionality for classes DimensionLinear
|
5
|
+
# and DimensionRadial. It's not instantiable.
|
6
|
+
#
|
7
|
+
# @version SketchUp 2014
|
8
|
+
class Sketchup::Dimension < Sketchup::Drawingelement
|
9
|
+
|
10
|
+
# Constants
|
11
|
+
|
12
|
+
ARROW_CLOSED = nil # Stub value.
|
13
|
+
ARROW_DOT = nil # Stub value.
|
14
|
+
ARROW_NONE = nil # Stub value.
|
15
|
+
ARROW_OPEN = nil # Stub value.
|
16
|
+
ARROW_SLASH = nil # Stub value.
|
17
|
+
|
18
|
+
# Instance Methods
|
19
|
+
|
20
|
+
# The add_observer method is used to add a DimensionObserver to the dimension.
|
21
|
+
#
|
22
|
+
# @example
|
23
|
+
# observer = MyDimObserver.new
|
24
|
+
# dim = Sketchup.active_model.entities.add_dimension_linear([50, 10, 0],
|
25
|
+
# [100, 10, 0], [0, 20, 0])
|
26
|
+
# status = dim.add_observer(observer)
|
27
|
+
#
|
28
|
+
# @note If the given observer responds to +onTextChanged+, it will be
|
29
|
+
# added as a {Sketchup::DimensionObserver}. If not, the base
|
30
|
+
# {Sketchup::Entity#add_observer} will be called.
|
31
|
+
#
|
32
|
+
# @param observer
|
33
|
+
# A DimensionObserver.
|
34
|
+
#
|
35
|
+
# @return true if successful, false if unsuccessful.
|
36
|
+
#
|
37
|
+
# @version SketchUp 2014
|
38
|
+
def add_observer(observer)
|
39
|
+
end
|
40
|
+
|
41
|
+
# The arrow_type method retrieves the current arrow type of the dimension.
|
42
|
+
# Valid arrow types are class constants:
|
43
|
+
# - +Dimension::ARROW_NONE,+
|
44
|
+
# - +Dimension::ARROW_SLASH+
|
45
|
+
# - +Dimension::ARROW_DOT+
|
46
|
+
# - +Dimension::ARROW_CLOSED+
|
47
|
+
# - +Dimension::ARROW_OPEN+
|
48
|
+
#
|
49
|
+
# @example
|
50
|
+
# type = dim.arrow_type
|
51
|
+
# if type == Sketchup::Dimension::ARROW_CLOSED
|
52
|
+
# puts "Arrow type is closed"
|
53
|
+
# end
|
54
|
+
#
|
55
|
+
# @return a numerical representation of the arrow type
|
56
|
+
#
|
57
|
+
# @version SketchUp 2014
|
58
|
+
def arrow_type
|
59
|
+
end
|
60
|
+
|
61
|
+
# The arrow_type= method sets the arrow type of the dimension.
|
62
|
+
# Valid arrow types are class constants:
|
63
|
+
# - +Dimension::ARROW_NONE,+
|
64
|
+
# - +Dimension::ARROW_SLASH+
|
65
|
+
# - +Dimension::ARROW_DOT+
|
66
|
+
# - +Dimension::ARROW_CLOSED+
|
67
|
+
# - +Dimension::ARROW_OPEN+
|
68
|
+
#
|
69
|
+
# @example
|
70
|
+
# dim.arrow_type = Sketchup::Dimension::ARROW_CLOSED
|
71
|
+
#
|
72
|
+
# @param type
|
73
|
+
# a numerical representation of the arrow type.
|
74
|
+
#
|
75
|
+
# @return the arrow type that was set.
|
76
|
+
#
|
77
|
+
# @version SketchUp 2014
|
78
|
+
def arrow_type=(type)
|
79
|
+
end
|
80
|
+
|
81
|
+
# The has_aligned_text= method accepts true or false indicating whether the
|
82
|
+
# dimension's text is aligned to the dimension or to the screen.
|
83
|
+
#
|
84
|
+
# @example
|
85
|
+
# dim.has_aligned_text = true
|
86
|
+
#
|
87
|
+
# @param [Boolean] value
|
88
|
+
#
|
89
|
+
# @return the alignment flag that was set
|
90
|
+
#
|
91
|
+
# @version SketchUp 2014
|
92
|
+
def has_aligned_text=(value)
|
93
|
+
end
|
94
|
+
|
95
|
+
# The has_aligned_text method is used to determine whether the dimension's text
|
96
|
+
# is aligned to the dimension or to the screen.
|
97
|
+
#
|
98
|
+
# @example
|
99
|
+
# aligned = dim.has_aligned_text?
|
100
|
+
#
|
101
|
+
# @return status - true if text is aligned to the dimension.
|
102
|
+
# False if dimension text is aligned to the screen.
|
103
|
+
#
|
104
|
+
# @return [Boolean]
|
105
|
+
#
|
106
|
+
# @version SketchUp 2014
|
107
|
+
def has_aligned_text?
|
108
|
+
end
|
109
|
+
|
110
|
+
# The plane method is used to retrieve the plane of the dimension. Refer to the
|
111
|
+
# Geom module for information on how planes are represented.
|
112
|
+
#
|
113
|
+
# @example
|
114
|
+
# plane = dim.plane
|
115
|
+
#
|
116
|
+
# @return the plane of the dimension
|
117
|
+
#
|
118
|
+
# @version SketchUp 2014
|
119
|
+
def plane
|
120
|
+
end
|
121
|
+
|
122
|
+
# The remove_observer method is used to remove a DimensionObserver from the
|
123
|
+
# dimension. Note that, if the given observer responds to 'onTextChanged', it
|
124
|
+
# will be removed as a DimensionObserver. If not, the base
|
125
|
+
# Entity.remove_observer will be called.
|
126
|
+
#
|
127
|
+
# @example
|
128
|
+
# observer = MyDimObserver.new
|
129
|
+
# dim = Sketchup.active_model.entities.add_dimension_linear([50, 10, 0],
|
130
|
+
# [100, 10, 0], [0, 20, 0])
|
131
|
+
# status = dim.add_observer(observer)
|
132
|
+
# status = dim.remove_observer(observer)
|
133
|
+
#
|
134
|
+
# @param observer
|
135
|
+
# A DimensionObserver.
|
136
|
+
#
|
137
|
+
# @return true if successful, false if unsuccessful.
|
138
|
+
#
|
139
|
+
# @version SketchUp 2014
|
140
|
+
def remove_observer(observer)
|
141
|
+
end
|
142
|
+
|
143
|
+
# The text method is used to retrieve the dimension text.
|
144
|
+
#
|
145
|
+
# @example
|
146
|
+
# dimtext = dim.text
|
147
|
+
#
|
148
|
+
# @return the dimension text
|
149
|
+
#
|
150
|
+
# @version SketchUp 2014
|
151
|
+
def text
|
152
|
+
end
|
153
|
+
|
154
|
+
# The text= method is used to set an override on the dimension text.
|
155
|
+
#
|
156
|
+
# @example
|
157
|
+
# dim.text= "text"
|
158
|
+
#
|
159
|
+
# @param [String] text
|
160
|
+
#
|
161
|
+
# @return the newly set text override
|
162
|
+
#
|
163
|
+
# @version SketchUp 2014
|
164
|
+
def text=(text)
|
165
|
+
end
|
166
|
+
|
167
|
+
end
|
@@ -0,0 +1,232 @@
|
|
1
|
+
# Copyright:: Copyright 2017 Trimble Inc.
|
2
|
+
# License:: The MIT License (MIT)
|
3
|
+
|
4
|
+
# The DimensionLinear class represents linear dimensions.
|
5
|
+
#
|
6
|
+
# @version SketchUp 2014
|
7
|
+
class Sketchup::DimensionLinear < Sketchup::Dimension
|
8
|
+
|
9
|
+
# Constants
|
10
|
+
|
11
|
+
ALIGNED_TEXT_ABOVE = nil # Stub value.
|
12
|
+
ALIGNED_TEXT_CENTER = nil # Stub value.
|
13
|
+
ALIGNED_TEXT_OUTSIDE = nil # Stub value.
|
14
|
+
|
15
|
+
TEXT_CENTERED = nil # Stub value.
|
16
|
+
TEXT_OUTSIDE_END = nil # Stub value.
|
17
|
+
TEXT_OUTSIDE_START = nil # Stub value.
|
18
|
+
|
19
|
+
# Instance Methods
|
20
|
+
|
21
|
+
# The aligned_text_position method returns the text position for dimensions
|
22
|
+
# with aligned text (i.e. has_aligned_text? returns true).
|
23
|
+
# Valid values are class constants:
|
24
|
+
# - DimensionLinear::ALIGNED_TEXT_ABOVE
|
25
|
+
# - DimensionLinear::ALIGNED_TEXT_CENTER
|
26
|
+
# - DimensionLinear::ALIGNED_TEXT_OUTSIDE
|
27
|
+
#
|
28
|
+
# @example
|
29
|
+
# pos = dim.aligned_text_position
|
30
|
+
# if pos == Sketchup::DimensionLinear::ALIGNED_TEXT_ABOVE
|
31
|
+
# puts 'Text is above'
|
32
|
+
# elsif pos == Sketchup::DimensionLinear::ALIGNED_TEXT_CENTER
|
33
|
+
# puts 'Text is centered'
|
34
|
+
# elsif pos == Sketchup::DimensionLinear::ALIGNED_TEXT_OUTSIDE
|
35
|
+
# puts 'Text is outside'
|
36
|
+
# end
|
37
|
+
#
|
38
|
+
# @return an integer specifying the text position
|
39
|
+
#
|
40
|
+
# @version SketchUp 2014
|
41
|
+
def aligned_text_position
|
42
|
+
end
|
43
|
+
|
44
|
+
# The aligned_text_position= method is used to set the text position for
|
45
|
+
# dimensions with aligned text (i.e. has_aligned_text? returns true).
|
46
|
+
# Valid values are class constants:
|
47
|
+
# - DimensionLinear::ALIGNED_TEXT_ABOVE
|
48
|
+
# - DimensionLinear::ALIGNED_TEXT_CENTER
|
49
|
+
# - DimensionLinear::ALIGNED_TEXT_OUTSIDE
|
50
|
+
#
|
51
|
+
# @example
|
52
|
+
# dim.aligned_text_position = Sketchup::DimensionLinear::ALIGNED_TEXT_CENTER
|
53
|
+
#
|
54
|
+
# @param pos
|
55
|
+
# an integer specifying the text position
|
56
|
+
#
|
57
|
+
# @return the text position that was set.
|
58
|
+
#
|
59
|
+
# @version SketchUp 2014
|
60
|
+
def aligned_text_position=(pos)
|
61
|
+
end
|
62
|
+
|
63
|
+
# The end method returns the point or entity the dimension is referencing at
|
64
|
+
# its end.
|
65
|
+
#
|
66
|
+
# @example
|
67
|
+
# arr = dim.end
|
68
|
+
# if arr[0].nil?
|
69
|
+
# puts "No attached entity. Point is #{arr[1]}"
|
70
|
+
# else
|
71
|
+
# puts "Attached entity: #{arr[0]}, at point #{arr[1]}"
|
72
|
+
# end
|
73
|
+
#
|
74
|
+
# @return Array - An array of size 2:
|
75
|
+
# - Entity being referenced or nil if not associated.
|
76
|
+
# - Point3d that contains the referenced location.
|
77
|
+
#
|
78
|
+
# @version SketchUp 2014
|
79
|
+
def end
|
80
|
+
end
|
81
|
+
|
82
|
+
# The end= method is used to set the end point of the dimension and/or the
|
83
|
+
# entity it is referencing.
|
84
|
+
#
|
85
|
+
# @example
|
86
|
+
# # Reference a point
|
87
|
+
# dim.end = [50, 10, 0]
|
88
|
+
# # Reference end vertex of an edge
|
89
|
+
# dim.end = edge.end
|
90
|
+
# # Attach to an edge's midpoint
|
91
|
+
# p0 = edge.start.position
|
92
|
+
# p1 = edge.end.position
|
93
|
+
# mp = Geom::Point3d.new((p0.x+p1.x)/2.0, (p0.y+p1.y)/2.0, (p0.z+p1.z)/2.0)
|
94
|
+
# dim.end = [edge, mp]
|
95
|
+
#
|
96
|
+
# @param pt_or_entity
|
97
|
+
# This parameter can take several forms:
|
98
|
+
# - an InputPoint
|
99
|
+
# - a Point3d
|
100
|
+
# - a Vertex
|
101
|
+
# - a ConstructionPoint
|
102
|
+
# - an array of size 2: [Edge, Point3d along the edge]
|
103
|
+
# - an array of size 2: [ConstructionLine, Point3d along the line]
|
104
|
+
#
|
105
|
+
# @return self
|
106
|
+
#
|
107
|
+
# @version SketchUp 2014
|
108
|
+
def end=(pt_or_entity)
|
109
|
+
end
|
110
|
+
|
111
|
+
# The offset_vector method returns the parallel offset vector from the
|
112
|
+
# reference line to the dimension line measured from the 'start' reference
|
113
|
+
# point.
|
114
|
+
#
|
115
|
+
# @example
|
116
|
+
# vec = dim.offset_vector
|
117
|
+
# puts "Offset vector is #{vec.to_s}"
|
118
|
+
#
|
119
|
+
# @return offset vector as a Vector3d
|
120
|
+
#
|
121
|
+
# @version SketchUp 2014
|
122
|
+
def offset_vector
|
123
|
+
end
|
124
|
+
|
125
|
+
# The offset_vector= method is used to set the parallel offset vector from the
|
126
|
+
# reference line to the dimension line measured from the 'start' reference
|
127
|
+
# point.
|
128
|
+
#
|
129
|
+
# @example
|
130
|
+
# dim.offset_vector = Geom::Vector3d.new(0, 0, 10)
|
131
|
+
# # or
|
132
|
+
# dim.offset_vector = [0, 0, 10]
|
133
|
+
#
|
134
|
+
# @param vec
|
135
|
+
# the offset vector to be set, either a Vector3d or in
|
136
|
+
# array form.
|
137
|
+
#
|
138
|
+
# @return the offset vector that was set
|
139
|
+
#
|
140
|
+
# @version SketchUp 2014
|
141
|
+
def offset_vector=(vec)
|
142
|
+
end
|
143
|
+
|
144
|
+
# The start method returns the point or entity the dimension is referencing at
|
145
|
+
# its start.
|
146
|
+
#
|
147
|
+
# @example
|
148
|
+
# arr = dim.start
|
149
|
+
# if arr[0].nil?
|
150
|
+
# puts "No attached entity. Point is #{arr[1]}"
|
151
|
+
# else
|
152
|
+
# puts "Attached entity: #{arr[0]}, at point #{arr[1]}"
|
153
|
+
# end
|
154
|
+
#
|
155
|
+
# @return Array - An array of size 2:
|
156
|
+
# - Entity being referenced or nil if not associated.
|
157
|
+
# - Point3d that contains the referenced location.
|
158
|
+
#
|
159
|
+
# @version SketchUp 2014
|
160
|
+
def start
|
161
|
+
end
|
162
|
+
|
163
|
+
# The start= method is used to set the start point of the dimension and/or
|
164
|
+
# the entity it is referencing.
|
165
|
+
#
|
166
|
+
# @example
|
167
|
+
# # Reference a point
|
168
|
+
# dim.start = [50, 10, 0]
|
169
|
+
# # Reference end vertex of an edge
|
170
|
+
# dim.start = edge.end
|
171
|
+
# # Attach to an edge's midpoint
|
172
|
+
# p0 = edge.start.position
|
173
|
+
# p1 = edge.end.position
|
174
|
+
# mp = Geom::Point3d.new((p0.x+p1.x)/2.0, (p0.y+p1.y)/2.0, (p0.z+p1.z)/2.0)
|
175
|
+
# dim.start = [edge, mp]
|
176
|
+
#
|
177
|
+
# @param pt_or_entity
|
178
|
+
# This parameter can take several forms:
|
179
|
+
# - an InputPoint
|
180
|
+
# - a Point3d
|
181
|
+
# - a Vertex
|
182
|
+
# - a ConstructionPoint
|
183
|
+
# - an array of size 2: [Edge, Point3d along the edge]
|
184
|
+
# - an array of size 2: [ConstructionLine, Point3d along the line]
|
185
|
+
#
|
186
|
+
# @return self
|
187
|
+
#
|
188
|
+
# @version SketchUp 2014
|
189
|
+
def start=(pt_or_entity)
|
190
|
+
end
|
191
|
+
|
192
|
+
# The text_position method returns the position of the text along the dimension
|
193
|
+
# line. Valid values are class constants:
|
194
|
+
# - DimensionLinear::TEXT_OUTSIDE_START
|
195
|
+
# - DimensionLinear::TEXT_CENTERED
|
196
|
+
# - DimensionLinear::TEXT_OUTSIDE_END
|
197
|
+
#
|
198
|
+
# @example
|
199
|
+
# pos = dim.text_position
|
200
|
+
# if pos == Sketchup::DimensionLinear::TEXT_OUTSIDE_START
|
201
|
+
# puts 'Text position is Outside start'
|
202
|
+
# elsif pos == Sketchup::DimensionLinear::TEXT_CENTERED
|
203
|
+
# puts 'Text position is Centered'
|
204
|
+
# elsif pos == Sketchup::DimensionLinear::TEXT_OUTSIDE_END
|
205
|
+
# puts 'Text position is Outside end'
|
206
|
+
# end
|
207
|
+
#
|
208
|
+
# @return an integer specifying the text position
|
209
|
+
#
|
210
|
+
# @version SketchUp 2014
|
211
|
+
def text_position
|
212
|
+
end
|
213
|
+
|
214
|
+
# The text_position= method is used to set the position of the text along the
|
215
|
+
# dimension line. Valid values are class constants:
|
216
|
+
# - DimensionLinear::TEXT_OUTSIDE_START
|
217
|
+
# - DimensionLinear::TEXT_CENTERED
|
218
|
+
# - DimensionLinear::TEXT_OUTSIDE_END
|
219
|
+
#
|
220
|
+
# @example
|
221
|
+
# dim.text_position = Sketchup::DimensionLinear::TEXT_CENTERED
|
222
|
+
#
|
223
|
+
# @param pos
|
224
|
+
# an integer specifying the text position
|
225
|
+
#
|
226
|
+
# @return the text position that was set.
|
227
|
+
#
|
228
|
+
# @version SketchUp 2014
|
229
|
+
def text_position=(pos)
|
230
|
+
end
|
231
|
+
|
232
|
+
end
|
@@ -0,0 +1,38 @@
|
|
1
|
+
# Copyright:: Copyright 2017 Trimble Inc.
|
2
|
+
# License:: The MIT License (MIT)
|
3
|
+
|
4
|
+
# This observer interface is implemented to react to changes in dimension text.
|
5
|
+
#
|
6
|
+
# @example
|
7
|
+
# # This is an example of a DimensionObserver
|
8
|
+
# class MyDimensionObserver < Sketchup::DimensionObserver
|
9
|
+
# def onTextChanged(dimension)
|
10
|
+
# puts "onTextChanged: #{dimension}, new_text= #{dimension.text}"
|
11
|
+
# end
|
12
|
+
# end
|
13
|
+
#
|
14
|
+
# # Attach the observer. (Assumes there is a dimension in the model root.)
|
15
|
+
# dim = Sketchup.active_model.entities.grep(Sketchup::Dimension).first
|
16
|
+
# dim.add_observer(MyDimensionObserver.new)
|
17
|
+
#
|
18
|
+
# @version SketchUp 2014
|
19
|
+
class Sketchup::DimensionObserver
|
20
|
+
|
21
|
+
# Instance Methods
|
22
|
+
|
23
|
+
# The {#onTextChanged} method is invoked when your entity is erased.
|
24
|
+
#
|
25
|
+
# @example
|
26
|
+
# def onTextChanged(dimension)
|
27
|
+
# puts "onTextChanged: #{dimension}, new_text= #{dimension.text}"
|
28
|
+
# end
|
29
|
+
#
|
30
|
+
# @param [Sketchup::Dimension] dimension
|
31
|
+
# The dimension object whose text has
|
32
|
+
# been changed.
|
33
|
+
#
|
34
|
+
# @version SketchUp 2014
|
35
|
+
def onTextChanged(dimension)
|
36
|
+
end
|
37
|
+
|
38
|
+
end
|
@@ -0,0 +1,87 @@
|
|
1
|
+
# Copyright:: Copyright 2017 Trimble Inc.
|
2
|
+
# License:: The MIT License (MIT)
|
3
|
+
|
4
|
+
# The DimensionRadial class represents radius and diameter dimensions on
|
5
|
+
# arcs and circles.
|
6
|
+
#
|
7
|
+
# @version SketchUp 2014
|
8
|
+
class Sketchup::DimensionRadial < Sketchup::Dimension
|
9
|
+
|
10
|
+
# Instance Methods
|
11
|
+
|
12
|
+
# The arc_curve method returns the ArcCurve object to which this dimension is
|
13
|
+
# attached.
|
14
|
+
#
|
15
|
+
# @example
|
16
|
+
# arc = dim.arc_curve
|
17
|
+
#
|
18
|
+
# @return The ArcCurve object to which the dimension is attached.
|
19
|
+
#
|
20
|
+
# @version SketchUp 2014
|
21
|
+
def arc_curve
|
22
|
+
end
|
23
|
+
|
24
|
+
# The arc_curve= method is used to set the ArcCurve object to which this
|
25
|
+
# dimension is attached.
|
26
|
+
#
|
27
|
+
# @example
|
28
|
+
# dim.arc_curve = arc
|
29
|
+
#
|
30
|
+
# @param arc_curve
|
31
|
+
# The ArcCurve object to which the dimension is to be
|
32
|
+
# attached.
|
33
|
+
#
|
34
|
+
# @return The ArcCurve object to which the dimension was attached.
|
35
|
+
#
|
36
|
+
# @version SketchUp 2014
|
37
|
+
def arc_curve=(arc_curve)
|
38
|
+
end
|
39
|
+
|
40
|
+
# The leader_break_point method returns the break point on the leader where the
|
41
|
+
# dimension text is attached.
|
42
|
+
#
|
43
|
+
# @example
|
44
|
+
# pt = dim.leader_break_point
|
45
|
+
# puts "Break point is #{pt}"
|
46
|
+
#
|
47
|
+
# @return the leader break point
|
48
|
+
#
|
49
|
+
# @version SketchUp 2014
|
50
|
+
def leader_break_point
|
51
|
+
end
|
52
|
+
|
53
|
+
# The leader_break_point= method is used to set the break point on the leader
|
54
|
+
# where the dimension text is attached.
|
55
|
+
#
|
56
|
+
# @example
|
57
|
+
# dim.leader_break_point = [10, 0, 0]
|
58
|
+
#
|
59
|
+
# @param point
|
60
|
+
# the point to be set
|
61
|
+
#
|
62
|
+
# @return the point that was set
|
63
|
+
#
|
64
|
+
# @version SketchUp 2014
|
65
|
+
def leader_break_point=(point)
|
66
|
+
end
|
67
|
+
|
68
|
+
# The leader_points method returns the 3 significant points along the dimension
|
69
|
+
# line in world coordinates.
|
70
|
+
#
|
71
|
+
# @example
|
72
|
+
# pts = dim.leader_points
|
73
|
+
# puts "Break point is #{pts[0]}"
|
74
|
+
# puts "Attach point is #{pts[1]}"
|
75
|
+
# puts "Opposite point is #{pts[2]}"
|
76
|
+
#
|
77
|
+
# @return Array of 3 Point3d objects. Point 0: leader break point,
|
78
|
+
# where the text extension attaches. Point 1: attach point,
|
79
|
+
# where leader touches the arc/circle. Point 2: opposite
|
80
|
+
# point, where the diameter leader touches the circle on
|
81
|
+
# the opposite side.
|
82
|
+
#
|
83
|
+
# @version SketchUp 2014
|
84
|
+
def leader_points
|
85
|
+
end
|
86
|
+
|
87
|
+
end
|