Copy object from hidden layer with Python Is there a way to duplicate object located on inactive layer? bpy.ops.object.duplicate() doesn't do anything.

&gt;&gt;&gt; D.objects
&lt;bpy_collection[3], BlendDataObjects&gt;

&gt;&gt;&gt; C.object.layers[10] = True
&gt;&gt;&gt; C.object.layers[0] = False
&gt;&gt;&gt; C.object.select
True

&gt;&gt;&gt; bpy.ops.object.duplicate()
{'FINISHED'}

&gt;&gt;&gt; D.objects
&lt;bpy_collection[3], BlendDataObjects&gt;
Just use copy()  then link to the scene:

obj = bpy.data.objects['Cube'] #object you want to copy
dupe = obj.copy() # copy object
bpy.context.scene.objects.link(dupe) #links the copy yo the scene