Skip to main content

Motion Standalone Postprocessor C# library 2025 R2

Interface IOperationsChartViewModel

Last update: 16.07.2025

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

Represents the base interface for properties and methods that make up a chart view.

public interface IOperationsChartViewModel : IView, IOperationsBase

Implements

IView, IOperationsBase

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.

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

# Get Page
page = applicationHandler.GetActivePage()

# Create PlotView
chartView = page.CreateChart("Chart")

chartView.Legend.Background = Colors.Red
chartView.Legend.FontColor = Colors.Black
chartView.Legend.FontFace = FontFamily("Arial")
chartView.Legend.FontSize = 15
chartView.Legend.FontStyle = OperationAPIService.GetFontStyleFromString("Italic")
chartView.Legend.FontWeight = OperationAPIService.GetFontWeightFromString("Bold")
chartView.Legend.LegendPlacement = LegendPlacementType.Bottom
chartView.Legend.ItemsInFilter = "Visible Curves"

# Close the Pages
page.Close()

# Close Document
applicationHandler.CloseDocument(result_file_path)

Properties

Legend

Get or sets the legend for the chart.

IOperationsLegendModifier Legend { get; }

Property Value

IOperationsLegendModifier

Examples

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

Remarks

The Legend property allows you to control the appearance and behavior of the chart's legend. Through this property, you can access various attributes of the legend and adjust them to fit your specific requirements.

Methods

ImportNumeric(string, List<INumericParameter>)

Imports curve data from an external file and adds the curves to the chart view.

void ImportNumeric(string filepath, List<INumericParameter> targets)

Parameters

filepath string

The path to the file containing the exported curves. Supported file formats include (*.txt, *.csv, *.out, *.rsp).

targets List<INumericParameter>

A list of objects that specify the parameters for the curves to be created.

Examples

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

Remarks

This method reads curve data from the specified file and adds the corresponding curves to the chart view. Each in the targets list contains the following properties:

  • NameThe name of the curve to be created.
  • TargetXThe path to the data for the X-axis.
  • TargetYThe path to the data for the Y-axis.

Connect with Ansys