How I found out:
In the default below of the view3d window you can see “Object”
Clicking you see what Shift-D does: hold the cursor above duplicate, after a short time you can see the API command!
Just started doing things the 2.5 way myself and I have to say it’s very impressive.
To duplicate many objects of the same type I would use something like:
import bpy
for ob in bpy.data.objects:
if ob.type == 'CURVE':
bpy.context.scene.objects.active = ob
bpy.ops.object.duplicate_move()
Here you can see the 3 key parts of bpy in use. Objects are retrieved from data, the active object is set using the context and an operator from bpy.ops acts on the object.
I think this will duplicate all curve objects in memory. To operate only on curve objects in the current scene, I’d use the line
for ob in bpy.context.scene.objects:
Have fun learning Python. Blender has a great API to explore.
edit:
Haha just tried the above code to make sure it works. It does with no problems, but be careful how many times you hit the ‘Run script’ button. I got carried away and Blender hung for ages before it came back and I realised it had only gone up to Curve.999.