Hi!
Im trying to learn and follow the API documentation. Currently I will model a loaded pile. I get problem when I define object outside the functions. Is there a simple way to overcome this?
============================================================
# USER INPUT: CROSS-SECTION
# ============================================================
print("\nChoose material:")
print(" 1) Steel")
print(" 2) Concrete (Centrum Pile)")
while True:
material_choice = input("Select 1 or 2: ")
if material_choice in ['1', '2']:
break
print("Invalid selection.")
if material_choice == '1':
# Steel
material_type ="MaterialType.TYPE_STEEL"
material_model = "MaterialModel.MODEL_ISOTROPIC_LINEAR_ELASTIC"
material_quality = input("Enter steel material quality (e.g., S235, S355): ")
d_outer = float(input("Enter outer diameter [mm]: "))
t_wall = float(input("Enter wall thickness [mm]: "))
cs_name = f"PIPE {d_outer}/{t_wall}"
else:
# Concrete (Centrum Pile)
material_type = "TYPE_CONCRETE"
material_model = "MODEL_ISOTROPIC_LINEAR_ELASTIC"
material_quality = input("Enter concrete material quality (e.g., C30/37, C35/45): ")
b = float(input("Enter centrum pile dimension b [mm]: "))
exp_class = float(input("Enter centrum pile exposure class (e.g., 0.25): "))
cnom = float(input("Enter centrum pile nominal cover thickness [mm]: "))
later on I want to cast these into
============================================================
# MATERIAL & CROSS-SECTION
# ============================================================
mc_to_create = []
mc_to_create.append(
rfem.structure_core.Material(
no=1,
=material_quality,
material_type=material_type,
material_model=material_model,
)
)
mc_to_create.append(
rfem.structure_core.CrossSection(
no=1,
name=cs_name,
material=1,
)
)
rfem_app.create_objects(mc_to_create)
