i did this little script to spin a cross section called spin1 around origin
now it does the spin ok
but it also changes the text editor window into a 3D view in perspective mode!
so how do i stop that ?
import bpy, math
from bpy.props import *
from mathutils import *
from math import *
print(' area =',bpy.context.area.type)
bpy.context.area.type="VIEW_3D"
print(' area =',bpy.context.area.type)
o1=bpy.ops.object.select_name(name="spin1",extend=False)
print ('o1=',o1)
obj = bpy.context.active_object
myMesh = obj.data
print (' myMesh obj =',myMesh.name)
bpy.ops.object.mode_set(mode='EDIT') # force it, be sure!
bpy.ops.mesh.select_all(action='TOGGLE')
bpy.ops.mesh.spin(steps=9, dupli=False, degrees=90, center=(0, 0, 0), axis=(0, 0, 90))
thanks