add vertices to mesh object

Hello.
I want to add vertices to mesh object.

varMesh = bpy.data.meshes.new(Name)
varMesh.vertices.extend(list_of_vertices)

return error “bpy_prop_collection has no attribute ‘extend’”

How can I add vertices to mesh object?

sorry,poor English.:eyebrowlift2:

varMesh.vertices.add(count)
varMesh.vertices.foreach_set(“co”, flat_vert_list)

flat list means, vert coords have to be stored like: [0.1, 0.2, 0.3, 0.4, 0.5, 0.6], not [(0.1, 0.2, 0.3), (0.4, 0.5, 0.6)]

there are utility functions to unpack to flat lists, have a look at stock scripts

you can also use the from_pydata function, but it basically uses the same foreach_set thing

Thank you! I try to do that.