Simple script but I cant figure it out...

Hi. I am having a hard time figuring out which is the best way to do this… I know its simple but where the mesh system ends and Bmesh starts still elude me.

I would like to build a copy of the selected mesh with only the edges, and none of them connected.
So: For each edge in mesh -> add new edge to new mesh -> copy mesh back to original object.

My xcript is adjusted from an online example:


import bpy
import bmesh

print (" – new --")
print (bpy.context.object)

Get the active mesh

me =

Get a BMesh representation

bm = # create an empty BMesh
nbm =

bm.from_mesh(me) # fill it in from a Mesh

Modify the BMesh, can do anything here…

for e in bm.edges:
#add the edge e to the new mesh nbm
#This I dont know how to…

Finish up, write the new bmesh back to the mesh


// END

Thank you.

import bpy, bmesh

me =
bm =

bm2 =
for edge in bm.edges:
    v1 =[0].co)
    v2 =[1].co), v2), edge)

Thanks CoDEmanX. You are apparently my life line when it comes to python in blender!