Is it possible to know the size of a perimeter in blender?

Having selected a perimeter of vertices, which make a circumference. In my concrete case it is the perimeter of an arm in 3D Is it possible to know the total size of all those small measurements between vertices that the blender gives?

# edge loop length

import bpy

obj = bpy.context.active_object
mode = obj.mode

looplength = 0

if obj.type == 'MESH':
    bpy.ops.object.mode_set(mode="OBJECT")

    edges = [e for e in obj.data.edges if e.select == True]

    if edges:
        verts = obj.data.vertices
        for edge in edges: 
            looplength += (verts[edge.vertices[0]].co - verts[edge.vertices[1]].co).length
        print(looplength)
    else:
        print("no edges selected")    

bpy.ops.object.mode_set(mode=mode)
2 Likes

Hi, Thanks for your quick response. You can explain a little bit about all this you have written. At least, some notions. I’ve been in Blender for 3 months and although I only like modeling, there are things I do not understand. Thank you

I have the length option selected, but since there are many vertices, it gives me the length of each vertice. But what I’m looking for is the total length of the loop.

Copy the script in the Blender text editor, have the edges selected, and run the script from the text editor. It outputs the total length of the selected edges in the system console.

Hello again:
I have copied the text you sent me, in the text editor, as I put it in the photograph.
I give it to execute script, but I do not know where the result comes out. Could I put it in some picture?
Where is the console?
Many thanks.

Is this the console?,


Find the system console, or terminal whatever it’s called, from your system and run Blender from it. When you do, Blender can output to that and will give some texts by default, I just cleared them for clarity.

Blender will also output warnings about things in the scene or when opening a file in the system console so it works as a monitoring tool. That’s why I don’t even run Blender without it.

You can also choose Window -> Toggle System Console from the top bar without having to run Blender from the console.

Only on Windows, and neither of us is using that.

Ah, apologies. I’ve only ever used Blender on Windows so didn’t realise that was exclusive.