Class: Sketchup::Snap
| Relationships | |
| Super Chains via Extension / Inclusion / Inheritance | |
|
Class Chain:
self,
Drawingelement,
Entity
|
|
|
Instance Chain:
self,
Drawingelement,
Entity
|
|
| Inherits: |
Sketchup::Drawingelement
|
Overview
A Snap is a custom grip used by SketchUp’s Move tool. Snaps can be added at strategic places such as connectors to help assembling objects.

#direction is the direction a snap is “pointing”. This can be thought of as the normal direction of the snap. It can also be thought of as the direction you move an object when plugging it into another object, e.g. inserting a power coord.
#up controls the rotation around the Snap’s axis.
When two objects are snapped together, the Snaps have opposite #direction vectors but matching #up vectors.
Instance Attribute Summary
Drawingelement - Inherited
| #casts_shadows= | The casts_shadows= method is used to set the |
| #casts_shadows? | The casts_shadows? method is used to determine if the |
| #hidden= | The hidden= method is used to set the hidden status for an element. |
| #hidden? | The hidden? method is used to determine if the element is hidden. |
| #layer | The layer method is used to retrieve the |
| #layer= | The layer= method is used to set the layer for the drawing element. |
| #material | The material method is used to retrieve the material for the drawing element. |
| #material= | The material= method is used to set the material for the drawing element. |
| #receives_shadows= | The receive_shadows= method is used to set the |
| #receives_shadows? | The receive_shadows? method is used to determine if the |
| #visible= | The |
| #visible? | The |
Entity - Inherited
Instance Method Summary
-
#direction ⇒ Geom::Vector3d
The #direction method is used to get the direction this
Snapis “pointing”. -
#position ⇒ Geom::Point3d
The #position method is used to get the position of this
Snap. -
#set(position) ⇒ Sketchup::Snap
The #set method is used to move and/or reorient a
Snap. -
#up ⇒ Geom::Vector3d
The #up method is used to get a vector representing the rotation of this
Snapalong its axis.
Drawingelement - Inherited
| #bounds | The |
| #erase! | The |
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 Method Details
#direction ⇒ Geom::Vector3d
The #direction method is used to get the direction this Snap is “pointing”.
When two Snaps are snapped into each other, they have the opposite #direction.
#position ⇒ Geom::Point3d
The #position method is used to get the position of this Snap.
#set(position) ⇒ Snap
#set(position, direction) ⇒ Snap
#set(position, direction, up) ⇒ Snap
Snap
#set(position, direction) ⇒ Snap
#set(position, direction, up) ⇒ Snap
The #set method is used to move and/or reorient a Snap.
#up ⇒ Geom::Vector3d
The #up method is used to get a vector representing the rotation of this Snap along its axis.
When two Snaps are snapped into each other, they have the same aligned #up direction.