Skip to main content

Motion Standalone Postprocessor C# library 2026 R1

Interface IOperationsDynamicAnalysisResultViewModel

Last update: 09.03.2026

Namespace: VM.Operations.Post.Interfaces
Assembly: VM.Operations.Post.dll

Interface representing information for the dynamic analysis result view model.

public interface IOperationsDynamicAnalysisResultViewModel : IOperationAnalysisResult

Implements

IOperationAnalysisResult

Examples

For an example that includes information about interfaces, see this example. To view the examples, refer to the location of the 'Install_Path\Motion\Document\Postprocessor API for Python.zip' file.

# IOperationsDynamicAnalysisResultViewModel.py
import sys

# Get the current file's path and set the path for external modules.
current_dir = __file__.rsplit('\\', 1)[0]
external_modules_path = current_dir + '\\..\\..\\Modules'
sys.path.append(external_modules_path)

# Import necessary modules
from OperationAPI import *

# Start the headless application interface
applicationHandler = ApplicationHandler()

# Import result file
result_file_path = get_result_file_path()

# Set array about result file
filepaths = List[str]()
filepaths.Add(result_file_path)

# Open about result files
# This will open the result file in the application.
# When the result is first opened, a Page is created and an Animation View is created on that Page.
applicationHandler.AddDocument(filepaths)

# Get all created pages.
# This retrieves all pages created in the application.
pages = applicationHandler.GetPages()

findViews = list()
for page in pages :
    views = page.GetViews()
    animationViews = [view for view in views if view.ViewType == ViewType.Animation]
    for animationView in animationViews :
        if animationView.DocumentFilePath == result_file_path and animationView.AnalysisResultType == AnalysisResultType.Dynamics :
            findViews.append(animationView)

# result_file_path - Get the document from the result file path.
document = applicationHandler.GetDocument(result_file_path)

# This retrieves the analysis result from the document.
# Types of Analysis Results
# - Dynamics
# - Eigenvalue
# - Statics
dynamic_analysis = document.GetAnalysisResultViewModel(AnalysisResultType.Dynamics)

stateIDs = dynamic_analysis.GetStateIDArray()
py_stateIDs= list(stateIDs)

skipIDs = List[int]()
for i in range(0, len(py_stateIDs), 2) :
    skipIDs.Add(py_stateIDs[i])

# Should the specific frame be loaded?
isFlagActive = True
if isFlagActive:
    dynamic_analysis.SetAnimationFrame(skipIDs)
else:
    timeArray = dynamic_analysis.GetReferenceTimeArray()
    py_timearray = list(timeArray)
    dynamic_analysis.SetAnimationFrame(len(py_timearray))

    # Moves the animation to the specified frame.
    dynamic_analysis.MoveToAnimationFrame(len(py_timearray) - 1)

# Create Vector Display
vector = dynamic_analysis.CreateVectorDisplay("TJ_01", "Base Force")
vector.IsLabel = True
vector.IsVisible = True
vector.LabelBackgroundColor = OperationAPIService.GetColorFrameRGB(255,255,255)
vector.LabelTextColor = OperationAPIService.GetColorFrameRGB(0,0,0)
vector.FullName = "TJ_VectorDisplay"
vector.IsLog = False
vector.Scale = 1000
vector.SetCharacteristic("Base Torque")
vector.Color = Colors.Blue

# Create Expression
expression = dynamic_analysis.CreateExpression("expression")
expression.Expression = "DM(\"Crank/CM\")"

# Get all created pages.
# This retrieves all pages created in the application.
pages = applicationHandler.GetPages()
for page in pages :
    page.Close()

# Close the Document
applicationHandler.CloseDocument(result_file_path)

Methods

CreateExpression(string)

Creates a new function expression in the Motion Postprocessor.

IOperationsPythonExpressionViewModel CreateExpression(string newName)

Parameters

newName string

The name of the new function expression to be created.

Returns

IOperationsPythonExpressionViewModel

An instance of representing the created function expression.

Examples

For an example that includes this property, see the Interface IOperationsDynamicAnalysisResultViewModel.

Remarks

This method allows the creation of a new function expression within the Motion Postprocessor. The newName parameter specifies the name of the new function expression instance.

CreateVectorDisplay(string, string)

Creates a vector display for the specified entity and characteristic. Please refer to this here link.

IOperationsVectorDisplayBaseViewModel CreateVectorDisplay(string entityName, string characteristic)

Parameters

entityName string

The name of the target entity for the vector display.

characteristic string

The name of the characteristic. Refer to the UI for Vector Display for available characteristics.

Returns

IOperationsVectorDisplayBaseViewModel

An instance of representing the created vector display.

Examples

For an example that includes this property, see the Interface IOperationsDynamicAnalysisResultViewModel.

Remarks

This method allows the creation of a vector display based on the specified entity and characteristic. The entityName parameter specifies the target entity for the vector display. The characteristic parameter specifies the characteristic to be displayed, which can be referred to in the UI for Vector Display.

SetAnimationFrame(int)

Sets a specified number of animation frames.

void SetAnimationFrame(int nFrames)

Parameters

nFrames int

The number of frames to load. This parameter should be within the range of 0 to the total number of frames available.

Examples

For an example that includes this property, see the Interface IOperationsDynamicAnalysisResultViewModel.

Remarks

This method sets the specified number of frames for the animation. The number of frames to load is specified by the nFrames parameter.

SetAnimationFrame(IEnumerable<int>)

Sets the specified animation frames based on the provided state IDs.

void SetAnimationFrame(IEnumerable<int> stateIDs)

Parameters

stateIDs IEnumerable<int>

An enumerable collection of state IDs representing the frames to load.

Examples

For an example that includes this property, see the Interface IOperationsDynamicAnalysisResultViewModel.

Remarks

This method sets only the specified frames for the animation, as indicated by the stateIDs parameter.

Connect with Ansys