Class: Sketchup::ComponentInstance
- Inherits:
-
Drawingelement
- Object
- Entity
- Drawingelement
- Sketchup::ComponentInstance
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).
Instance Method Summary collapse
-
#add_observer(observer) ⇒ Object
The add_observer method is used to add an observer to the current object.
-
#definition ⇒ Object
The definition method is used to retrieve the component definition for this component instance.
-
#definition=(definition) ⇒ Object
The definition= method is used to set the component definition for this component.
-
#equals?(instance) ⇒ Object
The equals? method is used to determine if a component instance is geometrically equivalent to another instance.
-
#explode ⇒ Object
The explode method is used to explode the component instance into separate entities.
-
#glued_to ⇒ Object
The glued_to method is used to retrieve the entity that this instance is glued to.
-
#glued_to=(face) ⇒ Object
The glued_to= method glues this instance to a face.
-
#guid ⇒ Object
The guid method is used to get the base 64 encoded unique id for this SketchUp object.
-
#intersect(instance) ⇒ Object
The intersect method is used to compute the boolean intersection of two instances representing manifold solid volumes (this - arg).
-
#locked=(lock) ⇒ Object
The locked= method is used to lock a component instance.
-
#locked? ⇒ Object
The locked? method is used to determine if a component instance is locked.
-
#make_unique ⇒ Object
The make_unique method is used to create a component definition for this instance that is not used by any other instances.
-
#manifold? ⇒ Object
The manifold? method is used to determine if an instance is manifold.
-
#move!(transform) ⇒ Object
The move! method is the same as the transform! method, except that it does not record the move as an undo operation.
-
#name ⇒ Object
The name method is used to get the name of this instance.
-
#name=(name) ⇒ Object
The name method is used to set the name of this instance.
-
#outer_shell(instance) ⇒ Object
The outer_shell method is used to compute the outer shell of the two instances representing manifold solid volumes (this || arg).
-
#remove_observer(observer) ⇒ Object
The remove_observer method is used to remove an observer from the current object.
-
#show_differences(instance, verbose) ⇒ Object
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) ⇒ Object
The split method is used to compute the boolean split (map overlay)of the two instances representing manifold solid volumes (this - arg).
-
#subtract(instance) ⇒ Object
The subtract method is used to compute the boolean difference of the two instances representing manifold solid volumes (this - arg).
-
#transform!(transform) ⇒ Object
The transform! method is used to apply a transformation to a component instance.
-
#transformation ⇒ Object
The transformation method is used to retrieve the transformation of this instance.
-
#transformation=(transform) ⇒ Object
The transformation= method is used to set the transformation on this instance.
-
#trim(instance) ⇒ Object
The trim method is used to compute the (non-destructive) boolean difference of the two instances representing manifold solid volumes (this - arg).
-
#union(instance) ⇒ Object
The union method is used to compute the boolean union of the two instances representing manifold solid volumes (this | arg).
-
#volume ⇒ Object
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) ⇒ Object
The add_observer method is used to add an observer to the current object.
#definition ⇒ Object
The definition method is used to retrieve the component definition for this component instance.
#definition=(definition) ⇒ Object
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.
#equals?(instance) ⇒ Object
The equals? method is used to determine if a component instance is geometrically equivalent to another instance.
#explode ⇒ Object
The explode method is used to explode the component instance into separate entities.
#glued_to ⇒ Object
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.
#glued_to=(face) ⇒ Object
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.
#guid ⇒ Object
The guid method is used to get the base 64 encoded unique id for this SketchUp object.
#intersect(instance) ⇒ Object
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.
#locked=(lock) ⇒ Object
The locked= method is used to lock a component instance.
#locked? ⇒ Object
The locked? method is used to determine if a component instance is locked.
#make_unique ⇒ Object
The make_unique method is used to create a component definition for this instance that is not used by any other instances.
#manifold? ⇒ Object
The manifold? method is used to determine if an instance is manifold.
#move!(transform) ⇒ Object
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.
#name ⇒ Object
The name method is used to get the name of this instance.
#name=(name) ⇒ Object
The name method is used to set the name of this instance.
#outer_shell(instance) ⇒ Object
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.
#remove_observer(observer) ⇒ Object
The remove_observer method is used to remove an observer from the current object.
#show_differences(instance, verbose) ⇒ Object
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.
#split(instance) ⇒ Object
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.
#subtract(instance) ⇒ Object
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.
#transform!(transform) ⇒ Object
The transform! method is used to apply a transformation to a component instance.
#transformation ⇒ Object
The transformation method is used to retrieve the transformation of this instance.
#transformation=(transform) ⇒ Object
The transformation= method is used to set the transformation on this instance.
#trim(instance) ⇒ Object
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.
#union(instance) ⇒ Object
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.
#volume ⇒ Object
The volume method is used to compute the volume of this instance if and only if this instance is manifold.