sketchup-api-stubs 0.7.3 → 0.7.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (149) hide show
  1. checksums.yaml +5 -5
  2. data/.yardopts +9 -9
  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 -400
  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 -522
  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 -573
  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 -514
  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 -353
  26. data/lib/sketchup-api-stubs/stubs/Layout/FormattedText.rb +349 -349
  27. data/lib/sketchup-api-stubs/stubs/Layout/Grid.rb +311 -311
  28. data/lib/sketchup-api-stubs/stubs/Layout/Group.rb +261 -261
  29. data/lib/sketchup-api-stubs/stubs/Layout/Image.rb +91 -91
  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 -567
  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 -694
  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 -562
  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 -1119
  76. data/lib/sketchup-api-stubs/stubs/Sketchup/EntitiesObserver.rb +125 -125
  77. data/lib/sketchup-api-stubs/stubs/Sketchup/Entity.rb +544 -544
  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 -280
  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 -1601
  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 -284
  108. data/lib/sketchup-api-stubs/stubs/Sketchup/OptionsProviderObserver.rb +58 -58
  109. data/lib/sketchup-api-stubs/stubs/Sketchup/Page.rb +770 -770
  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 -364
  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 -1301
  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 -311
  140. data/lib/sketchup-api-stubs/stubs/array.rb +741 -741
  141. data/lib/sketchup-api-stubs/stubs/geom.rb +348 -348
  142. data/lib/sketchup-api-stubs/stubs/languagehandler.rb +92 -92
  143. data/lib/sketchup-api-stubs/stubs/length.rb +278 -278
  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 -667
  149. metadata +3 -4
@@ -1,125 +1,125 @@
1
- # Copyright:: Copyright 2020 Trimble Inc.
2
- # License:: The MIT License (MIT)
3
-
4
- # This observer interface is implemented to react to {Sketchup::Entities}
5
- # collection events. To implement this observer, create a Ruby class of this
6
- # type, override the desired methods, and add an instance of the observer to
7
- # the objects of interests.
8
- #
9
- # @example
10
- # # This is an example of an observer that watches the entities collection
11
- # # new added elements and writes a message on the console.
12
- # class MyEntitiesObserver < Sketchup::EntitiesObserver
13
- # def onElementAdded(entities, entity)
14
- # puts "onElementAdded: #{entity}"
15
- # end
16
- # end
17
- #
18
- # # Attach the observer
19
- # Sketchup.active_model.entities.add_observer(MyEntitiesObserver.new)
20
- #
21
- # @note The methods of this observer fire in such a way that making changes
22
- # to the model while inside of them is dangerous. If you experience sudden
23
- # crashes, it could be because of this observer. A potential workaround is to
24
- # use a {Sketchup::ToolsObserver} to watch what the user is doing instead.
25
- #
26
- # @version SketchUp 6.0
27
- class Sketchup::EntitiesObserver
28
-
29
- # Instance Methods
30
-
31
- # The {#onActiveSectionPlaneChanged} method is invoked when a section plane
32
- # within this entities is activated or the active one is deactivated.
33
- #
34
- # @example
35
- # def onActiveSectionPlaneChanged(entities)
36
- # sp = entities.active_section_plane
37
- # if sp.nil?
38
- # puts "Section plane is deactivated on #{entities}"
39
- # else
40
- # puts "#{sp} is activated on #{entities}"
41
- # end
42
- # end
43
- #
44
- # @param [Sketchup::Entities] entities
45
- #
46
- # @return [nil]
47
- #
48
- # @version SketchUp 2014
49
- def onActiveSectionPlaneChanged(entities)
50
- end
51
-
52
- # The onElementAdded method is invoked when a single element is added
53
- # to the {Sketchup::Entities} collection.
54
- #
55
- # @example
56
- # def onElementAdded(entities, entity)
57
- # puts "onElementAdded: #{entity}"
58
- # end
59
- #
60
- # @param [Sketchup::Entities] entities
61
- #
62
- # @param [Sketchup::Entity] entity
63
- #
64
- # @return [nil]
65
- #
66
- # @version SketchUp 6.0
67
- def onElementAdded(entities, entity)
68
- end
69
-
70
- # The {#onElementModified} method is invoked whenever one or more elements in
71
- # the collection are modified.
72
- #
73
- # @example
74
- # def onElementModified(entities, entity)
75
- # puts "onElementModified: #{entity}"
76
- # end
77
- #
78
- # @param [Sketchup::Entities] entities
79
- #
80
- # @param [Sketchup::Entity] entity
81
- #
82
- # @return [nil]
83
- #
84
- # @version SketchUp 8.0
85
- def onElementModified(entities, entity)
86
- end
87
-
88
- # The {#onElementRemoved} method is invoked when a single element is removed
89
- # from the {Sketchup::Entities} collection. Note that the entity has been
90
- # deleted and should not be used in anyway except to know that the entity has
91
- # been deleted.
92
- #
93
- # @example
94
- # def onElementRemoved(entities, entity_id)
95
- # puts "onElementRemoved: #{entity_id}"
96
- # end
97
- #
98
- # @param [Sketchup::Entities] entities
99
- #
100
- # @param [Sketchup::Entity] entity_id
101
- # The id of the entity that was
102
- # deleted/removed.
103
- #
104
- # @return [nil]
105
- #
106
- # @version SketchUp 6.0
107
- def onElementRemoved(entities, entity_id)
108
- end
109
-
110
- # The {#onEraseEntities} method is invoked when one or more entities are erased.
111
- #
112
- # @example
113
- # def onEraseEntities(entities)
114
- # puts "onEraseEntities: #{entities}"
115
- # end
116
- #
117
- # @param [Sketchup::Entities] entities
118
- #
119
- # @return [nil]
120
- #
121
- # @version SketchUp 6.0
122
- def onEraseEntities(entities)
123
- end
124
-
125
- end
1
+ # Copyright:: Copyright 2020 Trimble Inc.
2
+ # License:: The MIT License (MIT)
3
+
4
+ # This observer interface is implemented to react to {Sketchup::Entities}
5
+ # collection events. To implement this observer, create a Ruby class of this
6
+ # type, override the desired methods, and add an instance of the observer to
7
+ # the objects of interests.
8
+ #
9
+ # @example
10
+ # # This is an example of an observer that watches the entities collection
11
+ # # new added elements and writes a message on the console.
12
+ # class MyEntitiesObserver < Sketchup::EntitiesObserver
13
+ # def onElementAdded(entities, entity)
14
+ # puts "onElementAdded: #{entity}"
15
+ # end
16
+ # end
17
+ #
18
+ # # Attach the observer
19
+ # Sketchup.active_model.entities.add_observer(MyEntitiesObserver.new)
20
+ #
21
+ # @note The methods of this observer fire in such a way that making changes
22
+ # to the model while inside of them is dangerous. If you experience sudden
23
+ # crashes, it could be because of this observer. A potential workaround is to
24
+ # use a {Sketchup::ToolsObserver} to watch what the user is doing instead.
25
+ #
26
+ # @version SketchUp 6.0
27
+ class Sketchup::EntitiesObserver
28
+
29
+ # Instance Methods
30
+
31
+ # The {#onActiveSectionPlaneChanged} method is invoked when a section plane
32
+ # within this entities is activated or the active one is deactivated.
33
+ #
34
+ # @example
35
+ # def onActiveSectionPlaneChanged(entities)
36
+ # sp = entities.active_section_plane
37
+ # if sp.nil?
38
+ # puts "Section plane is deactivated on #{entities}"
39
+ # else
40
+ # puts "#{sp} is activated on #{entities}"
41
+ # end
42
+ # end
43
+ #
44
+ # @param [Sketchup::Entities] entities
45
+ #
46
+ # @return [nil]
47
+ #
48
+ # @version SketchUp 2014
49
+ def onActiveSectionPlaneChanged(entities)
50
+ end
51
+
52
+ # The onElementAdded method is invoked when a single element is added
53
+ # to the {Sketchup::Entities} collection.
54
+ #
55
+ # @example
56
+ # def onElementAdded(entities, entity)
57
+ # puts "onElementAdded: #{entity}"
58
+ # end
59
+ #
60
+ # @param [Sketchup::Entities] entities
61
+ #
62
+ # @param [Sketchup::Entity] entity
63
+ #
64
+ # @return [nil]
65
+ #
66
+ # @version SketchUp 6.0
67
+ def onElementAdded(entities, entity)
68
+ end
69
+
70
+ # The {#onElementModified} method is invoked whenever one or more elements in
71
+ # the collection are modified.
72
+ #
73
+ # @example
74
+ # def onElementModified(entities, entity)
75
+ # puts "onElementModified: #{entity}"
76
+ # end
77
+ #
78
+ # @param [Sketchup::Entities] entities
79
+ #
80
+ # @param [Sketchup::Entity] entity
81
+ #
82
+ # @return [nil]
83
+ #
84
+ # @version SketchUp 8.0
85
+ def onElementModified(entities, entity)
86
+ end
87
+
88
+ # The {#onElementRemoved} method is invoked when a single element is removed
89
+ # from the {Sketchup::Entities} collection. Note that the entity has been
90
+ # deleted and should not be used in anyway except to know that the entity has
91
+ # been deleted.
92
+ #
93
+ # @example
94
+ # def onElementRemoved(entities, entity_id)
95
+ # puts "onElementRemoved: #{entity_id}"
96
+ # end
97
+ #
98
+ # @param [Sketchup::Entities] entities
99
+ #
100
+ # @param [Sketchup::Entity] entity_id
101
+ # The id of the entity that was
102
+ # deleted/removed.
103
+ #
104
+ # @return [nil]
105
+ #
106
+ # @version SketchUp 6.0
107
+ def onElementRemoved(entities, entity_id)
108
+ end
109
+
110
+ # The {#onEraseEntities} method is invoked when one or more entities are erased.
111
+ #
112
+ # @example
113
+ # def onEraseEntities(entities)
114
+ # puts "onEraseEntities: #{entities}"
115
+ # end
116
+ #
117
+ # @param [Sketchup::Entities] entities
118
+ #
119
+ # @return [nil]
120
+ #
121
+ # @version SketchUp 6.0
122
+ def onEraseEntities(entities)
123
+ end
124
+
125
+ end
@@ -1,544 +1,544 @@
1
- # Copyright:: Copyright 2020 Trimble Inc.
2
- # License:: The MIT License (MIT)
3
-
4
- # This is the base class for all SketchUp entities. Entities are basically
5
- # anything that can be contained in a model, including Drawingelements
6
- # such as Edges, SectionPlanes, Groups, etc. and entities that relate to
7
- # those Drawingelements, such as Loops, Layers, etc.
8
- #
9
- # Keep in mind that the methods below are available on all subclasses.
10
- # For example, an Edge's parent class is Drawingelement, and a
11
- # Drawingelement's parent class is Entity. Therefore an Edge has all of the
12
- # methods defined in Drawingelement and Entity.
13
- #
14
- # The Object.is_a? method is the common way of determining what sort of Entity
15
- # you're dealing with.
16
- #
17
- # @example
18
- # # Count how many faces are in the current selection.
19
- # selection = Sketchup.active_model.selection
20
- # face_count = 0
21
- #
22
- # # Look at all of the entities in the selection.
23
- # selection.each { |entity|
24
- # if entity.is_a? Sketchup::Face
25
- # face_count = face_count + 1
26
- # end
27
- # }
28
- #
29
- # UI.messagebox("There are " + face_count.to_s + " faces selected.")
30
- #
31
- # @version SketchUp 6.0
32
- class Sketchup::Entity
33
-
34
- # Instance Methods
35
-
36
- # The add_observer method is used to add an observer to the current object.
37
- #
38
- # @example
39
- # entity = Sketchup.active_model.entities[0]
40
- # if entity.valid?
41
- # status = entity.add_observer observer
42
- # end
43
- #
44
- # @param [Object] observer
45
- # An observer.
46
- #
47
- # @return [Boolean] true if successful, false if unsuccessful.
48
- #
49
- # @version SketchUp 6.0
50
- def add_observer(observer)
51
- end
52
-
53
- # The attribute_dictionaries method is used to retrieve the
54
- # AttributeDictionaries collection attached to the entity.
55
- #
56
- # @example
57
- # depth = 100
58
- # width = 100
59
- # model = Sketchup.active_model
60
- # entities = model.active_entities
61
- # pts = []
62
- # pts[0] = [0, 0, 0]
63
- # pts[1] = [width, 0, 0]
64
- # pts[2] = [width, depth, 0]
65
- # pts[3] = [0, depth, 0]
66
- #
67
- # # Add the face to the entities in the model
68
- # face = entities.add_face pts
69
- #
70
- # # I just happen to know that the second and third entities in the
71
- # # entities objects are edges.
72
- # entity1 = entities[1]
73
- # status = entity1.set_attribute "testdictionary", "test", 115
74
- # attrdicts = entity1.attribute_dictionaries
75
- #
76
- # @return [Sketchup::AttributeDictionaries, nil] the AttributeDictionaries
77
- # object associated with the entity, or nil if there are
78
- # no attribute_dictionary objects associated with the
79
- # model. Care must be taken if nil is returned, for
80
- # example: invoking attribute_dictionaries.length will
81
- # throw a NoMethodError exception, not return 0.
82
- #
83
- # @version SketchUp 6.0
84
- def attribute_dictionaries
85
- end
86
-
87
- # The attribute_dictionary method is used to retrieve an attribute dictionary
88
- # with a given name that is attached to an Entity.
89
- #
90
- # @example
91
- # depth = 100
92
- # width = 100
93
- # model = Sketchup.active_model
94
- # entities = model.active_entities
95
- # pts = []
96
- # pts[0] = [0, 0, 0]
97
- # pts[1] = [width, 0, 0]
98
- # pts[2] = [width, depth, 0]
99
- # pts[3] = [0, depth, 0]
100
- #
101
- # # Add the face to the entities in the model
102
- # face = entities.add_face pts
103
- #
104
- # # I just happen to know that the second and third entities in the
105
- # # entities objects are edges.
106
- # entity1 = entities[1]
107
- # status = entity1.set_attribute "testdictionary", "test", 115
108
- # attrdict = entity1.attribute_dictionary "testdictionary"
109
- #
110
- # @param [String] name
111
- # The name of the attribute dictionary.
112
- #
113
- # @param [Boolean] create
114
- # boolean, if set to true then the attribute
115
- # dictionary will be created if it does not exist.
116
- #
117
- # @return [Sketchup::AttributeDictionary, nil] - an AttributeDictionary object
118
- # if successful, or nil if there is no attribute dictionary
119
- #
120
- # @version SketchUp 6.0
121
- def attribute_dictionary(name, create = false)
122
- end
123
-
124
- # The {#delete_attribute} method is used to delete an attribute from an entity.
125
- #
126
- # If only the dictionary_name is given, then it deletes the entire
127
- # AttributeDictionary. Otherwise, {#delete_attribute} deletes the attribute with
128
- # the given key from the given dictionary.
129
- #
130
- # @bug Prior to SketchUp 2019.0 the return values was always +true+.
131
- #
132
- # @example
133
- # depth = 100
134
- # width = 100
135
- # model = Sketchup.active_model
136
- # entities = model.active_entities
137
- # pts = []
138
- # pts[0] = [0, 0, 0]
139
- # pts[1] = [width, 0, 0]
140
- # pts[2] = [width, depth, 0]
141
- # pts[3] = [0, depth, 0]
142
- # # Add the face to the entities in the model
143
- # face = entities.add_face pts
144
- #
145
- # # I just happen to know that the second and third entities in the
146
- # # entities objects are edges.
147
- # entity1 = entities[1]
148
- # status = entity1.set_attribute "testdictionary", "test", 115
149
- # status = entity1.delete_attribute "testdictionary"
150
- #
151
- # @note In SketchUp 2018, special attribute dictionaries have been added.
152
- # The name of these dictionaries are "SU_InstanceSet" and "SU_DefinitionSet".
153
- # The dictionaries cannot be deleted via ruby and an ArgumentError will be
154
- # raised. The key/value pairs in the dictionary can be deleted safely.
155
- #
156
- # @overload delete_attribute(dictionary_name)
157
- #
158
- # @param dictionary_name [String] The name of an attribute dictionary.
159
- # @return [Boolean]
160
- #
161
- # @overload delete_attribute(dictionary_name, key)
162
- #
163
- # @param dictionary_name [String] The name of an attribute dictionary.
164
- # @param key [String] An attribute key.
165
- # @return [Boolean]
166
- #
167
- # @version SketchUp 6.0
168
- def delete_attribute(*args)
169
- end
170
-
171
- # The deleted? method is used to determine if your entity is still valid (not
172
- # deleted by another script, for example.)
173
- #
174
- # @example
175
- # depth = 100
176
- # width = 100
177
- # model = Sketchup.active_model
178
- # entities = model.active_entities
179
- # pts = []
180
- # pts[0] = [0, 0, 0]
181
- # pts[1] = [width, 0, 0]
182
- # pts[2] = [width, depth, 0]
183
- # pts[3] = [0, depth, 0]
184
- #
185
- # # Add the face to the entities in the model
186
- # face = entities.add_face pts
187
- # entity1 = entities[1]
188
- # status = entity1.deleted?
189
- #
190
- # @return [Boolean]
191
- #
192
- # @version SketchUp 6.0
193
- def deleted?
194
- end
195
-
196
- # The entityID method is used to retrieve a unique ID assigned to an entity.
197
- #
198
- # The entityID is not persistent between sessions.
199
- #
200
- # @example
201
- # depth = 100
202
- # width = 100
203
- # model = Sketchup.active_model
204
- # entities = model.active_entities
205
- # pts = []
206
- # pts[0] = [0, 0, 0]
207
- # pts[1] = [width, 0, 0]
208
- # pts[2] = [width, depth, 0]
209
- # pts[3] = [0, depth, 0]
210
- #
211
- # # Add the face to the entities in the model
212
- # face = entities.add_face pts
213
- # entity1 = entities[1]
214
- # id = entity1.entityID
215
- #
216
- # @return [Integer] the id for the Entity object
217
- #
218
- # @version SketchUp 6.0
219
- def entityID
220
- end
221
-
222
- # The {#get_attribute} method is used to retrieve the value of an attribute in
223
- # the entity's attribute dictionary.
224
- #
225
- # If the third parameter, +default_value+, is not passed and there is no
226
- # attribute that matches the given name, it returns +nil+.
227
- #
228
- # If +default_value+ is provided and there is no matching attribute it returns
229
- # the given value. It does not create an attribute with that name though.
230
- #
231
- # @example
232
- # # Add an entity to the model:
233
- # model = Sketchup.active_model
234
- # entities = model.active_entities
235
- # edge = entities.add_line([0, 0, 0], [9, 9, 9])
236
- #
237
- # # Read an attribute value from the edge. In this case this will return the
238
- # # default value provided; 42.
239
- # value = edge.get_attribute("MyExtension", "MyProperty", 42)
240
- #
241
- # @param [String] dict_name
242
- # The name of an attribute dictionary.
243
- #
244
- # @param [String] key
245
- # An attribute key.
246
- #
247
- # @param [Object] default_value
248
- # A default value to return if no attribute is found.
249
- #
250
- # @return [Object] the retrieved value
251
- #
252
- # @version SketchUp 6.0
253
- def get_attribute(dict_name, key, default_value = nil)
254
- end
255
-
256
- # The to_s method is used to retrieve the string representation of the entity.
257
- #
258
- # @example
259
- # depth = 100
260
- # width = 100
261
- # model = Sketchup.active_model
262
- # entities = model.active_entities
263
- # pts = []
264
- # pts[0] = [0, 0, 0]
265
- # pts[1] = [width, 0, 0]
266
- # pts[2] = [width, depth, 0]
267
- # pts[3] = [0, depth, 0]
268
- #
269
- # # Add the face to the entities in the model
270
- # face = entities.add_face pts
271
- #
272
- # # I just happen to know that the second and third entities in the
273
- # # entities objects are edges.
274
- # entity1 = entities[1]
275
- # st = entity1.to_s
276
- #
277
- # @return [String] the string representation of the entity if
278
- # successful
279
- #
280
- # @version SketchUp 6.0
281
- def inspect
282
- end
283
-
284
- # The model method is used to retrieve the model for the entity.
285
- #
286
- # @example
287
- # depth = 100
288
- # width = 100
289
- # model = Sketchup.active_model
290
- # entities = model.active_entities
291
- # pts = []
292
- # pts[0] = [0, 0, 0]
293
- # pts[1] = [width, 0, 0]
294
- # pts[2] = [width, depth, 0]
295
- # pts[3] = [0, depth, 0]
296
- #
297
- # # Add the face to the entities in the model
298
- # face = entities.add_face pts
299
- #
300
- # # I just happen to know that the second and third entities in the
301
- # # entities objects are edges.
302
- # entity1 = entities[1]
303
- # m = entity1.model
304
- #
305
- # @return [Sketchup::Model] the model that contains the Entity object
306
- #
307
- # @version SketchUp 6.0
308
- def model
309
- end
310
-
311
- # The parent method is used to retrieve the parent of the entity.
312
- #
313
- # The parent will be a ComponentDefinition, a Group, or a Model, whatever
314
- # the entity is contained within.
315
- #
316
- # @example
317
- # depth = 100
318
- # width = 100
319
- # model = Sketchup.active_model
320
- # entities = model.active_entities
321
- # pts = []
322
- # pts[0] = [0, 0, 0]
323
- # pts[1] = [width, 0, 0]
324
- # pts[2] = [width, depth, 0]
325
- # pts[3] = [0, depth, 0]
326
- #
327
- # # Add the face to the entities in the model
328
- # face = entities.add_face pts
329
- #
330
- # # I just happen to know that the second and third entities in the
331
- # # entities objects are edges.
332
- # entity1 = entities[1]
333
- # parent = entity1.parent
334
- #
335
- # @return [Sketchup::ComponentDefinition, Sketchup::Model] a Entity object
336
- # representing the parent of this entity
337
- #
338
- # @version SketchUp 6.0
339
- def parent
340
- end
341
-
342
- # The {#persistent_id} method is used to retrieve a unique persistent id
343
- # assigned to an entity.
344
- #
345
- # The persistent id persistent between sessions.
346
- #
347
- # [SketchUp 2020.1]
348
- # - {Sketchup::ComponentDefinition}
349
- # - {Sketchup::Material}
350
- # - {Sketchup::Style}
351
- # [SketchUp 2020.0]
352
- # - {Sketchup::Layer}
353
- # - {Sketchup::LineStyle}
354
- # [SketchUp 2018]
355
- # - {Sketchup::Page}
356
- # [SketchUp 2017]
357
- # - {Sketchup::ComponentInstance}
358
- # - {Sketchup::ConstructionLine}
359
- # - {Sketchup::ConstructionPoint}
360
- # - {Sketchup::Curve}
361
- # - {Sketchup::Dimension}
362
- # - {Sketchup::Edge}
363
- # - {Sketchup::Face}
364
- # - {Sketchup::Group}
365
- # - {Sketchup::Image}
366
- # - {Sketchup::SectionPlane}
367
- # - {Sketchup::Text}
368
- # - {Sketchup::Vertex}
369
- # - Polyline3d entities exposed only as {Sketchup::Drawingelement} Use
370
- # {#typename} to determine if a {Sketchup::Drawingelement} is
371
- # a +"Polyline3d"+.
372
- #
373
- # @example
374
- # model = Sketchup.active_model
375
- # entities = model.active_entities
376
- # pts = [
377
- # Geom::Point3d.new(0, 0, 0),
378
- # Geom::Point3d.new(9, 0, 0),
379
- # Geom::Point3d.new(9, 9, 0),
380
- # Geom::Point3d.new(0, 9, 0),
381
- # ]
382
- #
383
- # # Add the face to the entities in the model
384
- # group = entities.add_group
385
- # face = group.entities.add_face(pts)
386
- # pid = face.persistent_id
387
- # # Exploding the group will preserve the pid.
388
- # pid == face.persistent_id # Should return true
389
- #
390
- # @note Only a subset of entity types support PIDs. Refer to the table
391
- # below for which and when support was added. In general it is entities that
392
- # you can iterate over in a {Sketchup::Entities} collection.
393
- #
394
- # @return [Integer] the id for the {Sketchup::Entity} object
395
- #
396
- # @version SketchUp 2017
397
- def persistent_id
398
- end
399
-
400
- # The remove_observer method is used to remove an observer from the current
401
- # object.
402
- #
403
- # @example
404
- # entity = Sketchup.active_model.entities[0]
405
- # if entity.valid?
406
- # status = entity.remove_observer observer
407
- # end
408
- #
409
- # @param [Object] observer
410
- # An observer.
411
- #
412
- # @return [Boolean] true if successful, false if unsuccessful.
413
- #
414
- # @version SketchUp 6.0
415
- def remove_observer(observer)
416
- end
417
-
418
- # The set attribute is used to set the value of an attribute in an attribute
419
- # dictionary with the given name.
420
- #
421
- # This method will create a new AttributeDictionary if none exists.
422
- #
423
- # Note, a bug prior to SketchUp 2015 would corrupt the model if the key is
424
- # an empty string. This also includes values that will evaluate to empty
425
- # strings, such as nil.
426
- #
427
- # @example
428
- # depth = 100
429
- # width = 100
430
- # model = Sketchup.active_model
431
- # entities = model.active_entities
432
- # pts = []
433
- # pts[0] = [0, 0, 0]
434
- # pts[1] = [width, 0, 0]
435
- # pts[2] = [width, depth, 0]
436
- # pts[3] = [0, depth, 0]
437
- #
438
- # # Add the face to the entities in the model
439
- # face = entities.add_face pts
440
- #
441
- # # I just happen to know that the second and third entities in the
442
- # # entities objects are edges.
443
- # entity1 = entities[1]
444
- # status = entity1.set_attribute "testdictionary", "test", 115
445
- #
446
- # @param [String] dict_name
447
- # The name of an attribute dictionary.
448
- #
449
- # @param [String] key
450
- # An attribute key.
451
- #
452
- # @param [Object] value
453
- # The value for the attribute.
454
- #
455
- # @return [Object] the newly set value if successful
456
- #
457
- # @version SketchUp 6.0
458
- def set_attribute(dict_name, key, value)
459
- end
460
-
461
- # The to_s method is used to retrieve the string representation of the entity.
462
- #
463
- # @example
464
- # depth = 100
465
- # width = 100
466
- # model = Sketchup.active_model
467
- # entities = model.active_entities
468
- # pts = []
469
- # pts[0] = [0, 0, 0]
470
- # pts[1] = [width, 0, 0]
471
- # pts[2] = [width, depth, 0]
472
- # pts[3] = [0, depth, 0]
473
- #
474
- # # Add the face to the entities in the model
475
- # face = entities.add_face pts
476
- #
477
- # # I just happen to know that the second and third entities in the
478
- # # entities objects are edges.
479
- # entity1 = entities[1]
480
- # st = entity1.to_s
481
- #
482
- # @return [String] the string representation of the entity if
483
- # successful
484
- #
485
- # @version SketchUp 6.0
486
- def to_s
487
- end
488
-
489
- # The typename method retrieves the type of the entity, which will be a string
490
- # such as "Face", "Edge", or "Group".
491
- #
492
- # @example
493
- # depth = 100
494
- # width = 100
495
- # model = Sketchup.active_model
496
- # entities = model.active_entities
497
- # pts = []
498
- # pts[0] = [0, 0, 0]
499
- # pts[1] = [width, 0, 0]
500
- # pts[2] = [width, depth, 0]
501
- # pts[3] = [0, depth, 0]
502
- #
503
- # # Add the face to the entities in the model
504
- # face = entities.add_face pts
505
- #
506
- # # I just happen to know that the second and third entities in the
507
- # # entities objects are edges.
508
- # entity1 = entities[1]
509
- # type = entity1.typename
510
- #
511
- # @return [String] the type of the entity
512
- #
513
- # @version SketchUp 6.0
514
- def typename
515
- end
516
-
517
- # The valid? method is used to determine if your entity is still valid (not
518
- # deleted by another script, for example.)
519
- #
520
- # This method is functionally identical to the deleted? method.
521
- #
522
- # @example
523
- # depth = 100
524
- # width = 100
525
- # model = Sketchup.active_model
526
- # entities = model.active_entities
527
- # pts = []
528
- # pts[0] = [0, 0, 0]
529
- # pts[1] = [width, 0, 0]
530
- # pts[2] = [width, depth, 0]
531
- # pts[3] = [0, depth, 0]
532
- #
533
- # # Add the face to the entities in the model
534
- # face = entities.add_face pts
535
- # entity1 = entities[1]
536
- # status = entity1.valid?
537
- #
538
- # @return [Boolean]
539
- #
540
- # @version SketchUp 6.0
541
- def valid?
542
- end
543
-
544
- end
1
+ # Copyright:: Copyright 2020 Trimble Inc.
2
+ # License:: The MIT License (MIT)
3
+
4
+ # This is the base class for all SketchUp entities. Entities are basically
5
+ # anything that can be contained in a model, including Drawingelements
6
+ # such as Edges, SectionPlanes, Groups, etc. and entities that relate to
7
+ # those Drawingelements, such as Loops, Layers, etc.
8
+ #
9
+ # Keep in mind that the methods below are available on all subclasses.
10
+ # For example, an Edge's parent class is Drawingelement, and a
11
+ # Drawingelement's parent class is Entity. Therefore an Edge has all of the
12
+ # methods defined in Drawingelement and Entity.
13
+ #
14
+ # The Object.is_a? method is the common way of determining what sort of Entity
15
+ # you're dealing with.
16
+ #
17
+ # @example
18
+ # # Count how many faces are in the current selection.
19
+ # selection = Sketchup.active_model.selection
20
+ # face_count = 0
21
+ #
22
+ # # Look at all of the entities in the selection.
23
+ # selection.each { |entity|
24
+ # if entity.is_a? Sketchup::Face
25
+ # face_count = face_count + 1
26
+ # end
27
+ # }
28
+ #
29
+ # UI.messagebox("There are " + face_count.to_s + " faces selected.")
30
+ #
31
+ # @version SketchUp 6.0
32
+ class Sketchup::Entity
33
+
34
+ # Instance Methods
35
+
36
+ # The add_observer method is used to add an observer to the current object.
37
+ #
38
+ # @example
39
+ # entity = Sketchup.active_model.entities[0]
40
+ # if entity.valid?
41
+ # status = entity.add_observer observer
42
+ # end
43
+ #
44
+ # @param [Object] observer
45
+ # An observer.
46
+ #
47
+ # @return [Boolean] true if successful, false if unsuccessful.
48
+ #
49
+ # @version SketchUp 6.0
50
+ def add_observer(observer)
51
+ end
52
+
53
+ # The attribute_dictionaries method is used to retrieve the
54
+ # AttributeDictionaries collection attached to the entity.
55
+ #
56
+ # @example
57
+ # depth = 100
58
+ # width = 100
59
+ # model = Sketchup.active_model
60
+ # entities = model.active_entities
61
+ # pts = []
62
+ # pts[0] = [0, 0, 0]
63
+ # pts[1] = [width, 0, 0]
64
+ # pts[2] = [width, depth, 0]
65
+ # pts[3] = [0, depth, 0]
66
+ #
67
+ # # Add the face to the entities in the model
68
+ # face = entities.add_face pts
69
+ #
70
+ # # I just happen to know that the second and third entities in the
71
+ # # entities objects are edges.
72
+ # entity1 = entities[1]
73
+ # status = entity1.set_attribute "testdictionary", "test", 115
74
+ # attrdicts = entity1.attribute_dictionaries
75
+ #
76
+ # @return [Sketchup::AttributeDictionaries, nil] the AttributeDictionaries
77
+ # object associated with the entity, or nil if there are
78
+ # no attribute_dictionary objects associated with the
79
+ # model. Care must be taken if nil is returned, for
80
+ # example: invoking attribute_dictionaries.length will
81
+ # throw a NoMethodError exception, not return 0.
82
+ #
83
+ # @version SketchUp 6.0
84
+ def attribute_dictionaries
85
+ end
86
+
87
+ # The attribute_dictionary method is used to retrieve an attribute dictionary
88
+ # with a given name that is attached to an Entity.
89
+ #
90
+ # @example
91
+ # depth = 100
92
+ # width = 100
93
+ # model = Sketchup.active_model
94
+ # entities = model.active_entities
95
+ # pts = []
96
+ # pts[0] = [0, 0, 0]
97
+ # pts[1] = [width, 0, 0]
98
+ # pts[2] = [width, depth, 0]
99
+ # pts[3] = [0, depth, 0]
100
+ #
101
+ # # Add the face to the entities in the model
102
+ # face = entities.add_face pts
103
+ #
104
+ # # I just happen to know that the second and third entities in the
105
+ # # entities objects are edges.
106
+ # entity1 = entities[1]
107
+ # status = entity1.set_attribute "testdictionary", "test", 115
108
+ # attrdict = entity1.attribute_dictionary "testdictionary"
109
+ #
110
+ # @param [String] name
111
+ # The name of the attribute dictionary.
112
+ #
113
+ # @param [Boolean] create
114
+ # boolean, if set to true then the attribute
115
+ # dictionary will be created if it does not exist.
116
+ #
117
+ # @return [Sketchup::AttributeDictionary, nil] - an AttributeDictionary object
118
+ # if successful, or nil if there is no attribute dictionary
119
+ #
120
+ # @version SketchUp 6.0
121
+ def attribute_dictionary(name, create = false)
122
+ end
123
+
124
+ # The {#delete_attribute} method is used to delete an attribute from an entity.
125
+ #
126
+ # If only the dictionary_name is given, then it deletes the entire
127
+ # AttributeDictionary. Otherwise, {#delete_attribute} deletes the attribute with
128
+ # the given key from the given dictionary.
129
+ #
130
+ # @bug Prior to SketchUp 2019.0 the return values was always +true+.
131
+ #
132
+ # @example
133
+ # depth = 100
134
+ # width = 100
135
+ # model = Sketchup.active_model
136
+ # entities = model.active_entities
137
+ # pts = []
138
+ # pts[0] = [0, 0, 0]
139
+ # pts[1] = [width, 0, 0]
140
+ # pts[2] = [width, depth, 0]
141
+ # pts[3] = [0, depth, 0]
142
+ # # Add the face to the entities in the model
143
+ # face = entities.add_face pts
144
+ #
145
+ # # I just happen to know that the second and third entities in the
146
+ # # entities objects are edges.
147
+ # entity1 = entities[1]
148
+ # status = entity1.set_attribute "testdictionary", "test", 115
149
+ # status = entity1.delete_attribute "testdictionary"
150
+ #
151
+ # @note In SketchUp 2018, special attribute dictionaries have been added.
152
+ # The name of these dictionaries are "SU_InstanceSet" and "SU_DefinitionSet".
153
+ # The dictionaries cannot be deleted via ruby and an ArgumentError will be
154
+ # raised. The key/value pairs in the dictionary can be deleted safely.
155
+ #
156
+ # @overload delete_attribute(dictionary_name)
157
+ #
158
+ # @param dictionary_name [String] The name of an attribute dictionary.
159
+ # @return [Boolean]
160
+ #
161
+ # @overload delete_attribute(dictionary_name, key)
162
+ #
163
+ # @param dictionary_name [String] The name of an attribute dictionary.
164
+ # @param key [String] An attribute key.
165
+ # @return [Boolean]
166
+ #
167
+ # @version SketchUp 6.0
168
+ def delete_attribute(*args)
169
+ end
170
+
171
+ # The deleted? method is used to determine if your entity is still valid (not
172
+ # deleted by another script, for example.)
173
+ #
174
+ # @example
175
+ # depth = 100
176
+ # width = 100
177
+ # model = Sketchup.active_model
178
+ # entities = model.active_entities
179
+ # pts = []
180
+ # pts[0] = [0, 0, 0]
181
+ # pts[1] = [width, 0, 0]
182
+ # pts[2] = [width, depth, 0]
183
+ # pts[3] = [0, depth, 0]
184
+ #
185
+ # # Add the face to the entities in the model
186
+ # face = entities.add_face pts
187
+ # entity1 = entities[1]
188
+ # status = entity1.deleted?
189
+ #
190
+ # @return [Boolean]
191
+ #
192
+ # @version SketchUp 6.0
193
+ def deleted?
194
+ end
195
+
196
+ # The entityID method is used to retrieve a unique ID assigned to an entity.
197
+ #
198
+ # The entityID is not persistent between sessions.
199
+ #
200
+ # @example
201
+ # depth = 100
202
+ # width = 100
203
+ # model = Sketchup.active_model
204
+ # entities = model.active_entities
205
+ # pts = []
206
+ # pts[0] = [0, 0, 0]
207
+ # pts[1] = [width, 0, 0]
208
+ # pts[2] = [width, depth, 0]
209
+ # pts[3] = [0, depth, 0]
210
+ #
211
+ # # Add the face to the entities in the model
212
+ # face = entities.add_face pts
213
+ # entity1 = entities[1]
214
+ # id = entity1.entityID
215
+ #
216
+ # @return [Integer] the id for the Entity object
217
+ #
218
+ # @version SketchUp 6.0
219
+ def entityID
220
+ end
221
+
222
+ # The {#get_attribute} method is used to retrieve the value of an attribute in
223
+ # the entity's attribute dictionary.
224
+ #
225
+ # If the third parameter, +default_value+, is not passed and there is no
226
+ # attribute that matches the given name, it returns +nil+.
227
+ #
228
+ # If +default_value+ is provided and there is no matching attribute it returns
229
+ # the given value. It does not create an attribute with that name though.
230
+ #
231
+ # @example
232
+ # # Add an entity to the model:
233
+ # model = Sketchup.active_model
234
+ # entities = model.active_entities
235
+ # edge = entities.add_line([0, 0, 0], [9, 9, 9])
236
+ #
237
+ # # Read an attribute value from the edge. In this case this will return the
238
+ # # default value provided; 42.
239
+ # value = edge.get_attribute("MyExtension", "MyProperty", 42)
240
+ #
241
+ # @param [String] dict_name
242
+ # The name of an attribute dictionary.
243
+ #
244
+ # @param [String] key
245
+ # An attribute key.
246
+ #
247
+ # @param [Object] default_value
248
+ # A default value to return if no attribute is found.
249
+ #
250
+ # @return [Object] the retrieved value
251
+ #
252
+ # @version SketchUp 6.0
253
+ def get_attribute(dict_name, key, default_value = nil)
254
+ end
255
+
256
+ # The to_s method is used to retrieve the string representation of the entity.
257
+ #
258
+ # @example
259
+ # depth = 100
260
+ # width = 100
261
+ # model = Sketchup.active_model
262
+ # entities = model.active_entities
263
+ # pts = []
264
+ # pts[0] = [0, 0, 0]
265
+ # pts[1] = [width, 0, 0]
266
+ # pts[2] = [width, depth, 0]
267
+ # pts[3] = [0, depth, 0]
268
+ #
269
+ # # Add the face to the entities in the model
270
+ # face = entities.add_face pts
271
+ #
272
+ # # I just happen to know that the second and third entities in the
273
+ # # entities objects are edges.
274
+ # entity1 = entities[1]
275
+ # st = entity1.to_s
276
+ #
277
+ # @return [String] the string representation of the entity if
278
+ # successful
279
+ #
280
+ # @version SketchUp 6.0
281
+ def inspect
282
+ end
283
+
284
+ # The model method is used to retrieve the model for the entity.
285
+ #
286
+ # @example
287
+ # depth = 100
288
+ # width = 100
289
+ # model = Sketchup.active_model
290
+ # entities = model.active_entities
291
+ # pts = []
292
+ # pts[0] = [0, 0, 0]
293
+ # pts[1] = [width, 0, 0]
294
+ # pts[2] = [width, depth, 0]
295
+ # pts[3] = [0, depth, 0]
296
+ #
297
+ # # Add the face to the entities in the model
298
+ # face = entities.add_face pts
299
+ #
300
+ # # I just happen to know that the second and third entities in the
301
+ # # entities objects are edges.
302
+ # entity1 = entities[1]
303
+ # m = entity1.model
304
+ #
305
+ # @return [Sketchup::Model] the model that contains the Entity object
306
+ #
307
+ # @version SketchUp 6.0
308
+ def model
309
+ end
310
+
311
+ # The parent method is used to retrieve the parent of the entity.
312
+ #
313
+ # The parent will be a ComponentDefinition, a Group, or a Model, whatever
314
+ # the entity is contained within.
315
+ #
316
+ # @example
317
+ # depth = 100
318
+ # width = 100
319
+ # model = Sketchup.active_model
320
+ # entities = model.active_entities
321
+ # pts = []
322
+ # pts[0] = [0, 0, 0]
323
+ # pts[1] = [width, 0, 0]
324
+ # pts[2] = [width, depth, 0]
325
+ # pts[3] = [0, depth, 0]
326
+ #
327
+ # # Add the face to the entities in the model
328
+ # face = entities.add_face pts
329
+ #
330
+ # # I just happen to know that the second and third entities in the
331
+ # # entities objects are edges.
332
+ # entity1 = entities[1]
333
+ # parent = entity1.parent
334
+ #
335
+ # @return [Sketchup::ComponentDefinition, Sketchup::Model] a Entity object
336
+ # representing the parent of this entity
337
+ #
338
+ # @version SketchUp 6.0
339
+ def parent
340
+ end
341
+
342
+ # The {#persistent_id} method is used to retrieve a unique persistent id
343
+ # assigned to an entity.
344
+ #
345
+ # The persistent id persistent between sessions.
346
+ #
347
+ # [SketchUp 2020.1]
348
+ # - {Sketchup::ComponentDefinition}
349
+ # - {Sketchup::Material}
350
+ # - {Sketchup::Style}
351
+ # [SketchUp 2020.0]
352
+ # - {Sketchup::Layer}
353
+ # - {Sketchup::LineStyle}
354
+ # [SketchUp 2018]
355
+ # - {Sketchup::Page}
356
+ # [SketchUp 2017]
357
+ # - {Sketchup::ComponentInstance}
358
+ # - {Sketchup::ConstructionLine}
359
+ # - {Sketchup::ConstructionPoint}
360
+ # - {Sketchup::Curve}
361
+ # - {Sketchup::Dimension}
362
+ # - {Sketchup::Edge}
363
+ # - {Sketchup::Face}
364
+ # - {Sketchup::Group}
365
+ # - {Sketchup::Image}
366
+ # - {Sketchup::SectionPlane}
367
+ # - {Sketchup::Text}
368
+ # - {Sketchup::Vertex}
369
+ # - Polyline3d entities exposed only as {Sketchup::Drawingelement} Use
370
+ # {#typename} to determine if a {Sketchup::Drawingelement} is
371
+ # a +"Polyline3d"+.
372
+ #
373
+ # @example
374
+ # model = Sketchup.active_model
375
+ # entities = model.active_entities
376
+ # pts = [
377
+ # Geom::Point3d.new(0, 0, 0),
378
+ # Geom::Point3d.new(9, 0, 0),
379
+ # Geom::Point3d.new(9, 9, 0),
380
+ # Geom::Point3d.new(0, 9, 0),
381
+ # ]
382
+ #
383
+ # # Add the face to the entities in the model
384
+ # group = entities.add_group
385
+ # face = group.entities.add_face(pts)
386
+ # pid = face.persistent_id
387
+ # # Exploding the group will preserve the pid.
388
+ # pid == face.persistent_id # Should return true
389
+ #
390
+ # @note Only a subset of entity types support PIDs. Refer to the table
391
+ # below for which and when support was added. In general it is entities that
392
+ # you can iterate over in a {Sketchup::Entities} collection.
393
+ #
394
+ # @return [Integer] the id for the {Sketchup::Entity} object
395
+ #
396
+ # @version SketchUp 2017
397
+ def persistent_id
398
+ end
399
+
400
+ # The remove_observer method is used to remove an observer from the current
401
+ # object.
402
+ #
403
+ # @example
404
+ # entity = Sketchup.active_model.entities[0]
405
+ # if entity.valid?
406
+ # status = entity.remove_observer observer
407
+ # end
408
+ #
409
+ # @param [Object] observer
410
+ # An observer.
411
+ #
412
+ # @return [Boolean] true if successful, false if unsuccessful.
413
+ #
414
+ # @version SketchUp 6.0
415
+ def remove_observer(observer)
416
+ end
417
+
418
+ # The set attribute is used to set the value of an attribute in an attribute
419
+ # dictionary with the given name.
420
+ #
421
+ # This method will create a new AttributeDictionary if none exists.
422
+ #
423
+ # Note, a bug prior to SketchUp 2015 would corrupt the model if the key is
424
+ # an empty string. This also includes values that will evaluate to empty
425
+ # strings, such as nil.
426
+ #
427
+ # @example
428
+ # depth = 100
429
+ # width = 100
430
+ # model = Sketchup.active_model
431
+ # entities = model.active_entities
432
+ # pts = []
433
+ # pts[0] = [0, 0, 0]
434
+ # pts[1] = [width, 0, 0]
435
+ # pts[2] = [width, depth, 0]
436
+ # pts[3] = [0, depth, 0]
437
+ #
438
+ # # Add the face to the entities in the model
439
+ # face = entities.add_face pts
440
+ #
441
+ # # I just happen to know that the second and third entities in the
442
+ # # entities objects are edges.
443
+ # entity1 = entities[1]
444
+ # status = entity1.set_attribute "testdictionary", "test", 115
445
+ #
446
+ # @param [String] dict_name
447
+ # The name of an attribute dictionary.
448
+ #
449
+ # @param [String] key
450
+ # An attribute key.
451
+ #
452
+ # @param [Object] value
453
+ # The value for the attribute.
454
+ #
455
+ # @return [Object] the newly set value if successful
456
+ #
457
+ # @version SketchUp 6.0
458
+ def set_attribute(dict_name, key, value)
459
+ end
460
+
461
+ # The to_s method is used to retrieve the string representation of the entity.
462
+ #
463
+ # @example
464
+ # depth = 100
465
+ # width = 100
466
+ # model = Sketchup.active_model
467
+ # entities = model.active_entities
468
+ # pts = []
469
+ # pts[0] = [0, 0, 0]
470
+ # pts[1] = [width, 0, 0]
471
+ # pts[2] = [width, depth, 0]
472
+ # pts[3] = [0, depth, 0]
473
+ #
474
+ # # Add the face to the entities in the model
475
+ # face = entities.add_face pts
476
+ #
477
+ # # I just happen to know that the second and third entities in the
478
+ # # entities objects are edges.
479
+ # entity1 = entities[1]
480
+ # st = entity1.to_s
481
+ #
482
+ # @return [String] the string representation of the entity if
483
+ # successful
484
+ #
485
+ # @version SketchUp 6.0
486
+ def to_s
487
+ end
488
+
489
+ # The typename method retrieves the type of the entity, which will be a string
490
+ # such as "Face", "Edge", or "Group".
491
+ #
492
+ # @example
493
+ # depth = 100
494
+ # width = 100
495
+ # model = Sketchup.active_model
496
+ # entities = model.active_entities
497
+ # pts = []
498
+ # pts[0] = [0, 0, 0]
499
+ # pts[1] = [width, 0, 0]
500
+ # pts[2] = [width, depth, 0]
501
+ # pts[3] = [0, depth, 0]
502
+ #
503
+ # # Add the face to the entities in the model
504
+ # face = entities.add_face pts
505
+ #
506
+ # # I just happen to know that the second and third entities in the
507
+ # # entities objects are edges.
508
+ # entity1 = entities[1]
509
+ # type = entity1.typename
510
+ #
511
+ # @return [String] the type of the entity
512
+ #
513
+ # @version SketchUp 6.0
514
+ def typename
515
+ end
516
+
517
+ # The valid? method is used to determine if your entity is still valid (not
518
+ # deleted by another script, for example.)
519
+ #
520
+ # This method is functionally identical to the deleted? method.
521
+ #
522
+ # @example
523
+ # depth = 100
524
+ # width = 100
525
+ # model = Sketchup.active_model
526
+ # entities = model.active_entities
527
+ # pts = []
528
+ # pts[0] = [0, 0, 0]
529
+ # pts[1] = [width, 0, 0]
530
+ # pts[2] = [width, depth, 0]
531
+ # pts[3] = [0, depth, 0]
532
+ #
533
+ # # Add the face to the entities in the model
534
+ # face = entities.add_face pts
535
+ # entity1 = entities[1]
536
+ # status = entity1.valid?
537
+ #
538
+ # @return [Boolean]
539
+ #
540
+ # @version SketchUp 6.0
541
+ def valid?
542
+ end
543
+
544
+ end