> ## Documentation Index
> Fetch the complete documentation index at: https://developer.synopsys.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Interface IOperationsDynamicAnalysisResultViewModel

Namespace: [VM.Operations.Post.Interfaces](https://developer.synopsys.com/docs/motion/motion-standalone-postprocessor-c-sharp-library/2025-r2/lib/VM.Operations.Post.Interfaces)\
Assembly: VM.Operations.Post.dll

Interface representing information for the dynamic analysis result view model.

```python theme={null}
public interface IOperationsDynamicAnalysisResultViewModel : IOperationAnalysisResultViewModel, IOperationsBase
```

#### Implements

[IOperationAnalysisResultViewModel](https://developer.synopsys.com/docs/motion/motion-standalone-postprocessor-c-sharp-library/2025-r2/lib/VM.Operations.Post.Interfaces.IOperationAnalysisResultViewModel.md),
[IOperationsBase](https://developer.synopsys.com/docs/motion/motion-standalone-postprocessor-c-sharp-library/2025-r2/lib/VM.Operations.Post.Interfaces.IOperationsBase.md)

## 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.

```python theme={null}
# IOperationsDynamicAnalysisResultViewModel.py
import sys

current_dir = __file__.rsplit('\\', 1)[0]
external_modules_path = current_dir + '\\..\\..\\Modules'

sys.path.append(external_modules_path)
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
applicationHandler.AddDocument(filepaths)

# Find Page
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)

document = applicationHandler.GetDocument(result_file_path)
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\")"

# Close the Pages
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.

```python theme={null}
IOperationsPythonExpressionViewModel CreateExpression(string newName)
```

#### Parameters

`newName` [string](https://learn.microsoft.com/dotnet/api/system.string)

The name of the new function expression to be created.

#### Returns

[IOperationsPythonExpressionViewModel](https://developer.synopsys.com/docs/motion/motion-standalone-postprocessor-c-sharp-library/2025-r2/lib/VM.Operations.Post.Interfaces.IOperationsPythonExpressionViewModel.md)

An instance of [IOperationsPythonExpressionViewModel](https://developer.synopsys.com/docs/motion/motion-standalone-postprocessor-c-sharp-library/2025-r2/lib/VM.Operations.Post.Interfaces.IOperationsPythonExpressionViewModel.md) representing the created function expression.

#### Examples

For an example that includes this property, see the [Interface IOperationsDynamicAnalysisResultViewModel](https://developer.synopsys.com/docs/motion/motion-standalone-postprocessor-c-sharp-library/2025-r2/lib/VM.Operations.Post.Interfaces.IOperationsDynamicAnalysisResultViewModel.md).

#### 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](https://developer.synopsys.com/docs/motion/motion-standalone-postprocessor-c-sharp-library/2025-r2/getting_started_operation_api_using_py.md#how-to-input-the-value-of-the-target-into-the-function-parameter) link.

```python theme={null}
IOperationsVectorDisplayBaseViewModel CreateVectorDisplay(string entityName, string characteristic)
```

#### Parameters

`entityName` [string](https://learn.microsoft.com/dotnet/api/system.string)

The name of the target entity for the vector display.

`characteristic` [string](https://learn.microsoft.com/dotnet/api/system.string)

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

#### Returns

[IOperationsVectorDisplayBaseViewModel](https://developer.synopsys.com/docs/motion/motion-standalone-postprocessor-c-sharp-library/2025-r2/lib/VM.Operations.Post.Interfaces.IOperationsVectorDisplayBaseViewModel.md)

An instance of [IOperationsVectorDisplayBaseViewModel](https://developer.synopsys.com/docs/motion/motion-standalone-postprocessor-c-sharp-library/2025-r2/lib/VM.Operations.Post.Interfaces.IOperationsVectorDisplayBaseViewModel.md) representing the created vector display.

#### Examples

For an example that includes this property, see the [Interface IOperationsDynamicAnalysisResultViewModel](https://developer.synopsys.com/docs/motion/motion-standalone-postprocessor-c-sharp-library/2025-r2/lib/VM.Operations.Post.Interfaces.IOperationsDynamicAnalysisResultViewModel.md).

#### 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.

```python theme={null}
void SetAnimationFrame(int nFrames)
```

#### Parameters

`nFrames` [int](https://learn.microsoft.com/dotnet/api/system.int32)

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](https://developer.synopsys.com/docs/motion/motion-standalone-postprocessor-c-sharp-library/2025-r2/lib/VM.Operations.Post.Interfaces.IOperationsDynamicAnalysisResultViewModel.md).

#### 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.

```python theme={null}
void SetAnimationFrame(IEnumerable<int> stateIDs)
```

#### Parameters

`stateIDs` [IEnumerable](https://learn.microsoft.com/dotnet/api/system.collections.generic.ienumerable-1)\<[int](https://learn.microsoft.com/dotnet/api/system.int32)>

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

#### Examples

For an example that includes this property, see the [Interface IOperationsDynamicAnalysisResultViewModel](https://developer.synopsys.com/docs/motion/motion-standalone-postprocessor-c-sharp-library/2025-r2/lib/VM.Operations.Post.Interfaces.IOperationsDynamicAnalysisResultViewModel.md).

#### Remarks

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