Class: Sketchup::Behavior
Relationships | |
Super Chains via Extension / Inclusion / Inheritance | |
Class Chain:
self,
Entity
|
|
Instance Chain:
self,
Entity
|
|
Inherits: |
Sketchup::Entity
|
Overview
The Behavior class is used to control the “behavior” of components, which roughly correlates to the series of options that you see in the Components dialog under the “edit” tab, such as whether it casts shadows, glues to walls, etc.
A Behavior object is accessed from a ComponentDefinition
object, not created with a Behavior
.new call.
Instance Attribute Summary
-
#always_face_camera=(setting) ⇒ Object
rw
The always_face_camera= method is used to set the always_face_camera behavior for a component.
-
#always_face_camera? ⇒ Boolean
rw
The always_face_camera? method is used to retrieve the always_face_camera behavior for a component.
-
#cuts_opening=(setting) ⇒ Object
rw
The cuts_opening= method is used to set the cut opening behavior for a component.
-
#cuts_opening? ⇒ Boolean
rw
The cuts_opening? method is used to get the status of a component’s cut opening behavior.
-
#is2d=(is2d)
rw
The #is2d= method is used to set whether the component can glue to other entities or not.
-
#is2d? ⇒ Boolean
rw
The #is2d? method is used to get whether the component can glue to other entities or not.
-
#no_scale_mask=(scale_mask) ⇒ Object
rw
Sets an integer that is really a bit-by-bit description of which scale tool handles are hidden on a given component.
-
#no_scale_mask? ⇒ Boolean
rw
The no_scale_mask? method returns an integer that is a bit-by-bit description of which scale tool handles are hidden when the user selects this single component with the scale tool.
-
#shadows_face_sun=(status) ⇒ Object
rw
The shadows_face_sun= method is used to identify whether the component’s shadow will be cast from the component’s current position as though the component were facing the sun.
-
#shadows_face_sun? ⇒ Boolean
rw
The shadows_face_sun? method is used to determine whether the component’s shadow is being cast from the component’s current position (as though the component were facing the sun).
-
#snapto ⇒ Integer
rw
The #snapto method is used to see how a component can glue to other entities.
-
#snapto=(snapto)
rw
The #snapto= method is used to set how a component can glue to other entities.
Entity
- Inherited
Instance Method Summary
Entity
- Inherited
#add_observer | The add_observer method is used to add an observer to the current object. |
#attribute_dictionaries | The attribute_dictionaries method is used to retrieve the |
#attribute_dictionary | The attribute_dictionary method is used to retrieve an attribute dictionary with a given name that is attached to an |
#delete_attribute | The |
#entityID | The entityID method is used to retrieve a unique ID assigned to an entity. |
#get_attribute | The |
#inspect | The |
#model | The model method is used to retrieve the model for the entity. |
#parent | The parent method is used to retrieve the parent of the entity. |
#persistent_id | The |
#remove_observer | The remove_observer method is used to remove an observer from the current object. |
#set_attribute | The set attribute is used to set the value of an attribute in an attribute dictionary with the given name. |
#to_s | The |
#typename | The typename method retrieves the type of the entity, which will be a string such as “Face”, “Edge”, or “Group”. |
Instance Attribute Details
#always_face_camera=(setting) ⇒ Object
(rw)
The always_face_camera= method is used to set the always_face_camera behavior for a component.
If the always_face_camera behavior is true, a component will always try to orient itself so that the Y axis of the component is facing the camera.
#always_face_camera? ⇒ Boolean
(rw)
The always_face_camera? method is used to retrieve the always_face_camera behavior for a component.
If the always_face_camera behavior is true, then a component will always try to orient itself so that the -Y axis of the component is facing the camera.
#cuts_opening=(setting) ⇒ Object
(rw)
To enable cut opening, also set #is2d= to true.
The cuts_opening= method is used to set the cut opening behavior for a component.
#cuts_opening? ⇒ Boolean
(rw)
The cuts_opening? method is used to get the status of a component’s cut opening behavior.
#is2d=(is2d) (rw)
The #is2d=
method is used to set whether the component can glue to other entities or not.
#is2d? ⇒ Boolean
(rw)
The #is2d?
method is used to get whether the component can glue to other entities or not.
#no_scale_mask=(scale_mask) ⇒ Object
(rw)
Sets an integer that is really a bit-by-bit description of which scale tool handles are hidden on a given component. This is useful for creating definitions that can only be scaled in particular ways. If a bit contains a a 1, then a certain handle set will be hidden when the user selects the component and activates the Scale tool. Here is the map of which bits control which handles.
-
Bit0: disable scale along red (X),
-
Bit1: disable scale along green (Y),
-
Bit2: disable scale along blue (Z),
-
Bit3: disable scale in red/blue plane (X+Z),
-
Bit4: disable scale in green/blue plane (Y+Z),
-
Bit5: disable scale in red/green plane (X+Y),
-
Bit6: disable scale uniform (from corners) (XYZ).
Note that for 2-dimensional components (such as face-me components), not all of the handles in the list above are even used. Also, if the component you are modifying is already selected with the scale tool, then you or your user must deactivate and reactivate the scale tool for your new behavior to take effect.
#no_scale_mask? ⇒ Boolean
(rw)
The no_scale_mask? method returns an integer that is a bit-by-bit description of which scale tool handles are hidden when the user selects this single component with the scale tool. See the no_scale_mask= method for details on the bit encodings used.
#shadows_face_sun=(status) ⇒ Object
(rw)
The shadows_face_sun= method is used to identify whether the component’s shadow will be cast from the component’s current position as though the component were facing the sun. See the Component entity within the SketchUp User’s guide for more information on this feature.
#shadows_face_sun? ⇒ Boolean
(rw)
The shadows_face_sun? method is used to determine whether the component’s shadow is being cast from the component’s current position (as though the component were facing the sun). See the Component entity within the SketchUp User’s guide for more information on this feature.
#snapto ⇒ Integer
(rw)
The #snapto
method is used to see how a component can glue to other entities.
Returns a value indicating the snapping behavior of the component. Snapping behavior is how the x-y plane of a component instance will be snapped against a face. Possible values are:
-
SnapTo_Arbitrary
=> Snap to any arbitrary face, -
SnapTo_Horizontal
=> Snap to horizontal face like floors, -
SnapTo_Vertical
=> Snap to vertical face like walls, -
SnapTo_Sloped
=> Snap to sloped face like sloping roofs.
#snapto=(snapto) (rw)
To enable gluing, also set #is2d= to true.
To disable gluing, set #is2d= to false.
The #snapto=
method is used to set how a component can glue to other entities.
Snapping behavior is how the x-y plane of a component instance will be snapped against a face. Possible constant values are:
-
SnapTo_Arbitrary
=> Snap to any arbitrary face, -
SnapTo_Horizontal
=> Snap to horizontal face like floors, -
SnapTo_Vertical
=> Snap to vertical face like walls, -
SnapTo_Sloped
=> Snap to sloped face like sloping roofs.