# Select vertices, edges, faces of individual objects

I add 1 circle using this code

ret = bmesh.ops.create_circle(
bm,
cap_ends=False,
segments=3,
)
del ret
edges_start_a = bm.edges[:]
geom_start_a = bm.verts[:] + edges_start_a
verts_start_a = bm.verts[:]


When i add a second one using the same code only different variables

ret = bmesh.ops.create_circle(
bm,
cap_ends=False,
segments=3,
)
del ret
edges_start_b = bm.edges[:]
geom_start_b = bm.verts[:] + edges_start_b
verts_start_b = bm.verts[:]


All the variables of the second circle is combined with the first one I.E. edges_start_b also has edges of edges_start_a in it

How can i split these? Or at least get the vertices and edges and faces of each individual circle?

I'm assuming, that bm is a bmesh object. Obviously, the bmesh object will hold all verts, edges and faces that you add to it with any operation.

You should improve the following

1. Don't del ret. It should be put in a global scope where ret is accessible later anyways. If it goes out of scope python will delete it automatically. You're using a dynamic interpreter language, so you can use its features. Even just not pointing to the return variable bmesh.ops.create_circle(bm, ... ) will delete the pointer.
2. Your code won't compile. Always post working code snippets (mwe) in question. You'll be saving everyone a lot of time. (A) Others won't have to rewrite your code and (B) your problem may be in the code you didn't post.
3. Read the documentation. The method bmesh.ops.create_circle actually return a dictionary with the newly created vertices.

From the api:

Returns
verts: output verts type list of (bmesh.types.BMVert)

Return type
dict with string keys

With the returned dict we can point to the verts. (Obviously, now that we're using the returned object ret don't delete it.)

verts = ret['verts']


Each vertex stores the linked edges.

verts[0].link_edges


The updated snippet could look like this.

import bmesh

bm = bmesh.new()

ret = bmesh.ops.create_circle(
bm,
cap_ends=False,
segments=5,
)
verts = ret['verts']

edges = set()
for vert in verts:
for edge in vert.link_edges:

So, what's going on at the end? Why are we creating a set() and then converting it to a list?
Each vertex of the circle, will have two link_edges. However, the connected vertices will share an edge. This means, that if we just add all of the linked edges into a big list, each edge will show up twice. That's why, I use a python set. In a set each element is unique. Adding items to a set with the add() method will not do anything if the element (the next edge) is already present in the set.
• Yes, I saw that. I think they del the ret variable, because they're assigning it another value in the next line and want to avoid confusion. By using del they are saying that whatever was in this variable is no longer used, although the same variable name shows up shortly after. You can read it here: using del can be useful to show intent. - I know in the case of del foo that the intent is to remove the variable from scope. It's not clear that foo = None is doing that. – Leander Dec 29 '19 at 12:09