Purchase one license for $20 using PayPal. SketchUcation Premium users get 20% discount when they purchase through the SketchUcation Store. A license allows one person to use Vertex Tools on any number of machines, but the license cannot be shared with anyone else. Incremental updates (x.1, x.2 etc.) are free. Draw a line from the vertex you are planning to move (we will call this vertex 'A'), select the line and move the line so that vertex 'A' will be on the target vertex. Sketchup will weld the vertex automatically. Delete the line.
'A coordinate' is a little bit ambiguous, depending if you want a point from the bounding box, the insertion point or a vertex inside the component.But a simple generic example would be: # Assuming user has selected a ComponentInstance:instance = Sketchup.activemodel.selection0puts instance.transformation.originComponentInstance.transformationSketchUp 6.0+The transformationmethod is used to retrieve the transformation of this instance.Transformation.originSketchUp 6.0+The origin method retrieves the origin of a rigid transformation.
- In the Ruby API, units are always 'inches'. Refer to the docs for the class for information on how to convert between different units.Then we declare the model variable that references the current, or active SketchUp model. Next we make a variable called entities and assign it a reference to the model's activeentity collection. Entities are things like edges, faces, images, components, construction geometry, etc. And an entity collection is like a Ruby Array, full of those entities. There can be many entity collections in a model. The last step is to add the edge to that entity collection with the Entities.addedges method.
Use the API DocsThis is the final reminder, I promise. Remember to look things up in the API docs! The more you read through the docs, the more you will understand what the Ruby API is capable of doing. Check out the documentation for these methods we used:.Moving On, Adding a Face!Lets take the ideas we covered in the first example and keep going with it by adding a face to the model. We add a face to the model in a similar manner to adding an edge. We need three unique points in space.
So lets create one additional array, and add a face with edges that go from point1 to point2, point2 to point3, and point3 back to point1. Here's an example.
![Sketchup Sketchup](http://sketchuppluginreviews.com/wp-content/uploads/2010/08/Vertext-Tools.jpg)
![Move vertex in sketchup Move vertex in sketchup](/uploads/1/2/5/5/125510497/322373133.png)
Faces in SketchUp are made up of 3 or more points or edges and those points or edges must be coplanar. It is up to you as the developer to make sure the edges or points are coplanar, otherwise no face will be created. Adding a Construction PointOr adding a few construction points. Lets repurpose the previous example and add construction points to the end of all edges of the face we created. Instead of using the point1, point2, and point3 arrays to add a face, we'll use them to add construction points at each of those positions, one at a time using the Entities.addcpoint method.
Centerpoint = Geom::Point3d.new(0,0,0)vector = Geom::Vector3d.new 0,0,1model = Sketchup.activemodelentities = model.activeentitiesedges = entities.addcircle( centerpoint, vector, 10 )# This is an empty aray where the vertices will be stored.vertices = edges.each do edge # Add the start and end vertices for every edge. Think about this,# each vertex will be added twice because it is used by 2 edges.vertices.