In the HyperSizer API, User Constant values can be modified through setting the properties of the UserConstant class.
def SettingUserConstantValues(component, userConstantName, userConstantValue):
"""Edit HyperSizer User Constants."""
userConstantCol = component.UserConstants
userConstant = userConstantCol.GetUserConstant(userConstantName)
if isinstance(userConstantValue, float):
userConstant.Value = userConstantValue
elif isinstance(userConstantValue, str):
userConstant.Value = userConstantValue
component.Save()
In the HyperX Scripting API, Failure Mode Analysis Settings values can be modified using the FailureModeSetting.SetTypeValue() method.
Note
Depending on the type of the Analysis Setting, a different SetTypeValue() method will be needed to be called.
import hyperx as hx
def SettingFailureModeSettings(hxApp: hx.Application):
"""Edit failure mode settings by specifiying the name of the setting."""
failureMode = hxApp.FailureModes.CreateFailureMode("Panel Buckling")
# Selection-based setting (with drop-down menu).
failureModeSetting = failureMode.Settings.Get("Panel Buckling Knockdown Mode")
failureModeSetting.SetSelectionValue(1)
# Floating point setting.
failureModeSetting = failureMode.Settings.Get("Constant buckling knockdown factor")
failureModeSetting.SetFloatValue(3.2)
# Boolean setting (check box).
failureModeSetting = failureMode.Settings.Get("Include Transverse Shear Flexibility")
failureModeSetting.SetBoolValue(False)