Read up:
http://www.sketchup.com/intl/en/developer/docs/classes.php
When you add an instance you apply an initial transformation, but you can do more transforming later...
A group is a special kind of component.
For now let's assume a component existe.
So let's assume you have a component-definition containing your 'box' with a reference to it called ' compodef'.
Let's assume the references:
model = Sketchup_active_model ents = model.active_entities
Let's also deal with just one curve, for now...
Let's assume you have a reference to just one of the edges that form it, called ' edge'.
Let's also assume you'll place instances at its nodes - i.e. the edges' 'end' points.
curve = edge.curve vertices = curve.vertices points = [] vertices.each{|v| points << v.position }
now you have an array of the points defining the curve.
points.each{|point| tran = Geom::Transformation.new(point) instance = ents.add_instance{ compodef, tran } }
now you have an instance of the component 'box' located at every node point of the curve...
This is a simplified explanation...
At least should get you started...
If you want to 'swivel' each box to span between the nodes in one curve and the equivalent node in a second curve, then you need to assemble two arrays of points - says points1 and points2
You iterate thus:
` points1.each_with_index{|point1, i|
tranp = Geom::Transformation.new(point1)
instance = ents.add_instance{ compodef, tranp }
length = instance.bounds.length
now get the second point
point2 = points2[i]
dist = point1.distance(point2)
scale the box
scalex = dist / length
trans = Geom::Transformation.scaling(point1, scalex, 1.0, 1.0)
instance.transform!(trans)
rotate the box
vec = point1.vector_to(point2)
angle = X_AXIS.angle_between(vec)
axis = X_AXIS.cross(vec) ### might be reversed - check ?
trana = Geom::Transformation.rotation(point1, axis, angle)
instance.transform!(trana)
}`
this is untested but should give you some ideas...
It places the instance scales it so it'll stretch between the two points and the rotates the box so it spans between the two points.
Obviously you need to do more work - like making the box component, checking the curve points for 'direction' and count-match etc...
Good luck...