# Select all objects with specific position

I am trying to get a list of all objects that have specific position. For example, get me all objects that have (x,y,z) < 1. How do I do this?

import bpy

objects = bpy.context.scene.objects

for obj in objects:



## 1 Answer

import bpy

objects = bpy.data.objects

lis = [obj for obj in objects if obj.location.x < 1 and obj.location.y < 1 and obj.location.z < 1]

# or
lis = []
for obj in objects:
if obj.location.x < 1:
if obj.location.y < 1:
if obj.location.z < 1:
lis.append(obj)

• Hi thank you. I get a list here and is there a way to select all the objects that satisfies this condition?
– Vika
Jul 13 at 9:37
• for obj in lis: obj.select_set(True)
– X Y
Jul 13 at 9:43