Let’s assume you have a simple SKP component made manually - let’s say it’s named ‘box.skp’.
It’s a 1x1x1" cube, with its base centered on the ORIGIN.
You can make it within the model using Ruby BUT I think this approach is simpler…
Now in Ruby code you need to add it into the model’s definitions.
model = Sketchup.active_model defn = model.definitions.load( full_path_to_box.skp )
Now you need to add the ‘defn’ as an instance [for now we’ll put it at the ORIGIN, then transform it].
inst = model.active_entities.add_instance( defn, ORIGIN )
Now let’s transform it…
inst.transform!( Geom::Transformation.new( some_new_location_point ) )
and assuming it’s a column… let’s scale its height etc [remember it’s 1" in all axes at the moment], leaving its insertion-point where we just specified it…
inst.transform!( Geom::Transformation.scaling( inst.transformation.origin, x_size, y_size, z_size ) )
The sizes should be in inches as it starts off as 1x1x1", so it it is to be 12" x 6" x 96" use:
inst.transform!( Geom::Transformation.scaling( inst.transformation.origin, 12.0, 6.0, 96.0) )
Read up on the API: