import bpy
from math import radians
# 回転させる軸を選択する
zion_xyz = 'yana'
# 円錐を作成する
bpy.ops.mesh.primitive_cone_add(radius1=1, radius2=0, depth=2)
# オブジェクトに名前を付ける
bpy.context.object.name = "Zion rail 後ろのCone"
# 円錐の位置を変更する
bpy.context.object.location[0] = 0.0 # X座標
bpy.context.object.location[1] = 30.0 # Y座標
bpy.context.object.location[2] = 0.0 # Z座標
if zion_xyz == 'xana':
# 軸を中心に90度回転させる
bpy.context.object.rotation_euler[0] = radians(0)
bpy.context.object.rotation_euler[1] = radians(90)
bpy.context.object.rotation_euler[2] = radians(0)
# X軸方向に伸ばす
bpy.context.object.scale[0] = 1
bpy.context.object.scale[1] = 1
bpy.context.object.scale[2] = 1
elif zion_xyz == 'yana':
# 軸を中心に90度回転させる
bpy.context.object.rotation_euler[0] = radians(90)
bpy.context.object.rotation_euler[1] = radians(0)
bpy.context.object.rotation_euler[2] = radians(0)
# Y軸方向に伸ばす
bpy.context.object.scale[0] = 3
bpy.context.object.scale[1] = 3
bpy.context.object.scale[2] = 3
elif zion_xyz == 'zana':
# Z軸を中心に90度回転させる
bpy.context.object.rotation_euler[0] = radians(0)
bpy.context.object.rotation_euler[1] = radians(0)
bpy.context.object.rotation_euler[2] = radians(0)
# Z軸方向に伸ばす
bpy.context.object.scale[0] = 1
bpy.context.object.scale[1] = 1
bpy.context.object.scale[2] = 10
else:
print('Invalid rotation axis selected.')
bbb