Bmesh verts error?

I did many primitive using Bmesh
but this one is giving an error

values are :
vid = 0 n1 = 0.0 XC = 5.0 YC = 0.0 ZC = 0.0
Traceback (most recent call last):

AttributeError: ‘float’ object has no attribute ‘verts’

all the values are float and still getting this error !

		verts.append(bm.verts.new((XC,YC,ZC)))			# Add vertices
		if hasattr(bm.verts, "ensure_lookup_table"):
			bm.verts.ensure_lookup_table()

anyone can tell me what could be causing this error ?

thanks
happy bl

It sounds like your variable bm is not a BMesh here but instead a float. Maybe you accidentally reused the name bm to store a float value?

right I defined a prop as bm for an ellipse

prop names are not independent !

that one was not obvious LOL

by the way is it the best way to check the verts list
using

if hasattr(bm.verts, “ensure_lookup_table”):

here I check it for each vert added in a for loop

thanks
happy bl