Python convert curve to object I'm trying to visualize assembly of flat pack furniture, out of 2D SVG curves. I can successfully import and extrude the separate SVG paths in Python, conveniently using the path's id to reference the bpy.data.curves[id]:

bpy.ops.import_curve.svg("/path/to/barkruk.svg")
bpy.data.curves["left"].dimensions = "2D"
bpy.data.curves["left"].extrude = 0.003
bpy.data.curves["centert"].dimensions = "2D"
bpy.data.curves["centert"].extrude = 0.003
bpy.data.curves["right"].dimensions = "2D"
bpy.data.curves["right"].extrude = 0.003


(You can find the example SVG at stretchsketch)

I was hoping I could transform (rotate, move) the curves via the rotate_euler properties but these are only present at bpy.data.objects which are not as nice and intuitive reference-able as curves:

&gt;&gt;&gt; bpy.data.objects[3].rotation_euler=(radians(90),0,radians(90))
&gt;&gt;&gt; bpy.data.objects[3].name
'Curve.002'


What is the best approach to rotate a curve in blender 2.77 with Python?
Test script to import the blender.svg file.
As pointed out here  the newly added curves are not selected after the import.  For convenience added an empty parent.

import bpy
context = bpy.context
scene = context.scene
bpy.ops.object.select_all(action='SELECT')
bpy.ops.import_curve.svg(filepath = bpy.app.binary_path.replace(".exe", "") + ".svg")
newcurves = [c for c in context.scene.objects if not c.select]
# deselect all
bpy.ops.object.select_all(action='DESELECT')
# create an empty make it the active  object
empty = bpy.data.objects.new("Holder", None) # use filename maybe
scene.objects.link(empty)
scene.objects.active = empty
empty.select = True
# loop thru the curve objects
for c in newcurves:
    print("Curve: %s", c.name)
    # make it selected
    c.select = True
    # make the parent the empty if not already set
    if not c.parent:
        c.parent = empty
    # change some curve details
    curve = c.data
    curve.dimensions = '2D'
    curve.extrude = 0.003
    # sane object names
    c.name = curve.name
    # location
    #c.location.x += 0.332

empty.scale *= 200


Test on svg 


If you are going to move and rotate append a call to geometry to origin operator.

bpy.ops.object.origin_set(type='GEOMETRY_ORIGIN', center='BOUNDS')