Assembly: VM.API.Post.Operations.dll This is the class to operate the OperationAPI.
Inheritance
object ← ApplicationHandlerExamples
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.Constructors
ApplicationHandler()
Initializes a new instance of the ApplicationHandler class, enabling the OperationAPI to function.Examples
For an example that includes this property, see the ApplicationHandler.Remarks
This constructor sets up the necessary configurations to allow the OperationAPI to operate.Properties
IsShowMessageBox
Gets or sets a flag that determines whether a message box should be displayed or skipped when the API is executedProperty Value
boolExamples
For an example that includes this property, see the ApplicationHandler.Remarks
When set to true, the message box will be shown during the execution of the API. When set to false, the message box will be skipped, and the process will continue without interruption. By default, the message box is not displayed.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
For an example that includes this property, see the ApplicationHandler.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
For an example that includes this property, see the ApplicationHandler.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
For an example that includes this property, see the ApplicationHandler.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
For an example that includes this property, see the ApplicationHandler.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
For an example that includes this property, see the ApplicationHandler.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
For an example that includes this property, see the ApplicationHandler.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
For an example that includes this property, see the ApplicationHandler.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
For an example that includes this property, see the ApplicationHandler.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
For an example that includes this property, see the ApplicationHandler.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
For an example that includes this property, see the ApplicationHandler.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
For an example that includes this property, see the ApplicationHandler.Remarks
This method searches for the currently active page among all pages. If no active page is found, the method returnsnull.
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
For an example that includes this property, see the ApplicationHandler.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
For an example that includes this property, see the ApplicationHandler.Remarks
This method searches for an open document with the specified file path. If no such document is found, the method returnsnull.
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
For an example that includes this property, see the ApplicationHandler.Remarks
This method searches for a page with the specified name. If no such page is found, the method returnsnull.
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
For an example that includes this property, see the ApplicationHandler.Remarks
This method searches for a page with the specified ID. If no such page is found, the method returnsnull.
GetPages()
Retrieves all currently created pages.Returns
IPage[] An array of IPage instances representing all currently created pages.Examples
For an example that includes this property, see the ApplicationHandler.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
For an example that includes this property, see the ApplicationHandler.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
For an example that includes this property, see the ApplicationHandler.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 imported curves. Supported file formats include (*.txt, *.csv, *.out, *.rsp).
targets List<INumericParameter>
A list of INumericParameter objects that specify the parameters for the curves to be created.
Examples
For an example that includes this property, see the ApplicationHandler.Remarks
This method reads curve data from the specified file and adds the corresponding curves to the chart view. Each INumericParameter in thetargets 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
For an example that includes this property, see the ApplicationHandler.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.