Skip to main content
Namespace: VM.Post.API.OutputReader
Assembly: VM.Post.API.OutputReader.dll
Represents the API class for reading result files.

Inheritance

object ← OutputReader

Implements

IOutputReader

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.

Remarks

This class provides methods to interact with and retrieve information from result files.

Constructors

OutputReader(string)

Initializes a new instance of the OutputReader class, used to open the result file.

Parameters

filepath string The path of the result file.

Examples

For an example that includes this property, see the OutputReader.

Remarks

This constructor opens the specified result file.

Properties

Path

Gets the file path to the Ansys Motion result file (.dfr).

Property Value

string

Examples

For an example that includes this property, see the OutputReader.

Remarks

This property stores the file path to the Ansys Motion result file (.dfr).

Version

Gets the product version.

Property Value

string

Examples

For an example that includes this property, see the OutputReader.

Remarks

This property stores the version of the product.

Methods

Close()

Closes the result file.

Examples

For an example that includes this property, see the OutputReader.

Remarks

This method closes the result file.

CreateCoordinateSystem(string, string)

Creates a new coordinate system marker with the specified name and optional parent.

Parameters

newName string The name of the new coordinate system marker. parentFullName string The full name of the parent marker. Defaults to GroundName.

Returns

GeneralMarker A GeneralMarker representing the newly created coordinate system marker.

Examples

The following example demonstrates how to use the CreateCoordinateSystem method:

Remarks

This method creates a new coordinate system marker with the given name. If the parent full name is not provided, it defaults to the ground marker name as defined by GroundName.

CreateVector(string, string, string)

Creates a vector for a specified target entity and characteristic path.

Parameters

newName string The name of the new vector. target string Specifies the name of the vector displayable entity. path string Specifies the characteristic on the vector display.

Returns

IVectorDisplay Returns an instance of the created vector.

Examples

The following example demonstrates how to use the GetVector method:

Remarks

This method creates a new vector. The method returns the instance of the newly created vector.

ExportAcousticRawDataToFile(string, string, BehaviorType, FFTParameters, uint[])

Exports acoustic raw data to a file.

Parameters

filepath string Specifies the file path to export. fullName string Specifies the name of the entity. behaviorType BehaviorType Specifies the type of the target for Displacement, Velocity, or Acceleration. The available options are:
  • Acceleration
  • Displacement
  • Velocity
parameters FFTParameters Specifies the FFT parameters. For a description of the parameters, see FFTParameters in the API Reference.
  • WindowType - The window type of FFT.
  • States - An array of state IDs from the result file.
  • Points - The number of data points for FFT.
nodeIDs uint[] Specifies the ID array of the nodes.

Examples

The following example demonstrates how to use the ExportAcousticRawDataToFile method:

Remarks

This method exports acoustic raw data to a specified file path.

ExportAcousticRawDataToFile(string, string, BehaviorType, FFTParameters)

Exports acoustic raw data to a file.

Parameters

filepath string Specifies the file path to export. fullName string Specifies the name of the entity. behaviorType BehaviorType Specifies the type of behavior for Displacement, Velocity, or Acceleration. The available options are:
  • Acceleration
  • Displacement
  • Velocity
parameters FFTParameters Specifies the FFT parameters. For a description of the parameters, see FFTParameters in the API Reference.
  • WindowType - The window type of FFT.
  • States - An array of state IDs from the result file.
  • Points - The number of data points for FFT.

Examples

The following example demonstrates how to use the ExportAcousticRawDataToFile method:

Remarks

This method exports acoustic raw data to a specified file path.

ExportContourResultToFile(string, FileMode, IList<int>, string, ContourMappingType, string, AnalysisResultType, FileFormatType)

Exports contour results to a file.

Parameters

resultpath string Specifies the file path to export. mode FileMode Specifies how the operating system should open a file. The available options are:
  • Append
  • CreateNew
  • Create
  • OpenOrCreate
  • Open
  • Truncate
stateids IList<int> Specifies the list of state IDs to time. fullName string Specifies the name of the entities. type ContourMappingType Specifies the type of the target for displaying contour. The available options are:
  • None
  • FENode
  • FEElement
  • FEElementNode
  • FEMaterial
  • BeamGroup
  • Contact
  • ChainedSystem
  • Usersubroutine
path string This is a combination of characteristic and component. analysisResultType AnalysisResultType Specifies the type of analysis result for displaying contour. The default value is Dynamics. The available options are:
  • Dynamics
  • Eigenvalue
  • Initial
  • LinearStatics
  • Statics
  • Thermal
  • ModeContribution
  • Nothing
formatType FileFormatType Specifies the file format type. The default value is BINARY. The available options are:
  • TXT
  • BINARY

Examples

The following example demonstrates how to use the ExportContourResultToFile method:

Remarks

This method exports contour results to a specified file path.

ExportContourResultToFile(string, FileMode, IList<int>, IList<string>, ContourMappingType, string, AnalysisResultType, FileFormatType)

Exports contour results to a file.

Parameters

resultpath string Specifies the file path to export. mode FileMode Specifies how the operating system should open a file. The available options are:
  • Append
  • CreateNew
  • Create
  • OpenOrCreate
  • Open
  • Truncate
stateids IList<int> Specifies the list of state IDs to time. fullNames IList<string> Specifies the names of the entities. type ContourMappingType Specifies the type of the target for displaying contour. The available options are:
  • None
  • FENode
  • FEElement
  • FEElementNode
  • FEMaterial
  • BeamGroup
  • Contact
  • ChainedSystem
  • Usersubroutine
path string This is a combination of characteristic and component. analysisResultType AnalysisResultType Specifies the type of analysis result for displaying contour. The default value is Dynamics. The available options are:
  • Dynamics
  • Eigenvalue
  • Initial
  • LinearStatics
  • Statics
  • Thermal
  • ModeContribution
  • Nothing
formatType FileFormatType Specifies the file format type. The default value is BINARY. The available options are:
  • TXT
  • BINARY

Examples

The following example demonstrates how to use the ExportContourResultToFile method:

Remarks

This method exports contour results to a specified file path.

ExportMarkerToFile(string, int[], IResultMarker[])

Exports marker results to a file.

Parameters

filePath string Specifies the file path to export. stateids int[] Specifies the list of state IDs to time. markers IResultMarker[] Specifies the list of the marker entities.

Examples

The following example demonstrates how to use the ExportMarkerToFile method:

Remarks

This method exports marker results to a specified file path.

ExportModalBodyRawDataToFile(string, string, bool, bool)

Exports raw data about the FE modal body to a file.

Parameters

filePath string Specifies the file path to export. target string Specifies the name of the entity. includeGeometry bool Specifies whether to include geometry data. includeModeShape bool Specifies whether to include mode shape data.

Examples

The following example demonstrates how to use the ExportModalBodyRawDataToFile method:

Remarks

This method exports raw data about the FE modal body to a specified file path, including options to include geometry and mode shape data.

ExportVectorDisplayToFile(string, int[], IEnumerable<object>, bool, bool, bool, AnalysisResultType)

Exports vector results to a file.

Parameters

filepath string Specifies the file path to export. stateids int[] Specifies the list of state IDs to time. targets IEnumerable<object> Specifies the list of the entities. isIncludePosition bool Specifies whether to include position data. includeVector bool Specifies whether to include vector data. includeMagnitude bool Specifies whether to include magnitude data. analysisResultType AnalysisResultType Specifies the type of analysis result.

Examples

The following example demonstrates how to use the ExportVectorDisplayToFile method:

Remarks

This method exports vector results to a specified file path.

ExportVectorDisplayToFile(string, int[], string, string, bool, bool, bool, AnalysisResultType)

Exports vector results to a file.

Parameters

filepath string Specifies the file path to export. stateids int[] Specifies the list of state IDs to time. target string Specifies the list of the entities. characteristic string The name of the characteristic. isIncludePosition bool Specifies whether to include position data. includeVector bool Specifies whether to include vector data. includeMagnitude bool Specifies whether to include magnitude data. analysisResultType AnalysisResultType Specifies the type of analysis result.

Examples

The following example demonstrates how to use the ExportVectorDisplayToFile method:

Remarks

This method exports vector results to a specified file path.

GetAssemblyInfo(AssemblyType)

Retrieves an array of state IDs representing sequential states.

Parameters

assemblyType AssemblyType The available options are:
  • All
  • ASSEMBLY_PART
  • ASSEMBLY_SUBSYSTEM
  • Mechanical_Rigid_Part

Returns

AssemblyInfo[]

Examples

The following example demonstrates how to use the CreateCoordinateSystem method:

GetBodies(BodyType, bool)

Retrieves the types and names of bodies based on the specified type and optional inclusion of dummy bodies.

Parameters

type BodyType Specifies the type of bodies to retrieve. The available options are:
  • RIGID
  • NODAL
  • MODAL
  • GROUND
  • EF_NODAL
  • EF_MODAL
includeDuymmy bool Specifies whether to include dummy bodies in the result.

Returns

IEnumerable<(BodyType, string)> An enumerable collection of tuples where each tuple contains a BodyType and its corresponding name.

Examples

The following example demonstrates how to use the GetBodies method:

Remarks

This method retrieves information about bodies based on the specified type and includes optional dummy bodies if specified. The returned collection contains tuples where each tuple represents a body type and its associated name.

GetBodiesNodeCount(IList<string>)

Gets the count of nodes for the specified bodies.

Parameters

bodyNames IList<string> Specifies the list of names of the entities.

Returns

long The count of nodes for the specified bodies.

Examples

The following example demonstrates how to use the GetBodiesNodeCount method:

Remarks

This method retrieves the count of nodes for the specified bodies.

GetConnectors(string)

Retrieves information about connectors associated with the specified body.

Parameters

name string The name of the body to retrieve connector information for.

Returns

IList<(ConnectorType, ActionType, string)> A list of tuples containing the connector type, action type, and names of connectors such as joint, force, and contact. The available connector type are:
  • Ball
  • BC
  • ConstantVelocity
  • CVCV
  • Cylindrical
  • Distance
  • Fixed
  • Inline
  • Inplane
  • Orientation
  • Parallel
  • Perpendicular
  • Plane
  • PTCV
  • PTS
  • Revolute
  • Screw
  • Translational
  • Universal
  • SixDOF
  • CYTMC
  • FTF2D
  • FTF3D
  • FTR2D
  • FTR3D
  • GENERAL
  • MCTMC
  • NTSF
  • RTR2D
  • RTR3D
  • SPTMC
  • TIE
  • Beam
  • Bush
  • ExternalForce
  • FECload
  • FEPload
  • Matrix
  • RScalar
  • RSpringDamper
  • Tire
  • TScalar
  • TSpringDamper
  • Vector
  • EFBC
  • EFCLoad
  • EFPLoad
  • EFRBE
  • EFTie
The available action type are:
  • Base
  • Action

Examples

The following example demonstrates how to use the GetConnectors method:

Remarks

This method retrieves and returns information about connectors associated with the body identified by the name parameter. The returned list includes tuples where each tuple consists of the connector type, action type, and names of connectors such as joint, force, and contact.

GetContourResult(IList<int>, string, ContourMappingType, string, Action<int, IList<double[]>>, AnalysisResultType)

Exports contour results to a file.

Parameters

stateids IList<int> Specifies the list of state IDs to time. fullName string Specifies the name of an entity. type ContourMappingType Specifies the type of a target for displaying contour. The available options are:
  • None
  • FENode
  • FEElement
  • FEElementNode
  • FEMaterial
  • BeamGroup
  • Contact
  • ChainedSystem
  • Usersubroutine
path string Specifies the path of the result file to save. fncallback Action<int, IList<double[]>> Specifies the callback function for getting contour results by report step. analysisType AnalysisResultType Specifies the type of analysis result for displaying contour. The default value is Dynamics. The available options are:
  • Dynamics
  • Eigenvalue
  • Initial
  • LinearStatics
  • Statics
  • Thermal
  • ModeContribution
  • Nothing

Examples

The following example demonstrates how to use the GetContourResult method:

Remarks

This method exports contour results to a specified file path.

GetContourResult(IList<int>, IList<string>, ContourMappingType, string, Action<int, IList<double[]>>, AnalysisResultType)

Exports contour results to a file.

Parameters

stateids IList<int> Specifies the list of state IDs to time. fullNames IList<string> Specifies the names of entities. type ContourMappingType Specifies the type of a target for displaying contour. The available options are:
  • None
  • FENode
  • FEElement
  • FEElementNode
  • FEMaterial
  • BeamGroup
  • Contact
  • ChainedSystem
  • Usersubroutine
path string Specifies the path of the result file to save. fncallback Action<int, IList<double[]>> Specifies the callback function for getting contour results by report step. analysisType AnalysisResultType Specifies the type of analysis result for displaying contour. The default value is Dynamics. The available options are:
  • Dynamics
  • Eigenvalue
  • Initial
  • LinearStatics
  • Statics
  • Thermal
  • ModeContribution
  • Nothing

Examples

The following example demonstrates how to use the GetContourResult method:

Remarks

This method exports contour results to a specified file path.

GetCurves(PlotParameters)

Retrieves plot data based on the specified plot parameters.

Parameters

parameter PlotParameters For a description of parameter, see PlotParameters in the API Reference. The parameters used for plotting the curves, including target entity, data paths, coordinate system, and plot data type.
  • Target - The target entity for plotting the curves.
  • PlotDataType - Default or Plot Data.
  • Paths - An Paths representing the paths to the data to be read. This is a combination of characteristic and component.
  • CSYS - The coordinate system to be used.

Returns

IDictionary<string, Point2D[]> A dictionary containing plot data where each key represents the name or identifier of the curve, and each value is an array of Point2D representing the plot points (x, y). The name of plot, List of X and Y data point of plot

Examples

The following example demonstrates how to use the GetCurves method:

Remarks

This method retrieves and returns plot data based on the provided plot parameters. It generates x and y coordinates for each curve specified in the parameters.

GetEntities(EntityType)

Retrieves all entities of the specified type.

Parameters

entityType EntityType The type of the entities to be retrieved.

Returns

IEnumerable<EntityBase> An IEnumerable`1 containing all entities of the specified type.

Examples

For an example that includes this property, see the OutputReader.

Remarks

This method retrieves all entities that match the specified entity type. The available options are:
  • Unknown
  • Actuator
  • AssemblyInfo
  • AssemblyManager
  • BeamGroup
  • BearingSet
  • Body
  • ChainedSystem
  • Constraint
  • Contact
  • Contour
  • CSYS
  • EasyFlexEntity
  • DataElementSet
  • Expression
  • Element
  • ElementSet
  • FEProperty
  • FODEquation
  • Force
  • Frequency
  • FrequencySequence
  • FrequencyTime
  • GearSet
  • InputChannel
  • GearPair
  • Marker
  • Material
  • OutputChannel
  • Node
  • PythonExpression
  • Request
  • SeaLevel
  • ShaftSet
  • SInput
  • SODEquation
  • SOutput
  • Spline
  • UserSubroutine
  • VariableEquation
  • VehicleRoad
  • VectorDisplay
  • NamedSelection
  • FatigueMaterial

GetFlexibleBodyReferenceFrame(string, bool)

Gets the reference frame of a flexible body.

Parameters

target string The name of the flexible body. recalculateOrientation bool Get the orientation from element reference frame instead of FE body reference frame

Returns

IList<double[]> Postion and orientation array with the number of states.

Examples

The following example demonstrates how to use the GetFlexibleBodyReferenceFrame method:

Remarks

This method retrieves the reference frame of the specified flexible body.

GetFrequenciesInfoArray()

Retrieves information about all instances of frequencies.

Returns

IList<(string path, double time, double[] frequencies)> A list containing tuples where each tuple contains:
  • String path: The file path of the frequency instance.
  • Double time: The available sampling time.
  • IEnumerable`1 frequencies: An array of doubles representing the frequencies for the specified sampling time index.

Examples

The following example demonstrates how to use the GetFrequenciesInfoArray method:

Remarks

This method retrieves and returns information about all instances of frequencies, including their file paths, available sampling times, and corresponding frequency arrays.

GetGeometryInfo(string)

Gets the geometry information for a specified entity.

Parameters

target string Specifies the name of the entity.

Returns

IDataPart An instance of IDataPart containing the geometry information.

Examples

The following example demonstrates how to use the GetGeometryInfo method:

Remarks

This method retrieves the geometry information for the specified entity.

GetGeometryInfoArray()

Gets an array of geometry information.

Returns

IEnumerable<BodyBase> An IEnumerable`1 containing the geometry information.

Examples

The following example demonstrates how to use the GetGeometryInfoArray method:

Remarks

This method retrieves an array of geometry information for all entities.

GetGeometryNodes(string)

Gets the nodes of a specified geometry.

Parameters

target string Specifies the path of the entity.

Returns

double[] An array of doubles representing the nodes of the geometry.

Examples

The following example demonstrates how to use the GetGeometryNodes method:

Remarks

This method retrieves the nodes of the specified geometry entity.

GetMarkerInfo(string)

Gets the marker information including position, orientation, velocity, angular velocity, acceleration, and angular acceleration.

Parameters

name string Specifies the name of the marker.

Returns

IList<double[]> A list of double arrays representing the marker values from the start state to the end state, stored sequentially.

Examples

The following example demonstrates how to use the GetMarkerInfo method:

Remarks

This method retrieves detailed information about the specified marker, including its position, orientation, velocity, angular velocity, acceleration, and angular acceleration.

GetMarkerPosition(IList<string>)

Gets the marker positions for the specified list of marker names.

Parameters

names IList<string> Specifies the list of marker names to retrieve positions for.

Returns

IDictionary<string, IList<double[]>> A dictionary where each key is a marker name and the value is a list of double arrays representing marker positions from the start state to the end state, stored sequentially.

Examples

The following example demonstrates how to use the GetMarkerPosition method:

Remarks

This method retrieves the positions of markers identified by the provided list of names. Each entry in the dictionary corresponds to a marker name and contains its position values over time.

GetModalModeCount(string)

Retrieves the count of modes for the finite element modal body specified by its name.

Parameters

target string The name of the entity representing the finite element modal body.

Returns

int The number of modes available for the specified finite element modal body.

Examples

The following example demonstrates how to use the GetModalModeCount method:

Remarks

This method retrieves and returns the count of modes available for the specified finite element modal body, identified by its name passed as the target parameter.

GetNamedSelections()

Gets the named selection information.

Returns

NamedSelection[] An array of NamedSelection instances representing the named selections.

Examples

The following example demonstrates how to use the GetNamedSelections method:

Remarks

This method retrieves the named selection information for the entities.

GetOuterface(string)

Gets the geometry connectivity of an outer face.

Parameters

target string Specifies the name of the entity.

Returns

uint[] An array of unsigned integers representing the geometry connectivity of the outer face.

Examples

The following example demonstrates how to use the GetOuterface method:

Remarks

This method retrieves the geometry connectivity information for the outer face of the specified entity. The connectivity is structured in a triangular patch form, allowing for efficient representation and manipulation of 3D surface geometries. Each set of three consecutive integers in the array represents a triangle in the patch.

GetPreviousBodiesNodeCount(IList<string>, string)

Gets the count of nodes for the specified bodies before a certain entity.

Parameters

bodyNames IList<string> Specifies the list of names of the bodies. target string Specifies the name of the entity.

Returns

long The count of nodes for the previous bodies.

Examples

The following example demonstrates how to use the GetPreviousBodiesNodeCount method:

Remarks

This method retrieves the count of nodes for the specified bodies that are processed before the specified entity.

GetPrimaryAnalysisResultType()

Retrieves the type of the primary analysis result.

Returns

AnalysisResultType The type of the primary analysis result. If no primary analysis result is available, returns Nothing. The available analysis are:
  • Dynamics
  • Eigenvalue
  • Initial
  • LinearStatics
  • Statics
  • Thermal
  • ModeContribution
  • Nothing

Examples

The following example demonstrates how to use the GetPrimaryAnalysisResultType method:

Remarks

This method retrieves and returns the type of the primary analysis result from the source data. If the primary analysis result is not set or available, it returns Nothing.

GetReferenceTimeArray()

Retrieves an array of reference times from the result report.

Returns

IList<double> A list of doubles representing time values from the start state to the end state sequentially.

Examples

The following example demonstrates how to use the GetReferenceTimeArray method:

Remarks

This method retrieves an array of time values that correspond to sequential states within the result report. The times are stored in a list in sequential order.

GetStateIDArray()

Get id array of state

Returns

IList<int> A list of integers representing state IDs from the start state to the end state sequentially.

Examples

The following example demonstrates how to use the GetStateIDArray method:

Remarks

This method retrieves an array of state IDs that correspond to sequential states within the system. The IDs are stored in a list in sequential order.

GetUnits()

Retrieves units of results including type, unit, and factor.

Returns

Dictionary<string, KeyValuePair<string, double>> A dictionary where:
  • The key is the type of the result.
  • The value is a key-value pair where:
    • Key: The unit of the result.
    • Value: The factor associated with the unit.

Examples

The following example demonstrates how to use the GetUnits method:

Remarks

This method returns units associated with different types of results. The dictionary contains entries where each key represents a type of result, and each value is a key-value pair consisting of the unit and its corresponding factor.

GetUnitsFromModeShapeFile(string)

Retrieves unit information from a dfmf file for a specified target.

Parameters

target string Specifies the target entity for which unit information is retrieved.

Returns

Dictionary<string, KeyValuePair<string, double>> A dictionary where:
  • Key: Dimension of the result (e.g., length, time).
  • Value: A key-value pair where:
    • Key: The unit string associated with the dimension.
    • Value: The scale factor for converting the unit.

Examples

The following example demonstrates how to use the GetUnitsFromModeShapeFile method:

Remarks

This method retrieves unit information from a dfmf file specifically for mode shapes. The dictionary contains entries where each key represents a dimension of the result (e.g., length, time), and each value is a key-value pair consisting of the unit string and its corresponding scale factor.

GetVector(string, string)

Retrieves vector results for a specified target entity and characteristic path.

Parameters

target string Specifies the name of the vector displayable entity. path string Specifies the characteristic on the vector display.

Returns

IDictionary<string, IVectorDisplayAnimationData> A dictionary where:
  • Key: String identifier associated with the vector data.
  • Value: Object implementing IVectorDisplayAnimationData interface, containing vector display animation data.

Examples

The following example demonstrates how to use the GetVector method:

Remarks

This method retrieves vector results for a specified entity and characteristic path. The returned dictionary contains entries where each key represents a string identifier associated with the vector data, and each value is an object that implements the IVectorDisplayAnimationData interface, containing animation data specific to the vector display.

GetVector(string, string, AnalysisResultType)

Retrieves vector results for a specified target entity, characteristic path, and analysis result type.

Parameters

target string Specifies the name of the vector displayable entity. path string Specifies the characteristic on the vector display. analysisResultType AnalysisResultType Specifies the type of analysis result for the vector display. The available options are:
  • Dynamics
  • Eigenvalue
  • Initial
  • LinearStatics
  • Statics
  • Thermal
  • ModeContribution
  • Nothing

Returns

IDictionary<string, IVectorDisplayAnimationData> A dictionary where:
  • Key: String identifier associated with the vector data.
  • Value: Object implementing IVectorDisplayAnimationData interface, containing vector display animation data.

Examples

The following example demonstrates how to use the GetVector method:

Remarks

This method retrieves vector results for a specified entity, characteristic path, and analysis result type. The returned dictionary contains entries where each key represents a string identifier associated with the vector data, and each value is an object that implements the IVectorDisplayAnimationData interface, containing animation data specific to the vector display.

InterpolationAkimaSpline(double[], double[], int, int, double, double)

Interpolates data series using the Akima spline method.

Parameters

X double[] The array of x-values representing plot data. Y double[] The array of y-values representing plot data. NoOfPnt int The number of points in the original data series. NoOfDesiredPnt int The number of points desired in the interpolated data series. StartPnt double The start point for using the curve on the plot data. EndPnt double The end point for using the curve on the plot data.

Returns

(InterpolationErrorType, double[], double[]) A tuple containing:
  • An InterpolationErrorType indicating the interpolation error type.
    • DUPLICATE_X - The target entity for plotting the curves.
    • SUCCESS - Default or Plot Data.
  • An array of x-values representing the interpolated data points.
  • An array of y-values representing the interpolated data points.

Examples

The following example demonstrates how to use the InterpolationAkimaSpline method:

Remarks

This method interpolates the given data series using the Akima spline interpolation method. It returns the interpolated x and y data points based on the specified parameters.