Class: Sketchup::ComponentInstance
- Inherits:
-
Drawingelement
- Object
- Entity
- Drawingelement
- Sketchup::ComponentInstance
- Defined in:
- lib/sketchup-api-stubs/stubs/Sketchup/ComponentInstance.rb
Overview
The ComponentInstance class is used to represent component instances of a component definition or components that have been dragged from the Component Browser and placed (thus, instanced) within the Model. Therefore, the ComponentInstance class contains a reference to a corresponding ComponentDefinition object and a Transformation object (which contains the location of the component in the Drawing Window).
Starting from SketchUp 2018+, the ComponentInstance class contains default attributes when created or imported. The attributes are: “Owner”, “Status”. See the Help article for more information. The dictionary cannot be deleted via ruby and an @raise ArgumentError will be raised. The key/value pairs in the dictionary can be deleted safely.
Instance Method Summary collapse
-
#add_observer(observer) ⇒ Boolean
The add_observer method is used to add an observer to the current object.
-
#definition ⇒ Sketchup::ComponentDefinition
The definition method is used to retrieve the component definition for this component instance.
-
#definition=(definition) ⇒ Sketchup::ComponentDefinition
The definition= method is used to set the component definition for this component.
-
#equals?(instance) ⇒ Boolean
The equals? method is used to determine if a component instance is geometrically equivalent to another instance.
-
#explode ⇒ Array<Sketchup:Entity>
The explode method is used to explode the component instance into separate entities.
-
#glued_to ⇒ Sketchup::Face?
The glued_to method is used to retrieve the entity that this instance is glued to.
-
#glued_to=(face) ⇒ Sketchup::Face?
The glued_to= method glues this instance to a face.
-
#guid ⇒ String
The guid method is used to get the base 64 encoded unique id for this SketchUp object.
-
#intersect(instance) ⇒ Sketchup::Group?
The intersect method is used to compute the boolean intersection of two instances representing manifold solid volumes (this - arg).
-
#locked=(lock) ⇒ Boolean
The locked= method is used to lock a component instance.
-
#locked? ⇒ Boolean
The locked? method is used to determine if a component instance is locked.
-
#make_unique ⇒ Sketchup::ComponentInstance
The #make_unique method is used to create a component definition for this instance that is not used by any other instances.
-
#manifold? ⇒ Boolean
The manifold? method is used to determine if an instance is manifold.
-
#move!(transform) ⇒ Boolean
The move! method is the same as the transform! method, except that it does not record the move as an undo operation.
-
#name ⇒ String
The name method is used to get the name of this instance.
-
#name=(name) ⇒ Sketchup::ComponentInstance
The name method is used to set the name of this instance.
-
#outer_shell(instance) ⇒ Sketchup::Group?
The outer_shell method is used to compute the outer shell of the two instances representing manifold solid volumes (this || arg).
-
#remove_observer(observer) ⇒ Boolean
The remove_observer method is used to remove an observer from the current object.
-
#show_differences(instance, verbose) ⇒ Boolean
The show_differences method is used to determine if a component instance is geometrically equivalent to another instance and in addition move the non- matching and matching geometry to new layers.
-
#split(instance) ⇒ Array(Sketchup::Group, Sketchup::Group, Sketchup::Group)
The split method is used to compute the boolean split (map overlay)of the two instances representing manifold solid volumes (this - arg).
-
#subtract(instance) ⇒ Sketchup::Group?
The subtract method is used to compute the boolean difference of the two instances representing manifold solid volumes (this - arg).
-
#transform!(transform) ⇒ Boolean
Apply a Geom::Transformation to a component instance.
-
#transformation ⇒ Geom::Transformation
The transformation method is used to retrieve the transformation of this instance.
-
#transformation=(transformation) ⇒ Sketchup::ComponentInstance
The transformation= method is used to set the transformation on this instance.
-
#trim(instance) ⇒ Sketchup::Group?
The trim method is used to compute the (non-destructive) boolean difference of the two instances representing manifold solid volumes (this - arg).
-
#union(instance) ⇒ Sketchup::Group?
The union method is used to compute the boolean union of the two instances representing manifold solid volumes (this | arg).
-
#volume ⇒ Float
The volume method is used to compute the volume of this instance if and only if this instance is manifold.
Methods inherited from Drawingelement
#bounds, #casts_shadows=, #casts_shadows?, #erase!, #hidden=, #hidden?, #layer, #layer=, #material, #material=, #receives_shadows=, #receives_shadows?, #visible=, #visible?
Methods inherited from Entity
#attribute_dictionaries, #attribute_dictionary, #delete_attribute, #deleted?, #entityID, #get_attribute, #inspect, #model, #parent, #persistent_id, #set_attribute, #to_s, #typename, #valid?
Instance Method Details
#add_observer(observer) ⇒ Boolean
The add_observer method is used to add an observer to the current object.
38 39 |
# File 'lib/sketchup-api-stubs/stubs/Sketchup/ComponentInstance.rb', line 38 def add_observer(observer) end |
#definition ⇒ Sketchup::ComponentDefinition
The definition method is used to retrieve the component definition for this component instance.
58 59 |
# File 'lib/sketchup-api-stubs/stubs/Sketchup/ComponentInstance.rb', line 58 def definition end |
#definition=(definition) ⇒ Sketchup::ComponentDefinition
The definition= method is used to set the component definition for this component.
This method causes the instance to use a different definition, but it will use the same transformation to position it in the Model.
86 87 |
# File 'lib/sketchup-api-stubs/stubs/Sketchup/ComponentInstance.rb', line 86 def definition=(definition) end |
#equals?(instance) ⇒ Boolean
The equals? method is used to determine if a component instance is geometrically equivalent to another instance.
104 105 |
# File 'lib/sketchup-api-stubs/stubs/Sketchup/ComponentInstance.rb', line 104 def equals?(instance) end |
#explode ⇒ Array<Sketchup:Entity>
The explode method is used to explode the component instance into separate entities.
123 124 |
# File 'lib/sketchup-api-stubs/stubs/Sketchup/ComponentInstance.rb', line 123 def explode end |
#glued_to ⇒ Sketchup::Face?
The glued_to method is used to retrieve the entity that this instance is glued to.
Returns nil if it is not glued to anything.
147 148 |
# File 'lib/sketchup-api-stubs/stubs/Sketchup/ComponentInstance.rb', line 147 def glued_to end |
#glued_to=(face) ⇒ Sketchup::Face?
The glued_to= method glues this instance to a face.
This method will raise an exception if the instance cannot be glued to the given face. Instances cannot be glued if the definition of the instance doesn’t support gluing or if the alignment is wrong.
192 193 |
# File 'lib/sketchup-api-stubs/stubs/Sketchup/ComponentInstance.rb', line 192 def glued_to=(face) end |
#guid ⇒ String
The guid method is used to get the base 64 encoded unique id for this SketchUp object.
208 209 |
# File 'lib/sketchup-api-stubs/stubs/Sketchup/ComponentInstance.rb', line 208 def guid end |
#intersect(instance) ⇒ Sketchup::Group?
The intersect method is used to compute the boolean intersection of two instances representing manifold solid volumes (this - arg). If the specified objects (this and arg) do not represent manifold volumes, this method fails.
229 230 |
# File 'lib/sketchup-api-stubs/stubs/Sketchup/ComponentInstance.rb', line 229 def intersect(instance) end |
#locked=(lock) ⇒ Boolean
The locked= method is used to lock a component instance.
247 248 |
# File 'lib/sketchup-api-stubs/stubs/Sketchup/ComponentInstance.rb', line 247 def locked=(lock) end |
#locked? ⇒ Boolean
The locked? method is used to determine if a component instance is locked.
262 263 |
# File 'lib/sketchup-api-stubs/stubs/Sketchup/ComponentInstance.rb', line 262 def locked? end |
#make_unique ⇒ Sketchup::ComponentInstance
The #make_unique method is used to create a component definition for this instance that is not used by any other instances.
285 286 |
# File 'lib/sketchup-api-stubs/stubs/Sketchup/ComponentInstance.rb', line 285 def make_unique end |
#manifold? ⇒ Boolean
The manifold? method is used to determine if an instance is manifold.
300 301 |
# File 'lib/sketchup-api-stubs/stubs/Sketchup/ComponentInstance.rb', line 300 def manifold? end |
#move!(transform) ⇒ Boolean
The move! method is the same as the transform! method, except that it does not record the move as an undo operation.
This method is useful for moving entities inside of an animation or page transition.
323 324 |
# File 'lib/sketchup-api-stubs/stubs/Sketchup/ComponentInstance.rb', line 323 def move!(transform) end |
#name ⇒ String
The name method is used to get the name of this instance.
338 339 |
# File 'lib/sketchup-api-stubs/stubs/Sketchup/ComponentInstance.rb', line 338 def name end |
#name=(name) ⇒ Sketchup::ComponentInstance
The name method is used to set the name of this instance.
356 357 |
# File 'lib/sketchup-api-stubs/stubs/Sketchup/ComponentInstance.rb', line 356 def name=(name) end |
#outer_shell(instance) ⇒ Sketchup::Group?
The outer_shell method is used to compute the outer shell of the two instances representing manifold solid volumes (this || arg). If the specified objects (this and arg) do not represent manifold volumes, this method fails.
377 378 |
# File 'lib/sketchup-api-stubs/stubs/Sketchup/ComponentInstance.rb', line 377 def outer_shell(instance) end |
#remove_observer(observer) ⇒ Boolean
The remove_observer method is used to remove an observer from the current object.
396 397 |
# File 'lib/sketchup-api-stubs/stubs/Sketchup/ComponentInstance.rb', line 396 def remove_observer(observer) end |
#show_differences(instance, verbose) ⇒ Boolean
The show_differences method is used to determine if a component instance is geometrically equivalent to another instance and in addition move the non- matching and matching geometry to new layers.
This method will move both instances to Layer0. Geometry that is the same in both components will be moved to a new layer named def_name + “_same”. Geometry that is not the same will be moved to a layer named def_name + “_diff”.
If verbose is true, a list of all the geometry that is different from one component to the other is displayed texturally in the Ruby Console.
428 429 |
# File 'lib/sketchup-api-stubs/stubs/Sketchup/ComponentInstance.rb', line 428 def show_differences(instance, verbose) end |
#split(instance) ⇒ Array(Sketchup::Group, Sketchup::Group, Sketchup::Group)
The split method is used to compute the boolean split (map overlay)of the two instances representing manifold solid volumes (this - arg). If the specified objects (this and arg) do not represent manifold volumes, this method fails.
453 454 |
# File 'lib/sketchup-api-stubs/stubs/Sketchup/ComponentInstance.rb', line 453 def split(instance) end |
#subtract(instance) ⇒ Sketchup::Group?
The subtract method is used to compute the boolean difference of the two instances representing manifold solid volumes (this - arg). If the specified objects (this and arg) do not represent manifold volumes, this method fails.
474 475 |
# File 'lib/sketchup-api-stubs/stubs/Sketchup/ComponentInstance.rb', line 474 def subtract(instance) end |
#transform!(transform) ⇒ Boolean
Apply a Geom::Transformation to a component instance.
493 494 |
# File 'lib/sketchup-api-stubs/stubs/Sketchup/ComponentInstance.rb', line 493 def transform!(transform) end |
#transformation ⇒ Geom::Transformation
The transformation method is used to retrieve the transformation of this instance.
509 510 |
# File 'lib/sketchup-api-stubs/stubs/Sketchup/ComponentInstance.rb', line 509 def transformation end |
#transformation=(transformation) ⇒ Sketchup::ComponentInstance
The transformation= method is used to set the transformation on this instance.
529 530 |
# File 'lib/sketchup-api-stubs/stubs/Sketchup/ComponentInstance.rb', line 529 def transformation=(transformation) end |
#trim(instance) ⇒ Sketchup::Group?
The trim method is used to compute the (non-destructive) boolean difference of the two instances representing manifold solid volumes (this - arg). If the specified objects (this and arg) do not represent manifold volumes, this method fails.
551 552 |
# File 'lib/sketchup-api-stubs/stubs/Sketchup/ComponentInstance.rb', line 551 def trim(instance) end |
#union(instance) ⇒ Sketchup::Group?
The union method is used to compute the boolean union of the two instances representing manifold solid volumes (this | arg). If the specified objects (this and arg) do not represent manifold volumes, this method fails.
572 573 |
# File 'lib/sketchup-api-stubs/stubs/Sketchup/ComponentInstance.rb', line 572 def union(instance) end |
#volume ⇒ Float
The volume method is used to compute the volume of this instance if and only if this instance is manifold.
590 591 |
# File 'lib/sketchup-api-stubs/stubs/Sketchup/ComponentInstance.rb', line 590 def volume end |