Slice based on pre op lengths
It is my experience that new geometry is always appended after using the bmesh create operators.
Hence can look at the length of bm.faces
before, and use to slice after.
A more robust result could be achieved with sets of elements prior and after.
import bpy
import bmesh
ob = bpy.context.object
me = ob.data
bm = bmesh.new()
bm.from_mesh(me)
nv, ne, nf = (len(bm.verts), len(bm.edges), len(bm.faces))
ret = bmesh.ops.create_cone(bm,
segments=3,
diameter2=2,
depth=1,
cap_ends=True)
print(len(bm.verts[nv:]), "New Verts:", [g.index for g in bm.verts[nv:]])
# check if new verts slice and op return are the same
same_verts = not bool(set(bm.verts[nv:]) - set(ret['verts']))
print("Slice and op return same verts?", same_verts)
print(len(bm.edges[ne:]), "New Edges:", [g.index for g in bm.edges[ne:]])
print(len(bm.faces[nf:]), "New faces:", [g.index for g in bm.faces[nf:]])
''' Result
4 New Verts: [8, 9, 10, 11]
Slice and op return same verts? True
6 New Edges: [12, 13, 14, 15, 16, 17]
4 New faces: [6, 7, 8, 9]
'''