Bmesh extrude problem

i did some verts with a loop

if vid > 0: # Add edges
514 edges1.append(bm.edges.new((bm.verts[vid-1], bm.verts[vid])))
vid+=1

then i tried to extrude the edges made with he following

Extrude and create geometry

edges_start_a = bm.edges[:]

ret = bmesh.ops.extrude_edge_only(
bm,
edges=edges_start_a)
geom_extrude_mid = ret[“geom”]

verts_extrude_b1 = [ele for ele in geom_extrude_mid
if isinstance(ele, bmesh.types.BMVert)]

del ret

but i get an error on the line for making edges before the extrude part

so was there any chanhes to the extrude command
or why is it giving an error like this

nd\addmeshcells1.py", line 514, in graphic2
ValueError: edges.new(): this edge exists

thanks

you can’t create an edge from two verts if these two verts are already the verts of an edge. You needed to duplicate the verts first.

sorry not the problem i copied something working from a class to a function
so more like indentation problem which was difficult to see
and also error was on a working line before the new code added
which was very strange

but late yesteday night after a walk outside it got the solution!

thanks