select_name

How to select object by name since bpy.ops.object.select_name was removed?

myobject = bpy.data.objects[‘name of object’]

It’s not making object active in view 3d.

after PKHG’s code…

myobject.select = True

if you wan’t to deselect everything else beforehand…try

for obj in bpy.data.objects:
    obj.select = False

and if you want to make your selection active

bpy.context.scene.objects.active = myobject

Meaning, you did not ask what you wanted!

The last line of pathmo141 is VERY important because THAT object is chosen by a lot of bpy… api commands

jade.phenix … why do you say that bpy.ops.object.select_name is removed? … We are using 2.57, but I see it (the operator) in the 2.61 API documentation …

my Blender compiled today (2.61) says
console used:
>>> bpy.ops.object.select_ #ctrl space ==>
all(
by_layer(
by_type(
camera(
grouped(
hierarchy(
linked(
mirror(
pattern(
random(
same_group(
2.57 already too old, only use it if necessary …

OK. I have not installed the 2.61. Thanks for the info.

Thanks for answers

bpy.context.scene.objects.active = myobject

was that what i was looking for