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 rstab
with rstab.Application() as rstab_app:
rstab_app.create_model(name="base_data")
# Retrieve the Base Data of the active model.
base_data: rstab.BaseData = rstab_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 = rstab.BaseData.Main.MODEL_TYPE_2D_XZ
# General settings
base_data.general_settings.global_axes_orientation = (
rstab.BaseData.GeneralSettings.GLOBAL_AXES_ORIENTATION_ZUP
)
base_data.general_settings.local_axes_orientation = (
rstab.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 = rstab.BaseData.Standards.LOAD_WIZARD_STANDARD_GROUP_EN_1991_STANDARD_GROUP
base_data.standards.load_wizard_standard = rstab.BaseData.Standards.LOAD_WIZARD_NATIONAL_ANNEX_AND_EDITION_EN_1991_DIN_2019_04_STANDARD
base_data.standards.combination_wizard_standard = rstab.BaseData.Standards.COMBINATION_WIZARD_NATIONAL_ANNEX_AND_EDITION_EN_1990_DIN_2012_08_STANDARD
base_data.standards.steel_design_standard = rstab.BaseData.Standards.STEEL_DESIGN_NATIONAL_ANNEX_AND_EDITION_EN_1993_DIN_2020_11_STANDARD
# Apply the updated Base Data to the model.
rstab_app.set_base_data(base_data=base_data)
using Rstab = Dlubal.Api.Rstab;
ApplicationRstab? rstabApp = null;
try
{
rstabApp = new ApplicationRstab();
rstabApp.create_model(name: "base_data");
// Retrieve the Base Data of the active model.
Rstab.BaseData? baseData = rstabApp.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 = Rstab.BaseData.Types.Main.Types.ModelType._2DXz;
// General settings
baseData.GeneralSettings.GlobalAxesOrientation = Rstab.BaseData.Types.GeneralSettings.Types.GlobalAxesOrientation.Zup;
baseData.GeneralSettings.LocalAxesOrientation = Rstab.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 = Rstab.BaseData.Types.Standards.Types.LoadWizardStandardGroup.En1991StandardGroup;
baseData.Standards.LoadWizardStandard = Rstab.BaseData.Types.Standards.Types.LoadWizardStandard.LoadWizardNationalAnnexAndEditionEn1991Din201904Standard;
baseData.Standards.CombinationWizardStandard = Rstab.BaseData.Types.Standards.Types.CombinationWizardStandard.CombinationWizardNationalAnnexAndEditionEn1990Din201208Standard;
baseData.Standards.SteelDesignStandard = Rstab.BaseData.Types.Standards.Types.SteelDesignStandard.SteelDesignNationalAnnexAndEditionEn1993Din202011Standard;
// Apply the updated Base Data to the model.
rstabApp.set_base_data(baseData: baseData);
}
catch (Exception ex)
{
Console.WriteLine($"Error: {ex.Message}");
}
finally
{
if (rstabApp != null) rstabApp.close_connection();
}