Extract information on time stepping

Pernelle Marone-Hitz
Pernelle Marone-Hitz Member, Moderator, Employee Posts: 871
100 Answers 500 Comments 250 Likes First Anniversary
✭✭✭✭
edited June 2023 in Structures

How can we extract information on time stepping settings in Mechanical, through scripting?

Tagged:

Answers

  • Pernelle Marone-Hitz
    Pernelle Marone-Hitz Member, Moderator, Employee Posts: 871
    100 Answers 500 Comments 250 Likes First Anniversary
    ✭✭✭✭
    edited December 2022 Answer ✓

    The following function can be used:

    def ExtractLoadStepInfo(analysis):
        '''
        Extract load stepping information
        '''
        listExtractLoadStepInfo = []
        settings = analysis.AnalysisSettings
        numberSteps = settings.NumberOfSteps
        for iterStep in range(1, numberSteps + 1):
            settings.CurrentStepNumber = iterStep
            AutomaticTimeStepping = settings.AutomaticTimeStepping
            DefineBy = settings.DefineBy
            if settings.DefineBy == TimeStepDefineByType.Substeps:
                InitialSubsteps = settings.InitialSubsteps
                MinimumSubsteps = settings.MinimumSubsteps
                MaximumSubsteps = settings.MaximumSubsteps
                listExtractLoadStepInfo.append([
                    str(AutomaticTimeStepping),
                    str(DefineBy),
                    str(InitialSubsteps),
                    str(MinimumSubsteps),
                    str(MaximumSubsteps)
                ])
            elif settings.DefineBy == TimeStepDefineByType.Time:
                InitialTimeStep = settings.InitialTimeStep
                MinimumTimeStep = settings.MinimumTimeStep
                MaximumTimeStep = settings.MaximumTimeStep
                listExtractLoadStepInfo.append([
                    str(AutomaticTimeStepping),
                    str(DefineBy),
                    str(InitialTimeStep),
                    str(MinimumTimeStep),
                    str(MaximumTimeStep)
                ])
        return listExtractLoadStepInfo