September 23, 2023 at 2:12 am
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]
Â