Found this post which helped me find the solution...
https://forums.sketchup.com/t/transform-a-model-vertex-by-vertex/38771/7
Here's the code I'm using with some notes... if something can be improved or changed please let me know? I can also add the code to iterate the faces if needed?
Basically you need the vertices of all the faces you want to move and each vertex needs a cooresponding vector to be moved to. That way you can pass the 2 arrays to
transform_by_vectors(vertices, vectors)
. Andif you're using sub components like I am, make sure you're in the correct entities context (not sure I'm using all the proper terminology here) oe else you get a mess as a result.
Like Tig explained in the post I shared...
@unknownuser said:
... if every vector has a separate vector-transformation you need to pass two full arrays - in one go!
vectors=[] //array of position to move vertices
vertices=[] //array of face vertices from the individual faces that make up the surface
vertices.flatten! //in my case I need to flatten the array
vertices.uniq! //make sure there are no duplicate vertex
vertices.each{|vector|
position=vector.position.clone
position.x +=distance
vectors.push vector.position.vector_to(position)
}
component_entity.transform_by_vectors(vertices, vectors)
Hopefully this helps others out because it wasn't easy to find or understand... but it works!