Angle between vectors: attribute not found

Hello. In my script I need to find the angle between two edges, so I want to use the proer python function.
I wrote this way, but it gives me "module has no attribute ‘AngleBetweenVecs’ " error.

What’s the correct code?

import bpy
import mathutils
from mathutils import geometry

bpy.ops.object.mode_set(mode = 'OBJECT')

ob = bpy.context.active_object
me =
sel_vert = []

for v in me.vertices:   #fra tutti i vertici della mesh
    if        #se il vertice è selezionato        

AngleBetweenVecs(me.edges[0], me.edges[1])

bpy.ops.object.mode_set(mode = 'EDIT')   


You can’t just make up Blender API commands (unfortunately).

Check here:

It looks like “angle(other, fallback)” is the command you need.

I’m sorry, I have another similar question: I need to get the midpont vector between two vectors, so I’ve found this function in this page: , but it seems to be in use no more, like the anglebetweenvecs. What is the correct actual funtion that does the same thing?

Thankyou very much!

You can try something like this below, which I used to find the center point of an edge using the vectors from two verts in an edge. Since the vectors are a local coordinate, the last line finds what the global coordinate is.

obj = bpy.context.object
co1 =[0].co
co2 =[1].co
localcenter = co1.lerp(co2, 0.5)  # This is finds the center which is 0.5
g_co = obj.matrix_world * localcenter  # This finds the global coordinate of that center