# Mark seam and clear seam in one button

I have been looking for a way to do this for a long time (mark_seam (True\False) and mark_sharp (True\False)) with one button in my pie menu. I managed to achieve some kind of result. I found how to do one button bevel and crease.

How to determine if the seam is on only selected edges?

import bpy
import bmesh

obj = bpy.context.object
me = obj.data
bm = bmesh.from_edit_mesh(me)
bw = bm.edges.layers.bevel_weight.verify()
cr = bm.edges.layers.crease.verify()
#se = bm.edges.layers.seam.verify()           ???
selected = [e for e in bm.edges if e.select]

if any(e[bw] == True for e in selected):

bpy.ops.transform.edge_bevelweight(value=-1)

else:

bpy.ops.transform.edge_bevelweight(value=1)

bmesh.update_edit_mesh(me, True)

• Could you clarify what your question is. Preferably with a question sentence (with a question mark) at the start or end of the post? – Leander Oct 11 at 17:16