I am trying the face.position_material method to set a texture on a face, using the example provided on the method documentation.
The problem is the texture does not appear and when right clicking on the face the Texture Position tool does not turn up either. The face Entity Info though shows the texture image for the face. The only way the texture appear on the face is to click on the front face texture on the Entity Info tray and click OK. It then apply the texture and the “Texture Position” turns up when right clicking.
Here is an snapshot: you can see the texture position tool is not there but the Entity info shows the texture.
Here is the model.
Standard Example.skp (86.6 KB)
Try this code on the Ruby console:
model = Sketchup.active_model entities = model.active_entities # Create a face and add it to the model entities pts =  pts = [0, 0, 1] pts = [9, 0, 1] pts = [9, 9, 1] pts = [0, 9, 1] face = entities.add_face(pts) # Export an image to use as a texture path = Sketchup.temp_dir full_name = File.join(path, "temp_image.jpg") model.active_view.write_image(full_name, 500, 500, false, 0.0) # Create a material and assign the texture to it material = model.materials.add("Test Material") material.texture = full_name # Assign the new material to our face we created face.material = material pt_array =  pt_array = Geom::Point3d.new(3,0,0) pt_array = Geom::Point3d.new(0,0,0) on_front = true face.position_material(material, pt_array, on_front)