Here is the code:
ent = Sketchup.active_model.entities
#Hexagon head
hex_curve = ent.add_ngon [0, 0, 0], [0, 0, 1], 4, 6
hex_face = ent.add_face hex_curve
hex_face.pushpull -3
#Screw and bolt group created
screw_curve = ent.add_circle [0, 0, -8], [0, 0, 1], 1.5
screw_face = ent.add_face screw_curve
screw_face.pushpull 8
bolt_group = ent.add_group ent.to_a
bolt_group.name = “Hex Bolt”
#Create nut
nut_curve = ent.add_ngon [10, 0, 0], [0, 0, 1], 3, 4
nut_face = ent.add_face nut_curve
nut_face.reverse!
nut_face.pushpull 1.5
cut_curve = ent.add_circle [10, 0, 0], [0, 0, 1], 1.5
cut_curve[0].faces[0].pushpull -1.5
nut_group = ent.add_group cut_curve[0].faces[1].all_connected
nut_group.name = “Square Nut”
nut_group.transform! [-10, 0, -7]
full_group = ent.add_group bolt_group, nut_group
full_group.name = “Nut-Bolt Group”
t2 = Geom::Transformation.translation [10, 10, 10]
t1 = Geom::Transformation.rotation [0, 0, 0], [1, 1, 1] -45.degrees
full_group.transform! t1 * t2
The result is no implicit conversation of float into array. Error, why?