sketchup-api-stubs 0.6.1 → 0.7.4

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.
Files changed (149) hide show
  1. checksums.yaml +4 -4
  2. data/.yardopts +2 -0
  3. data/lib/sketchup-api-stubs.rb +1 -1
  4. data/lib/sketchup-api-stubs/sketchup.rb +145 -145
  5. data/lib/sketchup-api-stubs/stubs/Geom/BoundingBox.rb +318 -318
  6. data/lib/sketchup-api-stubs/stubs/Geom/Bounds2d.rb +172 -172
  7. data/lib/sketchup-api-stubs/stubs/Geom/LatLong.rb +126 -126
  8. data/lib/sketchup-api-stubs/stubs/Geom/OrientedBounds2d.rb +102 -102
  9. data/lib/sketchup-api-stubs/stubs/Geom/Point2d.rb +400 -401
  10. data/lib/sketchup-api-stubs/stubs/Geom/Point3d.rb +661 -661
  11. data/lib/sketchup-api-stubs/stubs/Geom/PolygonMesh.rb +492 -492
  12. data/lib/sketchup-api-stubs/stubs/Geom/Transformation.rb +478 -478
  13. data/lib/sketchup-api-stubs/stubs/Geom/Transformation2d.rb +263 -263
  14. data/lib/sketchup-api-stubs/stubs/Geom/UTM.rb +141 -141
  15. data/lib/sketchup-api-stubs/stubs/Geom/Vector2d.rb +522 -523
  16. data/lib/sketchup-api-stubs/stubs/Geom/Vector3d.rb +691 -691
  17. data/lib/sketchup-api-stubs/stubs/Layout.rb +25 -25
  18. data/lib/sketchup-api-stubs/stubs/Layout/AngularDimension.rb +573 -569
  19. data/lib/sketchup-api-stubs/stubs/Layout/AutoTextDefinition.rb +411 -411
  20. data/lib/sketchup-api-stubs/stubs/Layout/AutoTextDefinitions.rb +174 -186
  21. data/lib/sketchup-api-stubs/stubs/Layout/ConnectionPoint.rb +70 -70
  22. data/lib/sketchup-api-stubs/stubs/Layout/Document.rb +514 -455
  23. data/lib/sketchup-api-stubs/stubs/Layout/Ellipse.rb +29 -29
  24. data/lib/sketchup-api-stubs/stubs/Layout/Entities.rb +143 -155
  25. data/lib/sketchup-api-stubs/stubs/Layout/Entity.rb +353 -359
  26. data/lib/sketchup-api-stubs/stubs/Layout/FormattedText.rb +349 -349
  27. data/lib/sketchup-api-stubs/stubs/Layout/Grid.rb +311 -123
  28. data/lib/sketchup-api-stubs/stubs/Layout/Group.rb +261 -261
  29. data/lib/sketchup-api-stubs/stubs/Layout/Image.rb +91 -86
  30. data/lib/sketchup-api-stubs/stubs/Layout/Label.rb +371 -371
  31. data/lib/sketchup-api-stubs/stubs/Layout/Layer.rb +218 -218
  32. data/lib/sketchup-api-stubs/stubs/Layout/LayerInstance.rb +128 -128
  33. data/lib/sketchup-api-stubs/stubs/Layout/Layers.rb +220 -232
  34. data/lib/sketchup-api-stubs/stubs/Layout/LinearDimension.rb +567 -563
  35. data/lib/sketchup-api-stubs/stubs/Layout/LockedEntityError.rb +10 -10
  36. data/lib/sketchup-api-stubs/stubs/Layout/LockedLayerError.rb +11 -11
  37. data/lib/sketchup-api-stubs/stubs/Layout/Page.rb +183 -183
  38. data/lib/sketchup-api-stubs/stubs/Layout/PageInfo.rb +387 -387
  39. data/lib/sketchup-api-stubs/stubs/Layout/Pages.rb +204 -216
  40. data/lib/sketchup-api-stubs/stubs/Layout/Path.rb +344 -344
  41. data/lib/sketchup-api-stubs/stubs/Layout/Rectangle.rb +174 -174
  42. data/lib/sketchup-api-stubs/stubs/Layout/SketchUpModel.rb +694 -547
  43. data/lib/sketchup-api-stubs/stubs/Layout/Style.rb +1519 -1519
  44. data/lib/sketchup-api-stubs/stubs/Layout/Table.rb +290 -290
  45. data/lib/sketchup-api-stubs/stubs/Layout/TableCell.rb +149 -149
  46. data/lib/sketchup-api-stubs/stubs/Layout/TableColumn.rb +139 -139
  47. data/lib/sketchup-api-stubs/stubs/Layout/TableRow.rb +135 -135
  48. data/lib/sketchup-api-stubs/stubs/Sketchup/Animation.rb +140 -140
  49. data/lib/sketchup-api-stubs/stubs/Sketchup/AppObserver.rb +157 -157
  50. data/lib/sketchup-api-stubs/stubs/Sketchup/ArcCurve.rb +209 -209
  51. data/lib/sketchup-api-stubs/stubs/Sketchup/AttributeDictionaries.rb +152 -152
  52. data/lib/sketchup-api-stubs/stubs/Sketchup/AttributeDictionary.rb +281 -281
  53. data/lib/sketchup-api-stubs/stubs/Sketchup/Axes.rb +149 -149
  54. data/lib/sketchup-api-stubs/stubs/Sketchup/Behavior.rb +328 -328
  55. data/lib/sketchup-api-stubs/stubs/Sketchup/Camera.rb +577 -577
  56. data/lib/sketchup-api-stubs/stubs/Sketchup/ClassificationSchema.rb +63 -63
  57. data/lib/sketchup-api-stubs/stubs/Sketchup/Classifications.rb +122 -122
  58. data/lib/sketchup-api-stubs/stubs/Sketchup/Color.rb +281 -281
  59. data/lib/sketchup-api-stubs/stubs/Sketchup/ComponentDefinition.rb +562 -554
  60. data/lib/sketchup-api-stubs/stubs/Sketchup/ComponentInstance.rb +593 -593
  61. data/lib/sketchup-api-stubs/stubs/Sketchup/Console.rb +76 -76
  62. data/lib/sketchup-api-stubs/stubs/Sketchup/ConstructionLine.rb +257 -257
  63. data/lib/sketchup-api-stubs/stubs/Sketchup/ConstructionPoint.rb +32 -32
  64. data/lib/sketchup-api-stubs/stubs/Sketchup/Curve.rb +194 -194
  65. data/lib/sketchup-api-stubs/stubs/Sketchup/DefinitionList.rb +329 -329
  66. data/lib/sketchup-api-stubs/stubs/Sketchup/DefinitionObserver.rb +72 -72
  67. data/lib/sketchup-api-stubs/stubs/Sketchup/DefinitionsObserver.rb +102 -102
  68. data/lib/sketchup-api-stubs/stubs/Sketchup/Dimension.rb +165 -165
  69. data/lib/sketchup-api-stubs/stubs/Sketchup/DimensionLinear.rb +312 -312
  70. data/lib/sketchup-api-stubs/stubs/Sketchup/DimensionObserver.rb +38 -38
  71. data/lib/sketchup-api-stubs/stubs/Sketchup/DimensionRadial.rb +87 -87
  72. data/lib/sketchup-api-stubs/stubs/Sketchup/Drawingelement.rb +390 -390
  73. data/lib/sketchup-api-stubs/stubs/Sketchup/Edge.rb +508 -508
  74. data/lib/sketchup-api-stubs/stubs/Sketchup/EdgeUse.rb +211 -211
  75. data/lib/sketchup-api-stubs/stubs/Sketchup/Entities.rb +1119 -1097
  76. data/lib/sketchup-api-stubs/stubs/Sketchup/EntitiesObserver.rb +125 -125
  77. data/lib/sketchup-api-stubs/stubs/Sketchup/Entity.rb +544 -537
  78. data/lib/sketchup-api-stubs/stubs/Sketchup/EntityObserver.rb +59 -59
  79. data/lib/sketchup-api-stubs/stubs/Sketchup/ExtensionsManager.rb +125 -125
  80. data/lib/sketchup-api-stubs/stubs/Sketchup/Face.rb +750 -750
  81. data/lib/sketchup-api-stubs/stubs/Sketchup/FrameChangeObserver.rb +104 -104
  82. data/lib/sketchup-api-stubs/stubs/Sketchup/Group.rb +697 -697
  83. data/lib/sketchup-api-stubs/stubs/Sketchup/Http.rb +27 -27
  84. data/lib/sketchup-api-stubs/stubs/Sketchup/Http/Request.rb +285 -285
  85. data/lib/sketchup-api-stubs/stubs/Sketchup/Http/Response.rb +62 -62
  86. data/lib/sketchup-api-stubs/stubs/Sketchup/Image.rb +409 -409
  87. data/lib/sketchup-api-stubs/stubs/Sketchup/ImageRep.rb +226 -226
  88. data/lib/sketchup-api-stubs/stubs/Sketchup/Importer.rb +190 -190
  89. data/lib/sketchup-api-stubs/stubs/Sketchup/InputPoint.rb +393 -393
  90. data/lib/sketchup-api-stubs/stubs/Sketchup/InstanceObserver.rb +82 -82
  91. data/lib/sketchup-api-stubs/stubs/Sketchup/InstancePath.rb +303 -303
  92. data/lib/sketchup-api-stubs/stubs/Sketchup/Layer.rb +285 -262
  93. data/lib/sketchup-api-stubs/stubs/Sketchup/Layers.rb +244 -231
  94. data/lib/sketchup-api-stubs/stubs/Sketchup/LayersObserver.rb +136 -136
  95. data/lib/sketchup-api-stubs/stubs/Sketchup/Licensing.rb +48 -48
  96. data/lib/sketchup-api-stubs/stubs/Sketchup/Licensing/ExtensionLicense.rb +86 -86
  97. data/lib/sketchup-api-stubs/stubs/Sketchup/LineStyle.rb +24 -24
  98. data/lib/sketchup-api-stubs/stubs/Sketchup/LineStyles.rb +112 -123
  99. data/lib/sketchup-api-stubs/stubs/Sketchup/Loop.rb +137 -137
  100. data/lib/sketchup-api-stubs/stubs/Sketchup/Material.rb +416 -416
  101. data/lib/sketchup-api-stubs/stubs/Sketchup/Materials.rb +311 -311
  102. data/lib/sketchup-api-stubs/stubs/Sketchup/MaterialsObserver.rb +141 -141
  103. data/lib/sketchup-api-stubs/stubs/Sketchup/Menu.rb +95 -95
  104. data/lib/sketchup-api-stubs/stubs/Sketchup/Model.rb +1638 -1483
  105. data/lib/sketchup-api-stubs/stubs/Sketchup/ModelObserver.rb +356 -356
  106. data/lib/sketchup-api-stubs/stubs/Sketchup/OptionsManager.rb +132 -132
  107. data/lib/sketchup-api-stubs/stubs/Sketchup/OptionsProvider.rb +284 -282
  108. data/lib/sketchup-api-stubs/stubs/Sketchup/OptionsProviderObserver.rb +58 -58
  109. data/lib/sketchup-api-stubs/stubs/Sketchup/Page.rb +770 -650
  110. data/lib/sketchup-api-stubs/stubs/Sketchup/Pages.rb +353 -353
  111. data/lib/sketchup-api-stubs/stubs/Sketchup/PagesObserver.rb +76 -76
  112. data/lib/sketchup-api-stubs/stubs/Sketchup/PickHelper.rb +456 -456
  113. data/lib/sketchup-api-stubs/stubs/Sketchup/RegionalSettings.rb +43 -43
  114. data/lib/sketchup-api-stubs/stubs/Sketchup/RenderingOptions.rb +364 -356
  115. data/lib/sketchup-api-stubs/stubs/Sketchup/RenderingOptionsObserver.rb +44 -44
  116. data/lib/sketchup-api-stubs/stubs/Sketchup/SectionPlane.rb +150 -150
  117. data/lib/sketchup-api-stubs/stubs/Sketchup/Selection.rb +454 -454
  118. data/lib/sketchup-api-stubs/stubs/Sketchup/SelectionObserver.rb +115 -115
  119. data/lib/sketchup-api-stubs/stubs/Sketchup/Set.rb +212 -212
  120. data/lib/sketchup-api-stubs/stubs/Sketchup/ShadowInfo.rb +257 -257
  121. data/lib/sketchup-api-stubs/stubs/Sketchup/ShadowInfoObserver.rb +57 -57
  122. data/lib/sketchup-api-stubs/stubs/Sketchup/Style.rb +69 -69
  123. data/lib/sketchup-api-stubs/stubs/Sketchup/Styles.rb +211 -211
  124. data/lib/sketchup-api-stubs/stubs/Sketchup/Text.rb +262 -262
  125. data/lib/sketchup-api-stubs/stubs/Sketchup/Texture.rb +225 -225
  126. data/lib/sketchup-api-stubs/stubs/Sketchup/TextureWriter.rb +237 -237
  127. data/lib/sketchup-api-stubs/stubs/Sketchup/Tool.rb +829 -829
  128. data/lib/sketchup-api-stubs/stubs/Sketchup/Tools.rb +132 -132
  129. data/lib/sketchup-api-stubs/stubs/Sketchup/ToolsObserver.rb +154 -154
  130. data/lib/sketchup-api-stubs/stubs/Sketchup/UVHelper.rb +61 -61
  131. data/lib/sketchup-api-stubs/stubs/Sketchup/Vertex.rb +142 -142
  132. data/lib/sketchup-api-stubs/stubs/Sketchup/View.rb +1301 -995
  133. data/lib/sketchup-api-stubs/stubs/Sketchup/ViewObserver.rb +43 -43
  134. data/lib/sketchup-api-stubs/stubs/UI/Command.rb +310 -310
  135. data/lib/sketchup-api-stubs/stubs/UI/HtmlDialog.rb +356 -356
  136. data/lib/sketchup-api-stubs/stubs/UI/Notification.rb +229 -229
  137. data/lib/sketchup-api-stubs/stubs/UI/Toolbar.rb +240 -240
  138. data/lib/sketchup-api-stubs/stubs/UI/WebDialog.rb +633 -633
  139. data/lib/sketchup-api-stubs/stubs/_top_level.rb +311 -303
  140. data/lib/sketchup-api-stubs/stubs/array.rb +741 -741
  141. data/lib/sketchup-api-stubs/stubs/geom.rb +348 -233
  142. data/lib/sketchup-api-stubs/stubs/languagehandler.rb +92 -92
  143. data/lib/sketchup-api-stubs/stubs/length.rb +278 -262
  144. data/lib/sketchup-api-stubs/stubs/numeric.rb +249 -249
  145. data/lib/sketchup-api-stubs/stubs/sketchup.rb +1310 -1310
  146. data/lib/sketchup-api-stubs/stubs/sketchupextension.rb +353 -353
  147. data/lib/sketchup-api-stubs/stubs/string.rb +24 -24
  148. data/lib/sketchup-api-stubs/stubs/ui.rb +667 -660
  149. metadata +2 -16
@@ -1,104 +1,104 @@
1
- # Copyright:: Copyright 2019 Trimble Inc.
2
- # License:: The MIT License (MIT)
3
-
4
- # This observer interface is implemented to react to changes in camera
5
- # position (a frame) between one scene page and another. This observer's
6
- # callback method is called when the user manually makes a scene change,
7
- # or the internal animation feature runs.
8
- #
9
- # This abstract observer is any object that implements a callback method
10
- # +frameChange+ with 3 arguments: +from_scene+ (the scene that you
11
- # transition from), +to_scene+ (the scene that you transition toward)
12
- # and a +percent_done+ between +0.0+ and +1.0+ (that indicates the percentage
13
- # of transition between the two scenes.)
14
- #
15
- # # Basic Class Definition:
16
- # class MyFrameChangeObserver
17
- # def frameChange(from_scene, to_scene, percent_done)
18
- # # Actual code here.
19
- # end
20
- # end
21
- #
22
- # The observer is attached using the {Sketchup::Pages.add_frame_change_observer}
23
- # class method, which returns an integer id that can be stored and later
24
- # used to detach the observer.
25
- #
26
- # # Attach an observer to the global Pages object:
27
- # @id = Sketchup::Pages.add_frame_change_observer(MyFrameChangeObserver.new)
28
- #
29
- # Later, detaching this observer is done by passing this +id+ reference to
30
- # the {Sketchup::Pages.remove_frame_change_observer} class method.
31
- #
32
- # # Basic Observer Detachment:
33
- # Sketchup::Pages.remove_frame_change_observer(@id)
34
- #
35
- # @abstract Implement the methods described in this class to create a frame
36
- # change observer. You can not sub-class this class because it is not
37
- # defined by the API.
38
- #
39
- # @example Draws a progress bar on the status line.
40
- # class MyFrameChangeObserver
41
- # def frameChange(from_scene, to_scene, percent_done)
42
- # if percent_done == 0.0
43
- # Sketchup.status_text= "% done:"
44
- # if from_scene.nil? # PC bug!
45
- # puts "Animating to page: '#{to_scene.name}'"
46
- # else
47
- # puts "From page '#{from_scene.name}' to '#{to_scene.name}'"
48
- # end
49
- # else
50
- # Sketchup.status_text= "% done: #{'|'*(percent_done*100).to_i}"
51
- # UI.messagebox("All Done!") if percent_done >= 1.0
52
- # end
53
- # end
54
- # end
55
- # @id = Sketchup::Pages.add_frame_change_observer(MyFrameChangeObserver.new)
56
- class Sketchup::FrameChangeObserver
57
-
58
- # Instance Methods
59
-
60
- # This callback method is called during a slide show or creation of an
61
- # animation after the camera has been set up, but before the frame is
62
- # displayed. It gives you a chance to perform your own actions during
63
- # the animation. The arguments for +frameChange+ method are the scene
64
- # page that you transition from (+from_scene+), the scene page that you
65
- # transition to (+to_scene+), and a +percent_done+ between +0.0+ and +1.0+
66
- # that tell you the percentage of the transition between the two scene
67
- # pages.
68
- #
69
- # By watching for +percent_done >= 1.0+, you can activate Ruby code that
70
- # executes as soon as the user's camera has finished animating.
71
- #
72
- # @example
73
- # class MyFrameChangeObserver
74
- # def frameChange(from_scene, to_scene, percent_done)
75
- # if percent_done == 0.0
76
- # puts "Animating to scene '#{to_scene.name}':"
77
- # else
78
- # puts format("% 7.2f %",percent_done*100)
79
- # end
80
- # end
81
- # end
82
- # @id = Sketchup::Pages.add_frame_change_observer(MyFrameChangeObserver.new)
83
- #
84
- # @note The +from_scene+ argument into this callback does not appear to
85
- # be populated on the PC. You can store a variable that keeps track of
86
- # the +to_scene+ and then use that on a subsequent Scene selection to
87
- # determine the last Page that the user was on.
88
- #
89
- # @param [Sketchup::Page, nil] from_scene
90
- # The previous scene page the view is transitioning from.
91
- #
92
- # @param [Sketchup::Page] to_scene
93
- # The selected scene page the view is transitioning towards.
94
- #
95
- # @param [Float] percent_done
96
- # The percentage of transition between the two scene pages.
97
- #
98
- # @return [void] Value can be anything, but is ignored by SketchUp.
99
- #
100
- # @version SketchUp 6.0
101
- def frameChange(from_scene, to_scene, percent_done)
102
- end
103
-
104
- end
1
+ # Copyright:: Copyright 2020 Trimble Inc.
2
+ # License:: The MIT License (MIT)
3
+
4
+ # This observer interface is implemented to react to changes in camera
5
+ # position (a frame) between one scene page and another. This observer's
6
+ # callback method is called when the user manually makes a scene change,
7
+ # or the internal animation feature runs.
8
+ #
9
+ # This abstract observer is any object that implements a callback method
10
+ # +frameChange+ with 3 arguments: +from_scene+ (the scene that you
11
+ # transition from), +to_scene+ (the scene that you transition toward)
12
+ # and a +percent_done+ between +0.0+ and +1.0+ (that indicates the percentage
13
+ # of transition between the two scenes.)
14
+ #
15
+ # # Basic Class Definition:
16
+ # class MyFrameChangeObserver
17
+ # def frameChange(from_scene, to_scene, percent_done)
18
+ # # Actual code here.
19
+ # end
20
+ # end
21
+ #
22
+ # The observer is attached using the {Sketchup::Pages.add_frame_change_observer}
23
+ # class method, which returns an integer id that can be stored and later
24
+ # used to detach the observer.
25
+ #
26
+ # # Attach an observer to the global Pages object:
27
+ # @id = Sketchup::Pages.add_frame_change_observer(MyFrameChangeObserver.new)
28
+ #
29
+ # Later, detaching this observer is done by passing this +id+ reference to
30
+ # the {Sketchup::Pages.remove_frame_change_observer} class method.
31
+ #
32
+ # # Basic Observer Detachment:
33
+ # Sketchup::Pages.remove_frame_change_observer(@id)
34
+ #
35
+ # @abstract Implement the methods described in this class to create a frame
36
+ # change observer. You can not sub-class this class because it is not
37
+ # defined by the API.
38
+ #
39
+ # @example Draws a progress bar on the status line.
40
+ # class MyFrameChangeObserver
41
+ # def frameChange(from_scene, to_scene, percent_done)
42
+ # if percent_done == 0.0
43
+ # Sketchup.status_text= "% done:"
44
+ # if from_scene.nil? # PC bug!
45
+ # puts "Animating to page: '#{to_scene.name}'"
46
+ # else
47
+ # puts "From page '#{from_scene.name}' to '#{to_scene.name}'"
48
+ # end
49
+ # else
50
+ # Sketchup.status_text= "% done: #{'|'*(percent_done*100).to_i}"
51
+ # UI.messagebox("All Done!") if percent_done >= 1.0
52
+ # end
53
+ # end
54
+ # end
55
+ # @id = Sketchup::Pages.add_frame_change_observer(MyFrameChangeObserver.new)
56
+ class Sketchup::FrameChangeObserver
57
+
58
+ # Instance Methods
59
+
60
+ # This callback method is called during a slide show or creation of an
61
+ # animation after the camera has been set up, but before the frame is
62
+ # displayed. It gives you a chance to perform your own actions during
63
+ # the animation. The arguments for +frameChange+ method are the scene
64
+ # page that you transition from (+from_scene+), the scene page that you
65
+ # transition to (+to_scene+), and a +percent_done+ between +0.0+ and +1.0+
66
+ # that tell you the percentage of the transition between the two scene
67
+ # pages.
68
+ #
69
+ # By watching for +percent_done >= 1.0+, you can activate Ruby code that
70
+ # executes as soon as the user's camera has finished animating.
71
+ #
72
+ # @example
73
+ # class MyFrameChangeObserver
74
+ # def frameChange(from_scene, to_scene, percent_done)
75
+ # if percent_done == 0.0
76
+ # puts "Animating to scene '#{to_scene.name}':"
77
+ # else
78
+ # puts format("% 7.2f %",percent_done*100)
79
+ # end
80
+ # end
81
+ # end
82
+ # @id = Sketchup::Pages.add_frame_change_observer(MyFrameChangeObserver.new)
83
+ #
84
+ # @note The +from_scene+ argument into this callback does not appear to
85
+ # be populated on the PC. You can store a variable that keeps track of
86
+ # the +to_scene+ and then use that on a subsequent Scene selection to
87
+ # determine the last Page that the user was on.
88
+ #
89
+ # @param [Sketchup::Page, nil] from_scene
90
+ # The previous scene page the view is transitioning from.
91
+ #
92
+ # @param [Sketchup::Page] to_scene
93
+ # The selected scene page the view is transitioning towards.
94
+ #
95
+ # @param [Float] percent_done
96
+ # The percentage of transition between the two scene pages.
97
+ #
98
+ # @return [void] Value can be anything, but is ignored by SketchUp.
99
+ #
100
+ # @version SketchUp 6.0
101
+ def frameChange(from_scene, to_scene, percent_done)
102
+ end
103
+
104
+ end
@@ -1,697 +1,697 @@
1
- # Copyright:: Copyright 2019 Trimble Inc.
2
- # License:: The MIT License (MIT)
3
-
4
- # A Group class contains methods for manipulating groups of entities.
5
- #
6
- # Groups in SketchUp are very similar to Components, except that there is no
7
- # instancing of groups. That means that you always will have one and only one
8
- # of each of your groups. (In the actual implementation, SketchUp keeps track
9
- # of groups as a special kind of Component that combines properties of
10
- # definitions and instances, which is why you will see deprecated methods
11
- # like Group.make_unique, and the class of observer you attach to Groups are
12
- # ComponentInstance observers.)
13
- #
14
- # @version SketchUp 6.0
15
- class Sketchup::Group < Sketchup::Drawingelement
16
-
17
- # Instance Methods
18
-
19
- # The add_observer method is used to add a ComponentInstance observer to the
20
- # group.
21
- #
22
- # @example
23
- # # Add a group to the model.
24
- # group = Sketchup.active_model.entities.add_group
25
- # group.entities.add_line([0,0,0],[100,100,100])
26
- # status = group.add_observer observer
27
- #
28
- # @param [Object] observer
29
- # An observer.
30
- #
31
- # @return [Boolean] true if successful, false if unsuccessful.
32
- #
33
- # @version SketchUp 6.0
34
- def add_observer(observer)
35
- end
36
-
37
- # The copy method is used to create a new Group object that is a copy of the
38
- # group.
39
- #
40
- # @example
41
- # # Add a group to the model.
42
- # group = Sketchup.active_model.entities.add_group
43
- # group.entities.add_line([0,0,0],[100,100,100])
44
- # group2 = group.copy
45
- #
46
- # @return [Sketchup::Group] a new Group object
47
- #
48
- # @version SketchUp 6.0
49
- def copy
50
- end
51
-
52
- # The definition method is used to retrieve the component definition for this
53
- # group.
54
- #
55
- # @example
56
- # group = Sketchup.active_model.entities.add_group
57
- # definition = group.definition
58
- #
59
- # @return [Sketchup::ComponentDefinition] a ComponentDefinition object if
60
- # successful
61
- #
62
- # @version SketchUp 2015
63
- def definition
64
- end
65
-
66
- # The description method is used to retrieve the description for the group.
67
- #
68
- # @example
69
- # depth = 100
70
- # width = 100
71
- # model = Sketchup.active_model
72
- # entities = model.active_entities
73
- # pts = []
74
- # pts[0] = [0, 0, 0]
75
- # pts[1] = [width, 0, 0]
76
- # pts[2] = [width, depth, 0]
77
- # pts[3] = [0, depth, 0]
78
- # # Add the group to the entities in the model
79
- # group = entities.add_group
80
- #
81
- # # Get the entities within the group
82
- # entities2 = group.entities
83
- #
84
- # # Add a face to within the group
85
- # face = entities2.add_face pts
86
- # group.description = "This is a Group with a 2d Face"
87
- # description = group.description
88
- #
89
- # @return [String] a string description if successful
90
- #
91
- # @version SketchUp 6.0
92
- def description
93
- end
94
-
95
- # The description= method is used to set the description for the group.
96
- #
97
- # @example
98
- # depth = 100
99
- # width = 100
100
- # model = Sketchup.active_model
101
- # entities = model.active_entities
102
- # pts = []
103
- # pts[0] = [0, 0, 0]
104
- # pts[1] = [width, 0, 0]
105
- # pts[2] = [width, depth, 0]
106
- # pts[3] = [0, depth, 0]
107
- #
108
- # # Add the group to the entities in the model
109
- # group = entities.add_group
110
- #
111
- # # Get the entities within the group
112
- # entities2 = group.entities
113
- #
114
- # # Add a face to within the group
115
- # face = entities2.add_face pts
116
- # group.description = "This is a Group with a 2d Face"
117
- # description = group.description
118
- # if (description)
119
- # UI.messagebox description
120
- # else
121
- # UI.messagebox "Failure"
122
- # end
123
- #
124
- # @param [String] description
125
- # A string description.
126
- #
127
- # @return [String] the new description if successful
128
- #
129
- # @version SketchUp 6.0
130
- def description=(description)
131
- end
132
-
133
- # The entities method is used to retrieve a collection of entities in the
134
- # group.
135
- #
136
- # @example
137
- # depth = 100
138
- # width = 100
139
- # model = Sketchup.active_model
140
- # entities = model.active_entities
141
- # pts = []
142
- # pts[0] = [0, 0, 0]
143
- # pts[1] = [width, 0, 0]
144
- # pts[2] = [width, depth, 0]
145
- # pts[3] = [0, depth, 0]
146
- # # Add the group to the entities in the model
147
- # group = entities.add_group
148
- #
149
- # # Get the entities within the group
150
- # entities2 = group.entities
151
- #
152
- # # Add a face to within the group
153
- # face = entities2.add_face pts
154
- # entities = group.entities
155
- # if (entities)
156
- # UI.messagebox entities
157
- # else
158
- # UI.messagebox "Failure"
159
- # end
160
- #
161
- # @return [Sketchup::Entities] an Entities object if successful
162
- #
163
- # @version SketchUp 6.0
164
- def entities
165
- end
166
-
167
- # The equals? method is used to determine if a group is geometrically
168
- # equivalent to another group.
169
- #
170
- # @example
171
- # entities = Sketchup.active_model.entities
172
- # group1 = entities[0]
173
- # group2 = entities[1]
174
- # status = group1.equals?(group2)
175
- #
176
- # @param [Sketchup::Group] group
177
- # The group to compare this group with.
178
- #
179
- # @return [Boolean]
180
- #
181
- # @version SketchUp 8.0
182
- def equals?(group)
183
- end
184
-
185
- # The explode method is used to explode the group into individual entities.
186
- #
187
- # @example
188
- # # Add a group to the model.
189
- # group = Sketchup.active_model.entities.add_group
190
- # group.entities.add_line([0,0,0],[100,100,100])
191
- #
192
- # array = group.explode
193
- # if array
194
- # UI.messagebox "Exploded the group"
195
- # else
196
- # UI.messagebox "Failure"
197
- # end
198
- #
199
- # @return [Array<Sketchup::Drawingelement>] An array of entity objects if successful, false if
200
- # unsuccessful.
201
- #
202
- # @version SketchUp 6.0
203
- def explode
204
- end
205
-
206
- # The guid method is used to get the base 64 encoded unique id
207
- # for this SketchUp object.
208
- #
209
- # @example
210
- # # Add a group to the model.
211
- # group = Sketchup.active_model.entities.add_group
212
- # group.entities.add_line([0,0,0],[100,100,100])
213
- # guid = group.guid
214
- #
215
- # @return [String] a unique 22 character string
216
- #
217
- # @version SketchUp 2014
218
- def guid
219
- end
220
-
221
- # The intersect method is used to compute the boolean intersection of two
222
- # groups representing manifold solid volumes (this & arg). If the specified
223
- # objects (this and arg) do not represent manifold volumes, this method fails.
224
- #
225
- # @example
226
- # entities = Sketchup.active_model.entities
227
- # group1 = entities[0]
228
- # group2 = entities[1]
229
- # result = group1.intersect(group2)
230
- #
231
- # @param [Sketchup::Group, Sketchup::ComponentInstance] group
232
- # The group to intersect this group with.
233
- #
234
- # @return [Sketchup::Group, nil] The resultant group if the two objects
235
- # (this and arg) represent manifold solids and the
236
- # operation succeeds. Otherwise nil is returned.
237
- #
238
- # @version SketchUp 8.0
239
- def intersect(group)
240
- end
241
-
242
- # The local_bounds method returns the BoundingBox object that defines the size
243
- # of the group in an untransformed state. Useful for determining the original
244
- # width, height, and depth of a group regardless of its current position or
245
- # scale. For components, you can get a similar result by checking
246
- # my_instance.definition.bounds.
247
- #
248
- # @example
249
- # # Add a group to the model.
250
- # group = Sketchup.active_model.entities.add_group
251
- # group.entities.add_line([0,0,0],[100,100,100])
252
- # transformation = Geom::Transformation.new([100,0,0])
253
- #
254
- # # Note that local_bounds_1 and local_bounds_2 will be identical, since
255
- # # they both find the bounding box in group's untransformed state.
256
- # local_bounds_1 = group.local_bounds
257
- # group.transform! transformation
258
- # local_bounds_2 = group.local_bounds
259
- #
260
- # @return [Geom::BoundingBox] a BoundingBox object
261
- #
262
- # @version SketchUp 7.0
263
- def local_bounds
264
- end
265
-
266
- # The locked= method is used to lock a group.
267
- #
268
- # @example
269
- # # Add a group to the model.
270
- # group = Sketchup.active_model.entities.add_group
271
- # group.entities.add_line([0,0,0],[100,100,100])
272
- # status = group.locked = true
273
- #
274
- # @param [Boolean] lock
275
- #
276
- # @return [Boolean] true if the group is locked, false if not
277
- #
278
- # @version SketchUp 6.0
279
- def locked=(lock)
280
- end
281
-
282
- # The locked? method is used to determine if a group is locked.
283
- #
284
- # @example
285
- # depth = 100
286
- # width = 100
287
- # model = Sketchup.active_model
288
- # entities = model.active_entities
289
- # pts = []
290
- # pts[0] = [0, 0, 0]
291
- # pts[1] = [width, 0, 0]
292
- # pts[2] = [width, depth, 0]
293
- # pts[3] = [0, depth, 0]
294
- #
295
- # # Add the group to the entities in the model
296
- # group = entities.add_group
297
- # status = group.locked?
298
- # UI.messagebox status
299
- #
300
- # @return [Boolean]
301
- #
302
- # @version SketchUp 6.0
303
- def locked?
304
- end
305
-
306
- # The make_unique method is used to force a group to have a unique definition.
307
- #
308
- # Copying a group using the copy tool in SketchUp will create copies of the
309
- # group that share a common definition until an instance is edited manually or
310
- # this method is used. If multiple copies are made, all copies share a
311
- # definition until all copies are edited manually, or all copies have this
312
- # method used on them. This method ensures that the group uses a unique
313
- # definition entry in the drawing database.
314
- #
315
- # @example
316
- # # Assume we have 2 groups, one copied from the other and sharing definitions
317
- # groups = Sketchup.active_model.entities.grep(Sketchup::Group)
318
- # groups[0].make_unique
319
- # if (groups[0].entities.to_a == groups[1].entities.to_a)
320
- # puts "This should not happen since we made the groups unique"
321
- # end
322
- #
323
- # @return [Sketchup::Group] the unique group
324
- #
325
- # @version SketchUp 6.0
326
- def make_unique
327
- end
328
-
329
- # The manifold? method is used to determine if a group is manifold.
330
- #
331
- # @example
332
- # entities = Sketchup.active_model.entities
333
- # definition = Sketchup.active_model.definitions[0]
334
- # transformation = Geom::Transformation.new([0,0,0])
335
- # group = entities.add_instance(definition, transformation)
336
- # status = group.manifold?
337
- #
338
- # @return [Boolean]
339
- #
340
- # @version SketchUp 8.0
341
- def manifold?
342
- end
343
-
344
- # The move! method is used to apply a transformation to the group.
345
- #
346
- # This method is the same as the transform! method except that it does not
347
- # record the move in an undo operation. This method is useful for
348
- # transparently moving things during an animation.
349
- #
350
- # @example
351
- # point = Geom::Point3d.new 500,500,500
352
- # t = Geom::Transformation.new point
353
- # depth = 100
354
- # width = 100
355
- # model = Sketchup.active_model
356
- # entities = model.active_entities
357
- # pts = []
358
- # pts[0] = [0, 0, 0]
359
- # pts[1] = [width, 0, 0]
360
- # pts[2] = [width, depth, 0]
361
- # pts[3] = [0, depth, 0]
362
- #
363
- # # Add the group to the entities in the model
364
- # group = entities.add_group
365
- #
366
- # # Get the entities within the group
367
- # entities2 = group.entities
368
- #
369
- # # Add a face to within the group
370
- # face = entities2.add_face pts
371
- # UI.messagebox "Group before Move"
372
- # group = group.move! t
373
- # if (group)
374
- # UI.messagebox "Group after move"
375
- # UI.messagebox group
376
- # else
377
- # UI.messagebox "Failure"
378
- # end
379
- #
380
- # @param [Geom::Transformation] transform
381
- # A Transformation object.
382
- #
383
- # @return [Sketchup::Group] the transformed Group object if successful
384
- #
385
- # @version SketchUp 6.0
386
- def move!(transform)
387
- end
388
-
389
- # The name method is used to retrieve the name of the group.
390
- #
391
- # @example
392
- # # Add a group to the model.
393
- # group = Sketchup.active_model.entities.add_group
394
- # group.entities.add_line([0,0,0],[100,100,100])
395
- # group.name = "A Line"
396
- # name = group.name
397
- #
398
- # @return [String] The name of the group if successful
399
- #
400
- # @version SketchUp 6.0
401
- def name
402
- end
403
-
404
- # The name= method is used to set the description for the group.
405
- #
406
- # @example
407
- # # Add a group to the model.
408
- # group = Sketchup.active_model.entities.add_group
409
- # group.entities.add_line([0,0,0],[100,100,100])
410
- # group.name = "A Line"
411
- # name = group.name
412
- #
413
- # @param [String] name
414
- # A string name.
415
- #
416
- # @return [String] a new name if successful
417
- #
418
- # @version SketchUp 6.0
419
- def name=(name)
420
- end
421
-
422
- # The outer_shell method is used to compute the outer shell of the two groups
423
- # representing manifold solid volumes (this || arg). If the specified objects
424
- # (this and arg) do not represent manifold volumes, this method fails.
425
- #
426
- # @example
427
- # entities = Sketchup.active_model.entities
428
- # group1 = entities[0]
429
- # group2 = entities[1]
430
- # result = group1.outer_shell(group2)
431
- #
432
- # @param [Sketchup::Group, Sketchup::ComponentInstance] group
433
- # The group to outer shell this group with.
434
- #
435
- # @return [Sketchup::Group, nil] The resultant group if the two objects
436
- # (this and arg) represent manifold solids and the
437
- # operation succeeds otherwise nil is returned.
438
- #
439
- # @version SketchUp 8.0
440
- def outer_shell(group)
441
- end
442
-
443
- # The remove_observer method is used to remove a ComponentInstance observer
444
- # from the group.
445
- #
446
- # @example
447
- # group = Sketchup.active_model.entities[0]
448
- # if group != nil
449
- # if group.is_a? Sketchup::Group
450
- # status = group.remove_observer observer
451
- # end
452
- # end
453
- #
454
- # @param [Object] observer
455
- # An observer.
456
- #
457
- # @return [Boolean] true if successful, false if unsuccessful.
458
- #
459
- # @version SketchUp 6.0
460
- def remove_observer(observer)
461
- end
462
-
463
- # The show_differences method is used to determine if a group is
464
- # geometrically equivalent to another group and in addition move the non-
465
- # matching and matching geometry to new layers.
466
- #
467
- # This method will move both groups to Layer0. Geometry that is the same
468
- # in both groups will be moved to a new layer named group_name + "_same".
469
- # Geometry that is not the same will be moved to a layer named group_name +
470
- # "_diff".
471
- #
472
- # If verbose is true, a list of all the geometry that is different
473
- # from one group to the other is displayed texturally in the Ruby Console.
474
- #
475
- # @example
476
- # entities = Sketchup.active_model.entities
477
- # group1 = entities[0]
478
- # group2 = entities[1]
479
- # status = group1.show_differences(group2, true)
480
- #
481
- # @param [Sketchup::Group, Sketchup::ComponentInstance] group
482
- # The group to be compared with.
483
- #
484
- # @param [Boolean] verbose
485
- # A boolean flag indicating whether to display a textural
486
- # report of the found differences to the Ruby console.
487
- #
488
- # @return [Boolean] true if the groups are geometrically
489
- # equivalent. Otherwise false.
490
- #
491
- # @version SketchUp 8.0
492
- def show_differences(group, verbose)
493
- end
494
-
495
- # The split method is used to compute the boolean split (map overlay) of the
496
- # two groups representing manifold solid volumes (this ^ arg). If the
497
- # specified objects (this and arg) do not represent manifold volumes,
498
- # this method fails.
499
- #
500
- # @example
501
- # entities = Sketchup.active_model.entities
502
- # group1 = entities[0]
503
- # group2 = entities[1]
504
- # result = group1.split(group2)
505
- #
506
- # @param [Sketchup::Group, Sketchup::ComponentInstance] group
507
- # The group to split this group with.
508
- #
509
- # @return [Array(Sketchup::Group, Sketchup::Group, Sketchup::Group), nil] A vector (array) of the three resultant groups
510
- # If the two objects (this and arg) represent manifold
511
- # solids and the operation succeeds otherwise nil is
512
- # returned. The 3 groups are as follows:
513
- # The intersection of volume 1 & volume 2,
514
- # the difference of volume 1 minus volume 2,
515
- # and the reverse difference of volume 2 minus volume 1.
516
- #
517
- # @version SketchUp 8.0
518
- def split(group)
519
- end
520
-
521
- # The subtract method is used to compute the boolean difference of the two
522
- # groups representing manifold solid volumes (this - arg). If the specified
523
- # objects (this and arg) do not represent manifold volumes, this method fails.
524
- #
525
- # @example
526
- # entities = Sketchup.active_model.entities
527
- # group1 = entities[0]
528
- # group2 = entities[1]
529
- # result = group1.subtract(group2)
530
- #
531
- # @param [Sketchup::Group, Sketchup::ComponentInstance] group
532
- # The group to subtract this group from.
533
- #
534
- # @return [Sketchup::Group, nil] The resultant group if the two objects
535
- # (this and arg) represent manifold solids and the
536
- # operation succeeds. Otherwise nil is returned.
537
- #
538
- # @version SketchUp 8.0
539
- def subtract(group)
540
- end
541
-
542
- # The to_component method is used to convert the group to a component
543
- # instance.
544
- #
545
- # @example
546
- # # Add a group to the model.
547
- # group = Sketchup.active_model.entities.add_group
548
- # group.entities.add_line([0,0,0],[100,100,100])
549
- #
550
- # # change the group to a component instance
551
- # group.to_component
552
- #
553
- # @return [Sketchup::ComponentInstance] the new ComponentInstance object
554
- #
555
- # @version SketchUp 6.0
556
- def to_component
557
- end
558
-
559
- # The transform! method is used to apply a transformation to a group.
560
- #
561
- # @example
562
- # point = Geom::Point3d.new 500,500,500
563
- # t = Geom::Transformation.new point
564
- # depth = 100
565
- # width = 100
566
- # model = Sketchup.active_model
567
- # entities = model.active_entities
568
- # pts = []
569
- # pts[0] = [0, 0, 0]
570
- # pts[1] = [width, 0, 0]
571
- # pts[2] = [width, depth, 0]
572
- # pts[3] = [0, depth, 0]
573
- #
574
- # # Add the group to the entities in the model
575
- # group = entities.add_group
576
- #
577
- # # Get the entities within the group
578
- # entities2 = group.entities
579
- #
580
- # # Add a face to within the group
581
- # face = entities2.add_face pts
582
- # UI.messagebox "Group before Move"
583
- # group = group.transform! t
584
- # if (group)
585
- # UI.messagebox "Group after move"
586
- # UI.messagebox group
587
- # else
588
- # UI.messagebox "Failure"
589
- # end
590
- #
591
- # @param [Geom::Transformation] transform
592
- # A Transformation object.
593
- #
594
- # @return [Sketchup::Group] a transformed group object if successful
595
- #
596
- # @version SketchUp 6.0
597
- def transform!(transform)
598
- end
599
-
600
- # The transformation method is used to retrieve the transformation for the
601
- # group.
602
- #
603
- # @example
604
- # # Add a group to the model.
605
- # group = Sketchup.active_model.entities.add_group
606
- # group.entities.add_line([0,0,0],[100,100,100])
607
- #
608
- # trans = group.transformation
609
- #
610
- # @return [Geom::Transformation] a Transformation object if successful
611
- #
612
- # @version SketchUp 6.0
613
- def transformation
614
- end
615
-
616
- # The transformation= method is used to set the transformation for the
617
- # group.
618
- #
619
- # @example
620
- # # Add a group to the model.
621
- # group = Sketchup.active_model.entities.add_group
622
- # group.entities.add_line([0,0,0],[100,100,100])
623
- #
624
- # new_transform = Geom::Transformation.new([100,0,0])
625
- # group.transformation = new_transform
626
- #
627
- # @param [Geom::Transformation] transform
628
- # The Transformation object to apply
629
- #
630
- # @return [Geom::Transformation] the applied transformation
631
- #
632
- # @version SketchUp 6.0
633
- def transformation=(transform)
634
- end
635
-
636
- # The trim method is used to compute the (non-destructive) boolean difference
637
- # of the two groups representing manifold solid volumes (this - arg). If
638
- # the specified objects (this and arg) do not represent manifold volumes, this
639
- # method fails.
640
- #
641
- # @example
642
- # entities = Sketchup.active_model.entities
643
- # group1 = entities[0]
644
- # group2 = entities[1]
645
- # result = group1.trim(group2)
646
- #
647
- # @param [Sketchup::Group, Sketchup::ComponentInstance] group
648
- # The group to trim this group against.
649
- #
650
- # @return [Sketchup::Group, nil] The resultant group if the two objects
651
- # (this and arg) represent manifold solids and the
652
- # operation succeeds otherwise nil is returned.
653
- #
654
- # @version SketchUp 8.0
655
- def trim(group)
656
- end
657
-
658
- # The union method is used to compute the boolean union of the two groups
659
- # representing manifold solid volumes (this | arg). If the specified
660
- # objects (this and arg) do not represent manifold volumes, this method fails.
661
- #
662
- # @example
663
- # entities = Sketchup.active_model.entities
664
- # group1 = entities[0]
665
- # group2 = entities[1]
666
- # result = group1.union(group2)
667
- #
668
- # @param [Sketchup::Group, Sketchup::ComponentInstance] group
669
- # The group to union this group with.
670
- #
671
- # @return [Sketchup::Group, nil] The resultant group if the two objects
672
- # (this and arg) represent manifold solids and the
673
- # operation succeeds. Otherwise nil is returned.
674
- #
675
- # @version SketchUp 8.0
676
- def union(group)
677
- end
678
-
679
- # The volume method is used to compute the volume of this group if and only
680
- # if this group is manifold.
681
- #
682
- # @example
683
- # entities = Sketchup.active_model.entities
684
- # definition = Sketchup.active_model.definitions[0]
685
- # transformation = Geom::Transformation.new([0,0,0])
686
- # group = entities.add_instance(definition, transformation)
687
- # volume = group.volume
688
- #
689
- # @return [Float] If the group represents a manifold volume,
690
- # volume will be a positive value. If volume is negative,
691
- # the group is not manifold.
692
- #
693
- # @version SketchUp 8.0
694
- def volume
695
- end
696
-
697
- end
1
+ # Copyright:: Copyright 2020 Trimble Inc.
2
+ # License:: The MIT License (MIT)
3
+
4
+ # A Group class contains methods for manipulating groups of entities.
5
+ #
6
+ # Groups in SketchUp are very similar to Components, except that there is no
7
+ # instancing of groups. That means that you always will have one and only one
8
+ # of each of your groups. (In the actual implementation, SketchUp keeps track
9
+ # of groups as a special kind of Component that combines properties of
10
+ # definitions and instances, which is why you will see deprecated methods
11
+ # like Group.make_unique, and the class of observer you attach to Groups are
12
+ # ComponentInstance observers.)
13
+ #
14
+ # @version SketchUp 6.0
15
+ class Sketchup::Group < Sketchup::Drawingelement
16
+
17
+ # Instance Methods
18
+
19
+ # The add_observer method is used to add a ComponentInstance observer to the
20
+ # group.
21
+ #
22
+ # @example
23
+ # # Add a group to the model.
24
+ # group = Sketchup.active_model.entities.add_group
25
+ # group.entities.add_line([0,0,0],[100,100,100])
26
+ # status = group.add_observer observer
27
+ #
28
+ # @param [Object] observer
29
+ # An observer.
30
+ #
31
+ # @return [Boolean] true if successful, false if unsuccessful.
32
+ #
33
+ # @version SketchUp 6.0
34
+ def add_observer(observer)
35
+ end
36
+
37
+ # The copy method is used to create a new Group object that is a copy of the
38
+ # group.
39
+ #
40
+ # @example
41
+ # # Add a group to the model.
42
+ # group = Sketchup.active_model.entities.add_group
43
+ # group.entities.add_line([0,0,0],[100,100,100])
44
+ # group2 = group.copy
45
+ #
46
+ # @return [Sketchup::Group] a new Group object
47
+ #
48
+ # @version SketchUp 6.0
49
+ def copy
50
+ end
51
+
52
+ # The definition method is used to retrieve the component definition for this
53
+ # group.
54
+ #
55
+ # @example
56
+ # group = Sketchup.active_model.entities.add_group
57
+ # definition = group.definition
58
+ #
59
+ # @return [Sketchup::ComponentDefinition] a ComponentDefinition object if
60
+ # successful
61
+ #
62
+ # @version SketchUp 2015
63
+ def definition
64
+ end
65
+
66
+ # The description method is used to retrieve the description for the group.
67
+ #
68
+ # @example
69
+ # depth = 100
70
+ # width = 100
71
+ # model = Sketchup.active_model
72
+ # entities = model.active_entities
73
+ # pts = []
74
+ # pts[0] = [0, 0, 0]
75
+ # pts[1] = [width, 0, 0]
76
+ # pts[2] = [width, depth, 0]
77
+ # pts[3] = [0, depth, 0]
78
+ # # Add the group to the entities in the model
79
+ # group = entities.add_group
80
+ #
81
+ # # Get the entities within the group
82
+ # entities2 = group.entities
83
+ #
84
+ # # Add a face to within the group
85
+ # face = entities2.add_face pts
86
+ # group.description = "This is a Group with a 2d Face"
87
+ # description = group.description
88
+ #
89
+ # @return [String] a string description if successful
90
+ #
91
+ # @version SketchUp 6.0
92
+ def description
93
+ end
94
+
95
+ # The description= method is used to set the description for the group.
96
+ #
97
+ # @example
98
+ # depth = 100
99
+ # width = 100
100
+ # model = Sketchup.active_model
101
+ # entities = model.active_entities
102
+ # pts = []
103
+ # pts[0] = [0, 0, 0]
104
+ # pts[1] = [width, 0, 0]
105
+ # pts[2] = [width, depth, 0]
106
+ # pts[3] = [0, depth, 0]
107
+ #
108
+ # # Add the group to the entities in the model
109
+ # group = entities.add_group
110
+ #
111
+ # # Get the entities within the group
112
+ # entities2 = group.entities
113
+ #
114
+ # # Add a face to within the group
115
+ # face = entities2.add_face pts
116
+ # group.description = "This is a Group with a 2d Face"
117
+ # description = group.description
118
+ # if (description)
119
+ # UI.messagebox description
120
+ # else
121
+ # UI.messagebox "Failure"
122
+ # end
123
+ #
124
+ # @param [String] description
125
+ # A string description.
126
+ #
127
+ # @return [String] the new description if successful
128
+ #
129
+ # @version SketchUp 6.0
130
+ def description=(description)
131
+ end
132
+
133
+ # The entities method is used to retrieve a collection of entities in the
134
+ # group.
135
+ #
136
+ # @example
137
+ # depth = 100
138
+ # width = 100
139
+ # model = Sketchup.active_model
140
+ # entities = model.active_entities
141
+ # pts = []
142
+ # pts[0] = [0, 0, 0]
143
+ # pts[1] = [width, 0, 0]
144
+ # pts[2] = [width, depth, 0]
145
+ # pts[3] = [0, depth, 0]
146
+ # # Add the group to the entities in the model
147
+ # group = entities.add_group
148
+ #
149
+ # # Get the entities within the group
150
+ # entities2 = group.entities
151
+ #
152
+ # # Add a face to within the group
153
+ # face = entities2.add_face pts
154
+ # entities = group.entities
155
+ # if (entities)
156
+ # UI.messagebox entities
157
+ # else
158
+ # UI.messagebox "Failure"
159
+ # end
160
+ #
161
+ # @return [Sketchup::Entities] an Entities object if successful
162
+ #
163
+ # @version SketchUp 6.0
164
+ def entities
165
+ end
166
+
167
+ # The equals? method is used to determine if a group is geometrically
168
+ # equivalent to another group.
169
+ #
170
+ # @example
171
+ # entities = Sketchup.active_model.entities
172
+ # group1 = entities[0]
173
+ # group2 = entities[1]
174
+ # status = group1.equals?(group2)
175
+ #
176
+ # @param [Sketchup::Group] group
177
+ # The group to compare this group with.
178
+ #
179
+ # @return [Boolean]
180
+ #
181
+ # @version SketchUp 8.0
182
+ def equals?(group)
183
+ end
184
+
185
+ # The explode method is used to explode the group into individual entities.
186
+ #
187
+ # @example
188
+ # # Add a group to the model.
189
+ # group = Sketchup.active_model.entities.add_group
190
+ # group.entities.add_line([0,0,0],[100,100,100])
191
+ #
192
+ # array = group.explode
193
+ # if array
194
+ # UI.messagebox "Exploded the group"
195
+ # else
196
+ # UI.messagebox "Failure"
197
+ # end
198
+ #
199
+ # @return [Array<Sketchup::Drawingelement>] An array of entity objects if successful, false if
200
+ # unsuccessful.
201
+ #
202
+ # @version SketchUp 6.0
203
+ def explode
204
+ end
205
+
206
+ # The guid method is used to get the base 64 encoded unique id
207
+ # for this SketchUp object.
208
+ #
209
+ # @example
210
+ # # Add a group to the model.
211
+ # group = Sketchup.active_model.entities.add_group
212
+ # group.entities.add_line([0,0,0],[100,100,100])
213
+ # guid = group.guid
214
+ #
215
+ # @return [String] a unique 22 character string
216
+ #
217
+ # @version SketchUp 2014
218
+ def guid
219
+ end
220
+
221
+ # The intersect method is used to compute the boolean intersection of two
222
+ # groups representing manifold solid volumes (this & arg). If the specified
223
+ # objects (this and arg) do not represent manifold volumes, this method fails.
224
+ #
225
+ # @example
226
+ # entities = Sketchup.active_model.entities
227
+ # group1 = entities[0]
228
+ # group2 = entities[1]
229
+ # result = group1.intersect(group2)
230
+ #
231
+ # @param [Sketchup::Group, Sketchup::ComponentInstance] group
232
+ # The group to intersect this group with.
233
+ #
234
+ # @return [Sketchup::Group, nil] The resultant group if the two objects
235
+ # (this and arg) represent manifold solids and the
236
+ # operation succeeds. Otherwise nil is returned.
237
+ #
238
+ # @version SketchUp 8.0
239
+ def intersect(group)
240
+ end
241
+
242
+ # The local_bounds method returns the BoundingBox object that defines the size
243
+ # of the group in an untransformed state. Useful for determining the original
244
+ # width, height, and depth of a group regardless of its current position or
245
+ # scale. For components, you can get a similar result by checking
246
+ # my_instance.definition.bounds.
247
+ #
248
+ # @example
249
+ # # Add a group to the model.
250
+ # group = Sketchup.active_model.entities.add_group
251
+ # group.entities.add_line([0,0,0],[100,100,100])
252
+ # transformation = Geom::Transformation.new([100,0,0])
253
+ #
254
+ # # Note that local_bounds_1 and local_bounds_2 will be identical, since
255
+ # # they both find the bounding box in group's untransformed state.
256
+ # local_bounds_1 = group.local_bounds
257
+ # group.transform! transformation
258
+ # local_bounds_2 = group.local_bounds
259
+ #
260
+ # @return [Geom::BoundingBox] a BoundingBox object
261
+ #
262
+ # @version SketchUp 7.0
263
+ def local_bounds
264
+ end
265
+
266
+ # The locked= method is used to lock a group.
267
+ #
268
+ # @example
269
+ # # Add a group to the model.
270
+ # group = Sketchup.active_model.entities.add_group
271
+ # group.entities.add_line([0,0,0],[100,100,100])
272
+ # status = group.locked = true
273
+ #
274
+ # @param [Boolean] lock
275
+ #
276
+ # @return [Boolean] true if the group is locked, false if not
277
+ #
278
+ # @version SketchUp 6.0
279
+ def locked=(lock)
280
+ end
281
+
282
+ # The locked? method is used to determine if a group is locked.
283
+ #
284
+ # @example
285
+ # depth = 100
286
+ # width = 100
287
+ # model = Sketchup.active_model
288
+ # entities = model.active_entities
289
+ # pts = []
290
+ # pts[0] = [0, 0, 0]
291
+ # pts[1] = [width, 0, 0]
292
+ # pts[2] = [width, depth, 0]
293
+ # pts[3] = [0, depth, 0]
294
+ #
295
+ # # Add the group to the entities in the model
296
+ # group = entities.add_group
297
+ # status = group.locked?
298
+ # UI.messagebox status
299
+ #
300
+ # @return [Boolean]
301
+ #
302
+ # @version SketchUp 6.0
303
+ def locked?
304
+ end
305
+
306
+ # The make_unique method is used to force a group to have a unique definition.
307
+ #
308
+ # Copying a group using the copy tool in SketchUp will create copies of the
309
+ # group that share a common definition until an instance is edited manually or
310
+ # this method is used. If multiple copies are made, all copies share a
311
+ # definition until all copies are edited manually, or all copies have this
312
+ # method used on them. This method ensures that the group uses a unique
313
+ # definition entry in the drawing database.
314
+ #
315
+ # @example
316
+ # # Assume we have 2 groups, one copied from the other and sharing definitions
317
+ # groups = Sketchup.active_model.entities.grep(Sketchup::Group)
318
+ # groups[0].make_unique
319
+ # if (groups[0].entities.to_a == groups[1].entities.to_a)
320
+ # puts "This should not happen since we made the groups unique"
321
+ # end
322
+ #
323
+ # @return [Sketchup::Group] the unique group
324
+ #
325
+ # @version SketchUp 6.0
326
+ def make_unique
327
+ end
328
+
329
+ # The manifold? method is used to determine if a group is manifold.
330
+ #
331
+ # @example
332
+ # entities = Sketchup.active_model.entities
333
+ # definition = Sketchup.active_model.definitions[0]
334
+ # transformation = Geom::Transformation.new([0,0,0])
335
+ # group = entities.add_instance(definition, transformation)
336
+ # status = group.manifold?
337
+ #
338
+ # @return [Boolean]
339
+ #
340
+ # @version SketchUp 8.0
341
+ def manifold?
342
+ end
343
+
344
+ # The move! method is used to apply a transformation to the group.
345
+ #
346
+ # This method is the same as the transform! method except that it does not
347
+ # record the move in an undo operation. This method is useful for
348
+ # transparently moving things during an animation.
349
+ #
350
+ # @example
351
+ # point = Geom::Point3d.new 500,500,500
352
+ # t = Geom::Transformation.new point
353
+ # depth = 100
354
+ # width = 100
355
+ # model = Sketchup.active_model
356
+ # entities = model.active_entities
357
+ # pts = []
358
+ # pts[0] = [0, 0, 0]
359
+ # pts[1] = [width, 0, 0]
360
+ # pts[2] = [width, depth, 0]
361
+ # pts[3] = [0, depth, 0]
362
+ #
363
+ # # Add the group to the entities in the model
364
+ # group = entities.add_group
365
+ #
366
+ # # Get the entities within the group
367
+ # entities2 = group.entities
368
+ #
369
+ # # Add a face to within the group
370
+ # face = entities2.add_face pts
371
+ # UI.messagebox "Group before Move"
372
+ # group = group.move! t
373
+ # if (group)
374
+ # UI.messagebox "Group after move"
375
+ # UI.messagebox group
376
+ # else
377
+ # UI.messagebox "Failure"
378
+ # end
379
+ #
380
+ # @param [Geom::Transformation] transform
381
+ # A Transformation object.
382
+ #
383
+ # @return [Sketchup::Group] the transformed Group object if successful
384
+ #
385
+ # @version SketchUp 6.0
386
+ def move!(transform)
387
+ end
388
+
389
+ # The name method is used to retrieve the name of the group.
390
+ #
391
+ # @example
392
+ # # Add a group to the model.
393
+ # group = Sketchup.active_model.entities.add_group
394
+ # group.entities.add_line([0,0,0],[100,100,100])
395
+ # group.name = "A Line"
396
+ # name = group.name
397
+ #
398
+ # @return [String] The name of the group if successful
399
+ #
400
+ # @version SketchUp 6.0
401
+ def name
402
+ end
403
+
404
+ # The name= method is used to set the description for the group.
405
+ #
406
+ # @example
407
+ # # Add a group to the model.
408
+ # group = Sketchup.active_model.entities.add_group
409
+ # group.entities.add_line([0,0,0],[100,100,100])
410
+ # group.name = "A Line"
411
+ # name = group.name
412
+ #
413
+ # @param [String] name
414
+ # A string name.
415
+ #
416
+ # @return [String] a new name if successful
417
+ #
418
+ # @version SketchUp 6.0
419
+ def name=(name)
420
+ end
421
+
422
+ # The outer_shell method is used to compute the outer shell of the two groups
423
+ # representing manifold solid volumes (this || arg). If the specified objects
424
+ # (this and arg) do not represent manifold volumes, this method fails.
425
+ #
426
+ # @example
427
+ # entities = Sketchup.active_model.entities
428
+ # group1 = entities[0]
429
+ # group2 = entities[1]
430
+ # result = group1.outer_shell(group2)
431
+ #
432
+ # @param [Sketchup::Group, Sketchup::ComponentInstance] group
433
+ # The group to outer shell this group with.
434
+ #
435
+ # @return [Sketchup::Group, nil] The resultant group if the two objects
436
+ # (this and arg) represent manifold solids and the
437
+ # operation succeeds otherwise nil is returned.
438
+ #
439
+ # @version SketchUp 8.0
440
+ def outer_shell(group)
441
+ end
442
+
443
+ # The remove_observer method is used to remove a ComponentInstance observer
444
+ # from the group.
445
+ #
446
+ # @example
447
+ # group = Sketchup.active_model.entities[0]
448
+ # if group != nil
449
+ # if group.is_a? Sketchup::Group
450
+ # status = group.remove_observer observer
451
+ # end
452
+ # end
453
+ #
454
+ # @param [Object] observer
455
+ # An observer.
456
+ #
457
+ # @return [Boolean] true if successful, false if unsuccessful.
458
+ #
459
+ # @version SketchUp 6.0
460
+ def remove_observer(observer)
461
+ end
462
+
463
+ # The show_differences method is used to determine if a group is
464
+ # geometrically equivalent to another group and in addition move the non-
465
+ # matching and matching geometry to new layers.
466
+ #
467
+ # This method will move both groups to Layer0. Geometry that is the same
468
+ # in both groups will be moved to a new layer named group_name + "_same".
469
+ # Geometry that is not the same will be moved to a layer named group_name +
470
+ # "_diff".
471
+ #
472
+ # If verbose is true, a list of all the geometry that is different
473
+ # from one group to the other is displayed texturally in the Ruby Console.
474
+ #
475
+ # @example
476
+ # entities = Sketchup.active_model.entities
477
+ # group1 = entities[0]
478
+ # group2 = entities[1]
479
+ # status = group1.show_differences(group2, true)
480
+ #
481
+ # @param [Sketchup::Group, Sketchup::ComponentInstance] group
482
+ # The group to be compared with.
483
+ #
484
+ # @param [Boolean] verbose
485
+ # A boolean flag indicating whether to display a textural
486
+ # report of the found differences to the Ruby console.
487
+ #
488
+ # @return [Boolean] true if the groups are geometrically
489
+ # equivalent. Otherwise false.
490
+ #
491
+ # @version SketchUp 8.0
492
+ def show_differences(group, verbose)
493
+ end
494
+
495
+ # The split method is used to compute the boolean split (map overlay) of the
496
+ # two groups representing manifold solid volumes (this ^ arg). If the
497
+ # specified objects (this and arg) do not represent manifold volumes,
498
+ # this method fails.
499
+ #
500
+ # @example
501
+ # entities = Sketchup.active_model.entities
502
+ # group1 = entities[0]
503
+ # group2 = entities[1]
504
+ # result = group1.split(group2)
505
+ #
506
+ # @param [Sketchup::Group, Sketchup::ComponentInstance] group
507
+ # The group to split this group with.
508
+ #
509
+ # @return [Array(Sketchup::Group, Sketchup::Group, Sketchup::Group), nil] A vector (array) of the three resultant groups
510
+ # If the two objects (this and arg) represent manifold
511
+ # solids and the operation succeeds otherwise nil is
512
+ # returned. The 3 groups are as follows:
513
+ # The intersection of volume 1 & volume 2,
514
+ # the difference of volume 1 minus volume 2,
515
+ # and the reverse difference of volume 2 minus volume 1.
516
+ #
517
+ # @version SketchUp 8.0
518
+ def split(group)
519
+ end
520
+
521
+ # The subtract method is used to compute the boolean difference of the two
522
+ # groups representing manifold solid volumes (this - arg). If the specified
523
+ # objects (this and arg) do not represent manifold volumes, this method fails.
524
+ #
525
+ # @example
526
+ # entities = Sketchup.active_model.entities
527
+ # group1 = entities[0]
528
+ # group2 = entities[1]
529
+ # result = group1.subtract(group2)
530
+ #
531
+ # @param [Sketchup::Group, Sketchup::ComponentInstance] group
532
+ # The group to subtract this group from.
533
+ #
534
+ # @return [Sketchup::Group, nil] The resultant group if the two objects
535
+ # (this and arg) represent manifold solids and the
536
+ # operation succeeds. Otherwise nil is returned.
537
+ #
538
+ # @version SketchUp 8.0
539
+ def subtract(group)
540
+ end
541
+
542
+ # The to_component method is used to convert the group to a component
543
+ # instance.
544
+ #
545
+ # @example
546
+ # # Add a group to the model.
547
+ # group = Sketchup.active_model.entities.add_group
548
+ # group.entities.add_line([0,0,0],[100,100,100])
549
+ #
550
+ # # change the group to a component instance
551
+ # group.to_component
552
+ #
553
+ # @return [Sketchup::ComponentInstance] the new ComponentInstance object
554
+ #
555
+ # @version SketchUp 6.0
556
+ def to_component
557
+ end
558
+
559
+ # The transform! method is used to apply a transformation to a group.
560
+ #
561
+ # @example
562
+ # point = Geom::Point3d.new 500,500,500
563
+ # t = Geom::Transformation.new point
564
+ # depth = 100
565
+ # width = 100
566
+ # model = Sketchup.active_model
567
+ # entities = model.active_entities
568
+ # pts = []
569
+ # pts[0] = [0, 0, 0]
570
+ # pts[1] = [width, 0, 0]
571
+ # pts[2] = [width, depth, 0]
572
+ # pts[3] = [0, depth, 0]
573
+ #
574
+ # # Add the group to the entities in the model
575
+ # group = entities.add_group
576
+ #
577
+ # # Get the entities within the group
578
+ # entities2 = group.entities
579
+ #
580
+ # # Add a face to within the group
581
+ # face = entities2.add_face pts
582
+ # UI.messagebox "Group before Move"
583
+ # group = group.transform! t
584
+ # if (group)
585
+ # UI.messagebox "Group after move"
586
+ # UI.messagebox group
587
+ # else
588
+ # UI.messagebox "Failure"
589
+ # end
590
+ #
591
+ # @param [Geom::Transformation] transform
592
+ # A Transformation object.
593
+ #
594
+ # @return [Sketchup::Group] a transformed group object if successful
595
+ #
596
+ # @version SketchUp 6.0
597
+ def transform!(transform)
598
+ end
599
+
600
+ # The transformation method is used to retrieve the transformation for the
601
+ # group.
602
+ #
603
+ # @example
604
+ # # Add a group to the model.
605
+ # group = Sketchup.active_model.entities.add_group
606
+ # group.entities.add_line([0,0,0],[100,100,100])
607
+ #
608
+ # trans = group.transformation
609
+ #
610
+ # @return [Geom::Transformation] a Transformation object if successful
611
+ #
612
+ # @version SketchUp 6.0
613
+ def transformation
614
+ end
615
+
616
+ # The transformation= method is used to set the transformation for the
617
+ # group.
618
+ #
619
+ # @example
620
+ # # Add a group to the model.
621
+ # group = Sketchup.active_model.entities.add_group
622
+ # group.entities.add_line([0,0,0],[100,100,100])
623
+ #
624
+ # new_transform = Geom::Transformation.new([100,0,0])
625
+ # group.transformation = new_transform
626
+ #
627
+ # @param [Geom::Transformation] transform
628
+ # The Transformation object to apply
629
+ #
630
+ # @return [Geom::Transformation] the applied transformation
631
+ #
632
+ # @version SketchUp 6.0
633
+ def transformation=(transform)
634
+ end
635
+
636
+ # The trim method is used to compute the (non-destructive) boolean difference
637
+ # of the two groups representing manifold solid volumes (this - arg). If
638
+ # the specified objects (this and arg) do not represent manifold volumes, this
639
+ # method fails.
640
+ #
641
+ # @example
642
+ # entities = Sketchup.active_model.entities
643
+ # group1 = entities[0]
644
+ # group2 = entities[1]
645
+ # result = group1.trim(group2)
646
+ #
647
+ # @param [Sketchup::Group, Sketchup::ComponentInstance] group
648
+ # The group to trim this group against.
649
+ #
650
+ # @return [Sketchup::Group, nil] The resultant group if the two objects
651
+ # (this and arg) represent manifold solids and the
652
+ # operation succeeds otherwise nil is returned.
653
+ #
654
+ # @version SketchUp 8.0
655
+ def trim(group)
656
+ end
657
+
658
+ # The union method is used to compute the boolean union of the two groups
659
+ # representing manifold solid volumes (this | arg). If the specified
660
+ # objects (this and arg) do not represent manifold volumes, this method fails.
661
+ #
662
+ # @example
663
+ # entities = Sketchup.active_model.entities
664
+ # group1 = entities[0]
665
+ # group2 = entities[1]
666
+ # result = group1.union(group2)
667
+ #
668
+ # @param [Sketchup::Group, Sketchup::ComponentInstance] group
669
+ # The group to union this group with.
670
+ #
671
+ # @return [Sketchup::Group, nil] The resultant group if the two objects
672
+ # (this and arg) represent manifold solids and the
673
+ # operation succeeds. Otherwise nil is returned.
674
+ #
675
+ # @version SketchUp 8.0
676
+ def union(group)
677
+ end
678
+
679
+ # The volume method is used to compute the volume of this group if and only
680
+ # if this group is manifold.
681
+ #
682
+ # @example
683
+ # entities = Sketchup.active_model.entities
684
+ # definition = Sketchup.active_model.definitions[0]
685
+ # transformation = Geom::Transformation.new([0,0,0])
686
+ # group = entities.add_instance(definition, transformation)
687
+ # volume = group.volume
688
+ #
689
+ # @return [Float] If the group represents a manifold volume,
690
+ # volume will be a positive value. If volume is negative,
691
+ # the group is not manifold.
692
+ #
693
+ # @version SketchUp 8.0
694
+ def volume
695
+ end
696
+
697
+ end