urgent help please with object "shade_smooth"

here is a simple code:


    bpy.context.scene.objects.active = ob
    bpy.ops.object.editmode_toggle()
    bpy.ops.mesh.delete(type='VERT')
    bpy.ops.object.editmode_toggle()
    
    
    me.from_pydata(verts,[],faces)
    me.update(calc_edges=True)
    bpy.ops.object.shade_smooth()

the problem is that the object doesn’t smooth …stays flat …what to do?

make sure it’s selected…works for me. If that’s not it, i’m not sure :slight_smile:

ob.select = True

thanks,exactly that’s what I was missing :slight_smile:

low level :slight_smile:

for poly in ob.data.polygons:
    poly.use_smooth = True