Base Data#
|
Retrieving and modifying Base Data of the active model:
Keywords:
base data model type global axes orientation standards add-ons |
from dlubal.api import rfem
with rfem.Application() as rfem_app:
rfem_app.create_model(name="base_data")
# Retrieve the Base Data of the active model.
base_data: rfem.BaseData = rfem_app.get_base_data()
print(f"BASE DATA:\n{base_data}")
# Modify the values in the Base Data object.
# Main model data
base_data.main.model_description = "model_type_2D"
base_data.main.comment = "test version"
base_data.main.model_type = rfem.BaseData.Main.MODEL_TYPE_2D_XZ_PLANE_STRESS
base_data.main.surfaces_active = False
# General settings
base_data.general_settings.global_axes_orientation = (
rfem.BaseData.GeneralSettings.GLOBAL_AXES_ORIENTATION_ZUP
)
base_data.general_settings.local_axes_orientation = (
rfem.BaseData.GeneralSettings.LOCAL_AXES_ORIENTATION_ZUP
)
# Add-ons activation
base_data.addons.steel_design_active = True
base_data.addons.load_wizards_active = True
base_data.addons.combination_wizard_and_classification_active = True
# Standards assignment
base_data.standards.load_wizard_standard_group = rfem.BaseData.Standards.LOAD_WIZARD_STANDARD_GROUP_EN_1991_STANDARD_GROUP
base_data.standards.load_wizard_standard = rfem.BaseData.Standards.LOAD_WIZARD_NATIONAL_ANNEX_AND_EDITION_EN_1991_DIN_2019_04_STANDARD
base_data.standards.combination_wizard_standard = rfem.BaseData.Standards.COMBINATION_WIZARD_NATIONAL_ANNEX_AND_EDITION_EN_1990_DIN_2012_08_STANDARD
base_data.standards.steel_design_standard = rfem.BaseData.Standards.STEEL_DESIGN_NATIONAL_ANNEX_AND_EDITION_EN_1993_DIN_2020_11_STANDARD
# Apply the updated Base Data to the model.
rfem_app.set_base_data(base_data=base_data)
using Rfem = Dlubal.Api.Rfem;
ApplicationRfem? rfemApp = null;
try
{
rfemApp = new ApplicationRfem();
rfemApp.create_model(name: "base_data");
// Retrieve the Base Data of the active model.
Rfem.BaseData? baseData = rfemApp.get_base_data();
Console.WriteLine($"BASE DATA:\n{baseData}");
// Modify the values in the Base Data object.
// Main model data
baseData.Main.ModelDescription = "model_type_2D";
baseData.Main.Comment = "test version";
baseData.Main.ModelType = Rfem.BaseData.Types.Main.Types.ModelType._2DXzPlaneStress;
baseData.Main.SurfacesActive = false;
// General settings
baseData.GeneralSettings.GlobalAxesOrientation = Rfem.BaseData.Types.GeneralSettings.Types.GlobalAxesOrientation.Zup;
baseData.GeneralSettings.LocalAxesOrientation = Rfem.BaseData.Types.GeneralSettings.Types.LocalAxesOrientation.Zup;
// Add-ons activation
baseData.Addons.SteelDesignActive = true;
baseData.Addons.LoadWizardsActive = true;
baseData.Addons.CombinationWizardAndClassificationActive = true;
// Standards assignment
baseData.Standards.LoadWizardStandardGroup = Rfem.BaseData.Types.Standards.Types.LoadWizardStandardGroup.En1991StandardGroup;
baseData.Standards.LoadWizardStandard = Rfem.BaseData.Types.Standards.Types.LoadWizardStandard.LoadWizardNationalAnnexAndEditionEn1991Din201904Standard;
baseData.Standards.CombinationWizardStandard = Rfem.BaseData.Types.Standards.Types.CombinationWizardStandard.CombinationWizardNationalAnnexAndEditionEn1990Din201208Standard;
baseData.Standards.SteelDesignStandard = Rfem.BaseData.Types.Standards.Types.SteelDesignStandard.SteelDesignNationalAnnexAndEditionEn1993Din202011Standard;
// Apply the updated Base Data to the model.
rfemApp.set_base_data(baseData: baseData);
}
catch (Exception ex)
{
Console.WriteLine($"Error: {ex.Message}");
}
finally
{
if (rfemApp != null) rfemApp.close_connection();
}