How to retrieve (select) all faces touching selected edges?

I find some sharp edges through bpy.ops.mesh.edges_select_sharp().

Now i Would like to have all neighbouring faces selected (for smoothing…). How can I do this? (through Python…)

Many thanks for help!

bpy.ops.mesh.select_more(use_face_step = True)

http://www.blender.org/api/blender_python_api_2_74_release/bpy.ops.mesh.html?highlight=select_more#bpy.ops.mesh.select_more

or, you can do it manually using BMesh by iterating over the selected edges and using edge.link_faces


bme = bmesh.from_edit_mesh(context.object.data)
sel_edges = [ed for ed in bme.edges if ed.select]
for ed in sel_edges:
   for f in ed.link_faces:
       f.select_set(True)

bmesh.update_edit_mesh(context.object.data)

You may have to make sure that your mesh selection mode is correct and you may have to toggle into and out of edit mode if using the bpy.ops.

Best,
Patrick

Patrick, many thanks!! That works perfectly for me. Now I can find all sharp edges and smooth them.

First, bpy.ops.mesh.edges_select_sharp()

then

bpy.ops.mesh.select_more(True) several times, to have a broader strip around the edges.

And then bpy.ops.mesh.vertices_smooth()

[QUOTE=patmo141;2869523]

bpy.ops.mesh.select_more(use_face_step = True)

http://www.blender.org/api/blender_python_api_2_74_release/bpy.ops.mesh.html?highlight=select_more#bpy.ops.mesh.select_more