In order to get the exact UVQ coordinates of the materials applied to all the faces inside my components, I have no other solution than to group the faces and convert them to a component:
def all_faces_componant(sel, faces) sel.grep(Sketchup::ComponentInstance).each do |s| s.definition.entities.grep(Sketchup::Face).each do |f| faces << f end all_faces_componant(s.definition.entities, faces) end end faces =  mod = Sketchup.active_model ents = mod.active_entities sel = mod.selection all_faces_componant(sel, faces) mod.start_operation('UVQ save', true) for f in faces group = ents.add_group(f) inst = group.to_component #uvq =  #saves_uv(inst, uvq) => Trigger my method to record UVQ in array! inst.explode p f.valid? # => Return true! end mod.commit_operation
I manage with this method to retrieve all the information I need but SketchUp takes revenge by crashing when I close or open another project!
I figured out that SketchUp doesn’t like to create groups or component instances from a single face!
Do you know for what and how to get around the problem?
If you want to try the method here is an example of a face inside a component or my code produces this error:
Sketchup Face.skp (127.7 KB)
Thank you in advance for your help.