Python: add object, then change properties I use a python script to place a whole bunch of plane objects in a 3d grid (in layer 2 but that's not important), like in this example, where I just copied the primitive_plane_add syntax from what appears in the "info" pane when I add a plane object.

import bpy
layer2=(False, True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False)
for i in range(-5,5):
    for j in range(-5,5):
        for k in range(-5,5):
            bpy.ops.mesh.primitive_plane_add(radius=0.2, view_align=False, enter_editmode=False, location=(0, 0, 0), layers=layer2)


I found this post on blender.org that explains how to change a property for all objects, but what I want to do is change the property of the given object right after creating it. So, the above code would look like this:

import bpy
layer2=(False, True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False)
for i in range(-5,5):
    for j in range(-5,5):
        for k in range(-5,5):
            bpy.ops.mesh.primitive_plane_add(radius=0.2, view_align=False, enter_editmode=False, location=(0, 0, 0), layers=layer2)
            #So we've just added one more plane.
            #While we're here, select the just-created object
            #Then, change the object's color, transparency, tell it to be shadeless, etc
When using add primitive operators, the object that is created is marked as the active object. You can access the active object using obj = bpy.context.active_object.