mjmiddle
Ansys Employee

Mechanical allows alive/dead status for an "Element Birth and Death" and "Contact Step Control." The following was tested in 2023 R2:

analysis = ExtAPI.DataModel.Project.Model.Analyses[0]
numSteps = analysis.AnalysisSettings.NumberOfSteps
elemBirthDeath = analysis.AddElementBirthAndDeath()
control = ["Alive", "Dead", "Alive", "Dead", "Dead"]    # list length needs to match number of steps
control = [eval("ElementControlsStatus."+cont) for cont in control]
with Transaction():
    for step in range(1, numSteps+1):
        elemBirthDeath.CurrentStep = step
        elemBirthDeath.Status = control[step-1]

Â