Skip to main content
Namespace: VM.API.Post.Operations
Assembly: VM.API.Post.Operations.dll
This is the class to operate the OperationAPI.

Inheritance

object ← ApplicationHandler

Constructors

ApplicationHandler()

Initializes a new instance of the ApplicationHandler class, enabling the OperationAPI to function.

Examples

The following example demonstrates how to create an instance of the ApplicationHandler class:

Remarks

This constructor sets up the necessary configurations to allow the OperationAPI to operate.

Methods

AddDocument(IList<string>)

Imports results by adding documents to the UI.

Parameters

filepath IList<string> A list of file paths representing the results to be imported.

Examples

The following example demonstrates how to use the AddDocument method:

Remarks

This method takes a list of file paths as input parameters and imports the corresponding results into the UI.

AddPage(string)

Adds a new page with the specified name.

Parameters

name string The name of the page to be added. If no name is provided, a default name is used.

Returns

IPage An instance of IPage representing the newly added page.

Examples

The following example demonstrates how to use the AddPage method:

Remarks

This method adds a new page with the given name. If no name is provided, the page is created with a default name.

AddPlotView()

Adds a new plot view by creating a chart.

Returns

IOperationsLine2DViewModelBase An instance of IOperationsLine2DViewModelBase representing the newly added plot view.

Examples

The following example demonstrates the deprecated AddPlotView method and the recommended CreateChart method:

Remarks

This method creates a new chart. However, this method is deprecated and should no longer be used. Instead, use the CreateChart() method to create a chart.

Close()

Closes an open application.

Examples

The following example demonstrates how to use the Close method:

Remarks

This method closes an open application.

CloseDocument(string)

Closes an open document by its file path.

Parameters

filepath string The file path of the document to be closed.

Examples

The following example demonstrates how to use the CloseDocument method:

Remarks

This method closes an open document by its file path.

ClosePage(Guid)

Closes an open page by its ID.

Parameters

id Guid The ID of the page to be closed.

Examples

The following example demonstrates how to use the ClosePage method:

Remarks

This method closes an open page by its ID.

ClosePage(string)

Closes an open page by its name.

Parameters

name string The name of the page to be closed.

Examples

The following example demonstrates how to use the ClosePage method:

Remarks

This method closes an open page by its name.

ExportImage(IView, string, ImageFormat, double?, double?)

Exports the current image to a specified file format. This function saves the image to the given file path.

Parameters

viewViewModel IView Represents the target to be captured. filepath string The path where the image file will be saved. format ImageFormat The format in which the image will be saved. Supported formats are Png, Jpeg, and Bmp. The available options are:
  • Bmp
  • Jpeg
  • Png
width double? The optional width for the exported image. If not specified, the original width is used. height double? The optional height for the exported image. If not specified, the original height is used.

Examples

The following example demonstrates how to use the ExportImage method:

Remarks

This method allows you to export an image to a desired file path in a specified format. Supported formats are Png, Jpeg, and Bmp. You can also specify the desired dimensions for the exported image. If width or height is not provided, the original dimensions of the image will be used.

ExportImage(IView, string, ExportType, double?, double?)

Exports the current image to a specified file format. This function saves the image to the given file path.

Parameters

lineViewModel IView The view model to be exported. filepath string The file path where the image will be saved. exportType ExportType The type of export format (e.g., PNG, JPEG). width double? The optional width of the exported image. If not specified, the default width is used. height double? The optional height of the exported image. If not specified, the default height is used.

Examples

The following example demonstrates how to use the deprecated ExportImage method:

Remarks

This method exports the current view to an image file. However, this method is deprecated and should no longer be used.

GetActiveAnimationView()

Retrieves the active animation view from the current page.

Returns

IOperationsAnimation An instance of IOperationsAnimation representing the active animation view if it exists; otherwise, null.

Examples

The following example demonstrates how to use the deprecated GetActiveAnimationView method and the new method in IPage:

Remarks

This method retrieves the active animation view from the current page if it exists. However, this method is deprecated and should no longer be used. Instead, use the new method provided in the IPage interface.

GetActivePage()

Retrieves the active page.

Returns

IPage An instance of IPage representing the active page if one exists; otherwise, null.

Examples

The following example demonstrates how to use the GetActivePage method:

Remarks

This method searches for the currently active page among all pages. If no active page is found, the method returns null.

GetActivePlotView()

Retrieves the active chart view from the current page.

Returns

IOperationsLine2DViewModelBase An instance of IOperationsLine2DViewModelBase representing the active chart view if it exists; otherwise, null.

Examples

The following example demonstrates how to use the deprecated GetActivePlotView method and the new method in IPage:

Remarks

This method retrieves the active chart view from the current page if it exists. However, this method is deprecated and should no longer be used. Instead, use the new method provided in the IPage interface.

GetDocument(string)

Retrieves an open document by its file path.

Parameters

filepath string The file path of the document to be retrieved.

Returns

IOperationDocument An instance of IOperationDocument representing the document if it is open; otherwise, null.

Examples

The following example demonstrates how to use the GetDocument method:

Remarks

This method searches for an open document with the specified file path. If no such document is found, the method returns null.

GetPage(string)

Retrieves a page by its name.

Parameters

name string The name of the page to be retrieved.

Returns

IPage An instance of IPage representing the page if it is found; otherwise, null.

Examples

The following example demonstrates how to use the GetPage method:

Remarks

This method searches for a page with the specified name. If no such page is found, the method returns null.

GetPage(Guid)

Retrieves a page by its ID.

Parameters

id Guid The ID of the page to be retrieved.

Returns

IPage An instance of IPage representing the page if it is found; otherwise, null.

Examples

The following example demonstrates how to use the GetPage method:

Remarks

This method searches for a page with the specified ID. If no such page is found, the method returns null.

GetPages()

Retrieves all currently created pages.

Returns

IPage[] An array of IPage instances representing all currently created pages.

Examples

The following example demonstrates how to use the GetPages method:

Remarks

This method retrieves all currently created pages.

GetView(int)

Retrieves a view by its ID.

Parameters

id int The ID of the view to be retrieved.

Returns

IView An instance of IView representing the view if it is found; otherwise, null.

Examples

The following example demonstrates how to use the deprecated GetView method and the new GetView method in IPage:

Remarks

This method retrieves a view by its ID. However, this method is deprecated and should no longer be used. The functionality has been moved to the GetView() method.

GetView(string)

Retrieves a view by its name.

Parameters

name string The name of the view to be retrieved.

Returns

IView An instance of IView representing the view if it is found; otherwise, null.

Examples

The following example demonstrates how to use the deprecated GetView method and the new GetView method in IPage:

Remarks

This method retrieves a view by its name. However, this method is deprecated and should no longer be used. The functionality has been moved to the GetView() method.

ImportNumeric(IOperationsLine2DViewModelBase, string, List<INumericParameter>)

Import the numeric data from the file.​

Parameters

lineViewModel IOperationsLine2DViewModelBase The target plot view of the curve to import a numeric data​. filepath string The path to the file containing the exported curves. targets List<INumericParameter> A list of INumericParameter objects that specify the parameters for the curves to be created.

Examples

The following example demonstrates how to use the ImportNumeric method:

Remarks

This method reads curve data from the specified file and adds the corresponding curves to the chart view. Each INumericParameter 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.

RemoveDocument(string)

Closes an open document by its file path.

Parameters

filepath string The file path of the document to be closed.

Examples

The following example demonstrates how to use the deprecated RemoveDocument method and the new CloseDocument method:

Remarks

This method closes an open document by its file path. However, this method is deprecated and should no longer be used. Instead, use the CloseDocument() method to close documents.

RemoveView(string)

Removes a view by its name.

Parameters

viewName string The name of the view to be removed.

Examples

The following example demonstrates how to use the deprecated RemoveView method and the new RemoveView method in IPage:

Remarks

This method removes a view by its name if it exists. However, this method is deprecated and should no longer be used. The functionality has been moved to the CloseView() method.