I’m a complete novice with Ruby and the Sketchup API, and I’m looking for a sensible way to extend the end of an I-beam, but chopped at an angle. e.g., from red to green:

I could use Transformation.rotation() on the end face, but that wouldn’t extend the top edge of the green beam out along the same line as the red.

I have a horrible solution (that works) using a Transformation.translation() along the line… of 5 separate edges and calculating 6 different distances. There must be a better way?!

```
ridgey = height*Math.tan(angle)*Math.cos(angle)
ridgez = height*Math.tan(angle)*Math.sin(angle)
tr = Geom::Transformation.translation(Geom::Vector3d.new(0,ridgey.mm,ridgez.mm))
entities.transform_entities(tr, entities[20])
ridgey = (height-45)*Math.tan(angle)*Math.cos(angle)
ridgez = (height-45)*Math.tan(angle)*Math.sin(angle)
tr = Geom::Transformation.translation(Geom::Vector3d.new(0,ridgey.mm,ridgez.mm))
entities.transform_entities(tr, entities[17])
entities.transform_entities(tr, entities[21])
ridgey = 45*Math.tan(angle)*Math.cos(angle)
ridgez = 45*Math.tan(angle)*Math.sin(angle)
tr = Geom::Transformation.translation(Geom::Vector3d.new(0,ridgey.mm,ridgez.mm))
entities.transform_entities(tr, entities[15])
entities.transform_entities(tr, entities[23])
```

(I’m using SketchUp 2013, if that makes a difference)

Many thanks