Select all Objects with "x" amount of Vertices So I have no Idea what I am doing lol I have been experimenting with a little bit of code to try and select all objects in the scene if they have &quot;x&quot; amount of vertices. I have a scene with 158 objects in it. About 70 of those objects have 4 or less vertices but they are all mashed in with the other objects. Other than selecting each individual object one by one, I was hoping to be able to select all the objects that have 4 or less by simply clicking &quot;Run Script&quot; Is this code even remotely close? lol
import bpy
import bmesh

vertCount = 4

if True:
    
    meshes = set(o.data for i in context.selected_objects
        if o.type == 'MESH')

bm = bmesh.new()

for m in meshes:
        bpy.ops.object.mode_set( mode = 'EDIT' )
        bm = bmesh.from_edit_mesh( bpy.context.object.data )
        if len(m.vertices) == vertCount
            m.select = True
        bpy.ops.object.mode_set( mode = 'OBJECT' )
        bm.clear()
    
    bm.free()    
    bm.Select_Flush(True)
Select scene objects
Iterating over objects in the scene will keep the selection result is confined to only objects  type mesh in the scene.
An object can be active but not selected.
Prior to blender 2.8
import bpy

context = bpy.context

for o in context.scene.objects:
    o.select = (o.type == 'MESH' and len(o.data.vertices) &lt;= 4)

in &gt; 2.8
o.select_set(o.type == 'MESH' and len(o.data.vertices) &lt;= 4)