My favorites | English | Sign in

Google SketchUp Ruby API

Vertex

class

Parent: Entity

Introduction

SketchUp 6.0+

A Vertex. A Vertex represents the end of an Edge or a point inside a Face.

Methods

Vertex.common_edgeSketchUp 6.0+

The common_edge method is used to find a common edge that is defined by this vertex and another vertex

Arguments:

vertex2
A Vertex object.

Returns:

edge
an Edge object common to both vertices if successful. Returns nil if there is no edge between the two vertices.
 edge = entities[0]
 # returns array of vertices that make up the line
 verticies = edge.vertices
 vertex1 = verticies[0]
 vertex2 = verticies[1]
 edge = vertex1.common_edge vertex2
 if (edge)
   UI.messagebox edge
 else
   UI.messagebox "Failure"
 end

Vertex.curve_interior?SketchUp 6.0+

The curve_interior? method is used to determine if this vertex is on the interior of a Curve.

Returns:

status
true if it is used by exactly two edges which are both part of the same curve.
 edge = entities[0]
 # returns array of vertices that make up the line
 verticies = edge.vertices
 vertex1 = verticies[0]
 status = vertex1.curve_interior?
 if (status)
   UI.messagebox status
 else
   #returns nil if vertex is not on interior of a Curve
   UI.messagebox "Failure"
 end

Vertex.edgesSketchUp 6.0+

The edges method is used to retrieve an Array of edges that use the Vertex.

Returns:

edges
an Array of edge objects if successful
 edge = entities[0]
 # Returns array of vertices that make up the line.
 verticies = edge.vertices
 vertex1 = verticies[0]
 edges = vertex1.edges

Vertex.facesSketchUp 6.0+

The faces method is used to retrieve an Array of faces that use the vertex.

Returns:

faces
an Array of faces that use the vertex if successful
 edge = entities[0]
 # Returns array of vertices that make up the line.
 verticies = edge.vertices
 vertex1 = verticies[0]
 faces = vertex1.faces

Vertex.loopsSketchUp 6.0+

The loops method is used to retrieve an Array of loops that use the vertex.

Returns:

loops
an Array of loops that use the vertex if successful
 edge = entities[0]
 # Returns array of vertices that make up the line.
 verticies = edge.vertices
 vertex1 = verticies[0]
 loops = vertex1.loops

Vertex.positionSketchUp 6.0+

The position method is used to retrieve the Point3d position of a vertex.

Returns:

point
a Point3d object representing the position of the vertex if successful
 edge = entities[0]
 # Returns array of vertices that make up the line.
 verticies = edge.vertices
 vertex1 = verticies[0]
 position = vertex1.position

Vertex.used_by?SketchUp 6.0+

The used_by? method is used to determine if the Vertex is used by a given Edge or Face.

Arguments:

face_or_edge
A Face or Edge ot test against.

Returns:

used
true if the Vertex is used in the given entity.
 used = vertex1.used_by? my_face