# オブジェクトの設定
object_type = 'cylinder'  # 'cylinder', 'sphere', 'cone', 'square', 'cube' のいずれかを指
 
成功
import bpy
from math import radians
# 数字を入力してもらう
zion_x = 30
zion_number = 15
# 円柱の設定
radius = 10
depth_vertices = 60
# 円板の位置のリストを作成する
disk_locations = [
    (zion_x, 0.0, 0.0),    # 1つ目の円板はx=30に配置
    (zion_x, 0.0, zion_number),    # 2つ目の円板はz=15に配置
    (zion_x, 0.0, -zion_number),   # 3つ目の円板はz=-15に配置
    (zion_x, -zion_number, 0.0),   # 4つ目の円板はy=-15に配置
    (zion_x, zion_number, 0.0)     # 5つ目の円板はy=15に配置
]
# 各円板の作成
object_names = ['cylinder1', 'cylinder2', 'cylinder3', 'cylinder4', 'cylinder5']
z_rotation_enabled = [True, True, True, True, True]
y_rotation_enabled = [False, False, False, False, False]
radius = 2
depth_vertices = 12
for i, location in enumerate(disk_locations):
    x, y, z = location
    bpy.ops.mesh.primitive_cylinder_add(
        radius=radius,
        depth=0,
        vertices=depth_vertices,
        enter_editmode=False,
        align='WORLD',
        location=(x, y, z)
    )
    cylinder = bpy.context.object
    cylinder.name = object_names[i]
    cylinder.rotation_euler = (radians(90), radians(0), radians(0))  # z軸回転
    cylinder.rotation_euler.y = radians(90) if y_rotation_enabled[i] else radians(0)  # y軸回転
    if z_rotation_enabled[i]:
        bpy.ops.object.mode_set(mode='EDIT')
        bpy.ops.mesh.select_all(action='SELECT')
        bpy.ops.transform.rotate(value=radians(90), orient_axis='Z', orient_type='GLOBAL')
        bpy.ops.object.mode_set(mode='OBJECT')
bbb
