Class OutputReader
Last update: 03.07.2024
Class OutputReader
Namespace: VM.Post.API.OutputReader
Assembly: VM.Post.API.OutputReader.dll
public class OutputReader : IOutputReader
Inheritance
Implements
IOutputReader
Constructors
OutputReader(string)
This is also used to open the result file using the constructor.
public OutputReader(string filepath)
Parameters
filepath
string
The path of dfr file
OutputReader(ResultDocument)
This is also used to open the result file using the constructor.
public OutputReader(ResultDocument document)
Parameters
document
ResultDocument
The instance of document
Properties
Path
File path to the Ansys Motion result file (.dfr). This can be a relative or absolute path.
public string Path { get; }
Property Value
Version
The Product version
public string Version { get; }
Property Value
Methods
Close()
Close result file.
public void Close()
CreateCoordinateSystem(string, string)
Create marker.
public GeneralMarker CreateCoordinateSystem(string newName, string parentFullName = "Ground")
Parameters
newName
string
Specifies the name of the marker.
parentFullName
string
Specifies the name of parent.
Returns
GeneralMarker
ExportAcousticRawDataToFile(string, string, BehaviorType, FFTParameters, uint[])
Export acoustic raw data to a file.
public void ExportAcousticRawDataToFile(string filepath, string fullName, BehaviorType behaviorType, FFTParameters parameters, uint[] nodeIDs)
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, Acceleration.
parameters
FFTParameters
For a description of parameter, see FFTParameters in the API Reference.
nodeIDs
uint[]
Specifies Id array of the node.
ExportAcousticRawDataToFile(string, string, BehaviorType, FFTParameters)
Export acoustic raw data to a file.
public void ExportAcousticRawDataToFile(string filepath, string fullName, BehaviorType behaviorType, FFTParameters parameters)
Parameters
filepath
string
Specifies the file path to export.
fullName
string
Specifies the name of the entity.
behaviorType
BehaviorType
Displacement, Velocity, Acceleration.
parameters
FFTParameters
For a description of parameter, see FFTParameters in the API Reference.
ExportContourResultToFile(string, FileMode, IList<int>, string, ContourMappingType, string, AnalysisResultType, FileFormatType)
Export contour results to a file.
public void ExportContourResultToFile(string resultpath, FileMode mode, IList<int> stateids, string fullName, ContourMappingType type, string path, AnalysisResultType analysisResultType = AnalysisResultType.Dynamics, FileFormatType formatType = FileFormatType.BINARY)
Parameters
resultpath
string
Specifies the file path to export.
mode
FileMode
Specifies how the operating system should open a file.
Specifies the id list of the states to time.
fullName
string
Specifies the names of the entities.
type
ContourMappingType
Specifies the type of the target for displaying contour.
path
string
Specifies the path of result to save.
analysisResultType
AnalysisResultType
Specifies the type of analysis result type for displaying contour.
formatType
FileFormatType
Specifies a file format type.
ExportContourResultToFile(string, FileMode, IList<int>, IList<string>, ContourMappingType, string, AnalysisResultType, FileFormatType)
Export contour results to a file.
public void ExportContourResultToFile(string resultpath, FileMode mode, IList<int> stateids, IList<string> fullNames, ContourMappingType type, string path, AnalysisResultType analysisResultType = AnalysisResultType.Dynamics, FileFormatType formatType = FileFormatType.BINARY)
Parameters
resultpath
string
Specifies the file path to export.
mode
FileMode
Specifies how the operating system should open a file.
Specifies the id list of the states to time.
Specifies The name of an entity.
type
ContourMappingType
Specifies the type of a target for displaying contour.
path
string
Specifies The path of result to save.
analysisResultType
AnalysisResultType
Specifies the type of analysis result type for displaying contour.
formatType
FileFormatType
Specifies a file format type.
ExportMarkerToFile(string, int[], IResultMarker[])
Export marker results to a file.
public void ExportMarkerToFile(string filePath, int[] stateids, IResultMarker[] markers)
Parameters
filePath
string
Specifies the file path to export.
stateids
int[]
Specifies the id list of the state to time.
markers
IResultMarker[]
Specifies the list of the entities.
ExportModalBodyRawDataToFile(string, string, bool, bool)
Export raw data about FE modal body to a file.
public void ExportModalBodyRawDataToFile(string filePath, string target, bool includeGeometry, bool includeModeShape)
Parameters
filePath
string
Specifies the file path to export.
target
string
Specifies the name of the entity.
includeGeometry
bool
Include geometry.
includeModeShape
bool
Include modeshape.
ExportVectorDisplayToFile(string, int[], IEnumerable<object>, bool, bool, bool, AnalysisResultType)
Export vector results to a file.
public void ExportVectorDisplayToFile(string filepath, int[] stateids, IEnumerable<object> targets, bool isIncludePosition, bool includeVector, bool includeMagnitude, AnalysisResultType analysisResultType)
Parameters
filepath
string
Specifies the file path to export.
stateids
int[]
Specifies the id list of the state to time.
targets
IEnumerable<object>
Specifies the list of the entity.
isIncludePosition
bool
include position.
includeVector
bool
include vector.
includeMagnitude
bool
include magnitude.
analysisResultType
AnalysisResultType
Specifies the type of analysis result type.
GetBodies(BodyType, bool)
Get the types and the names of the bodies.
public IEnumerable<(BodyType, string)> GetBodies(BodyType type, bool includeDuymmy = false)
Parameters
type
BodyType
NODAL, EF_NODAL, EF_MODAL, MODAL, RIGID, GROUND
includeDuymmy
bool
include dummy
Returns
IEnumerable<(BodyType, string)>
In the list, the report value are types and names of the bodies.
GetBodiesNodeCount(IList<string>)
Get the count of nodes for bodies
public long GetBodiesNodeCount(IList<string> bodyNames)
Parameters
Specifies the name list of the entities.
Returns
The report value is the count of nodes for bodies
GetConnectors(string)
Get the information of the connectors such as joint, force and contact
public IList<(ConnectorType, ActionType, string)> GetConnectors(string name)
Parameters
name
string
Specifies the name of the body.
Returns
IList<(ConnectorType, ActionType, string)>
In the list, the report value are connector type and action type and names of the connectors such as joint, force and contact.
GetContourResult(IList<int>, string, ContourMappingType, string, Action<int, IList<double[]>>, AnalysisResultType)
Export contour results to a file.
public void GetContourResult(IList<int> stateids, string fullName, ContourMappingType type, string path, Action<int, IList<double[]>> fncallback, AnalysisResultType analysisType = AnalysisResultType.Dynamics)
Parameters
Specifies the id list of the states to time.
fullName
string
Specifies The name of an entity.
type
ContourMappingType
Specifies the type of a target for displaying contour.
path
string
Specifies The path of result to save.
fncallback
Action<int, IList<double[]>>
Specifies the callback function for get contour result by report step.
analysisType
AnalysisResultType
Specifies the type of analysis result type for displaying contour.
GetContourResult(IList<int>, IList<string>, ContourMappingType, string, Action<int, IList<double[]>>, AnalysisResultType)
Export contour results to a file.
public void GetContourResult(IList<int> stateids, IList<string> fullNames, ContourMappingType type, string path, Action<int, IList<double[]>> fncallback, AnalysisResultType analysisType = AnalysisResultType.Dynamics)
Parameters
Specifies the id list of the states to time.
Specifies The name of an entity.
type
ContourMappingType
Specifies the type of a target for displaying contour.
path
string
Specifies The path of result to save.
fncallback
Action<int, IList<double[]>>
Specifies the callback function for get contour result by report step.
analysisType
AnalysisResultType
Specifies the type of analysis result type for displaying contour.
GetCurves(PlotParameters)
Get plot data.
public IDictionary<string, Point2D[]> GetCurves(PlotParameters parameters)
Parameters
parameters
PlotParameters
For a description of parameter, see PlotParameters in the API Reference.
Returns
IDictionary<string, Point2D[]>
The name of plot, List of X and Y data point of plot
GetFlexibleBodyReferenceFrame(string)
Get reference frame of FE body
public IList<double[]> GetFlexibleBodyReferenceFrame(string target)
Parameters
target
string
The flexible body name.
Returns
Postion and orientation array with the number of states
GetFrequenciesInfoArray()
public IList<(string path, double time, double[] frequencies)> GetFrequenciesInfoArray()
Returns
IList<(string path, double time, double[] frequencies)>
GetGeometryInfo(string)
Get geometry information
public IDataPart GetGeometryInfo(string target)
Parameters
target
string
Specifies the name of entity.
Returns
IDataPart
The report value is a geometry information.
GetGeometryInfoArray()
Get geometry information Array
public IEnumerable<BodyBase> GetGeometryInfoArray()
Returns
IEnumerable<BodyBase>
The report value is Enumerable.
GetGeometryNodes(string)
Get nodes of geometry
public double[] GetGeometryNodes(string path)
Parameters
path
string
Specifies the name of entity.
Returns
double[]
In the array, the report value is nodes of geometry.
GetMarkerInfo(string)
Get marker information (position, orientation, velocity, angular velocity, acceleration, angular acceleration).
public IList<double[]> GetMarkerInfo(string name)
Parameters
name
string
Specifies the name of the marker.
Returns
In the list, the report marker values from the start state to the end state are stored sequentially.
GetMarkerPosition(IList<string>)
Get marker position.
public IDictionary<string, IList<double[]>> GetMarkerPosition(IList<string> names)
Parameters
Specifies the list of the curve name to perform the operation.
Returns
IDictionary<string, IList<double[]>>
In the dictionary, the report marker positions value from the start state to the end state are stored sequentially.
GetModalModeCount(string)
Get the count of modes for FE modal body
public int GetModalModeCount(string target)
Parameters
target
string
Specifies the name of the entity.
Returns
The report value is count of modes for FE modal body
GetNamedSelections()
Get Named Selection Information
public NamedSelection[] GetNamedSelections()
Returns
NamedSelection[]
The report value is Enumerable.
GetOuterface(string)
Get geometry connectivity of an outface
public uint[] GetOuterface(string target)
Parameters
target
string
Specifies the name of entity.
Returns
uint[]
In the array, the report value is a geometry connectivity of an outface
GetPreviousBodiesNodeCount(IList<string>, string)
Get the count of nodes for bodies.
public long GetPreviousBodiesNodeCount(IList<string> bodyNames, string target)
Parameters
Specifies the name list of the body.
target
string
Specifies the name of the entity.
Returns
The report value is node count of the previous bodies.
GetPrimaryAnalysisResultType()
Get the type of primary analysis.
public AnalysisResultType GetPrimaryAnalysisResultType()
Returns
AnalysisResultType
Type of analysis.
GetReferenceTimeArray()
Get report times of result.
public IList<double> GetReferenceTimeArray()
Returns
In the list, the report time values from the start state to the end state are stored sequentially.
GetStateIDArray()
Get id array of state
public IList<int> GetStateIDArray()
Returns
In the list, the report id values of state from the start state to the end state are stored sequentially.
GetUnits()
Get units
public Dictionary<string, KeyValuePair<string, double>> GetUnits()
Returns
Dictionary<string, KeyValuePair<string, double>>
In the Dictionary, the units of result include type, unit and factor.
GetUnitsFromModeShapeFile(string)
Get unit information from dfmf file
public Dictionary<string, KeyValuePair<string, double>> GetUnitsFromModeShapeFile(string target)
Parameters
target
string
Returns
Dictionary<string, KeyValuePair<string, double>>
Key is Dimension and Value is pair for unit string and scale factor
GetVector(string, string)
Get vector results
public IDictionary<string, IVectorDisplayAnimationData> GetVector(string target, string path)
Parameters
target
string
Specifies the name of vector displayable entity
path
string
Specifies characteristc on vector display
Returns
IDictionary<string, IVectorDisplayAnimationData>
Vector results
GetVector(string, string, AnalysisResultType)
Get vector results
public IDictionary<string, IVectorDisplayAnimationData> GetVector(string target, string path, AnalysisResultType analysisResultType = AnalysisResultType.Dynamics)
Parameters
target
string
Specifies the name of vector displayable entity
path
string
Specifies characteristc on vector display
analysisResultType
AnalysisResultType
Specifies analysis result type on vector display
Returns
IDictionary<string, IVectorDisplayAnimationData>
Vector results
InterpolationAkimaSpline(double[], double[], int, int, double, double)
Get interpolate data series by using Akima spline method
public (InterpolationErrorType, double[], double[]) InterpolationAkimaSpline(double[] X, double[] Y, int NoOfPnt, int NoOfDesiredPnt, double StartPnt, double EndPnt)
Parameters
X
double[]
Specifies x array of plot data.
Y
double[]
Specifies y array of plot data.
NoOfPnt
int
Specifies the number of points.
NoOfDesiredPnt
int
Specifies the number of point desired.
StartPnt
double
Specifies the start point for using curve on plot data.
EndPnt
double
Specifies the end point for using curve on plot data.
Returns
(InterpolationErrorType, double[], double[])
array of X and Y data point of plot