You can write your own M2Doc services by adding JavaScript scripts to your project. For more information about scripts in medini analyze, see the "Ansys medini™ analyze Scripting and API Documentation" guide.
In writing M2Doc services, note that:
Trailing numerical characters, such as the
2in the function namefoo2(a,b), are interpreted as defining the number of parameters. These numbers are removed from the actual service name. No number means there is a default of one parameter.The first parameter is always the calling object. If there is only one parameter, there are no additional parameters in the parentheses ( ) of the service.
Using M2Doc services for FMEA, you can access entries in an FMEA worksheet. After assigning the measure group to a variable in your M2Doc document, you can call certain entries.
Examples
RPN:
{ m:measureGroup.riskPriorityNumber() }
Revised RPN:
{ m:measureGroup.revisedRiskPriorityNumber() }
Risk Class:
{ m:measureGroup.severityClass() }
Action Priority:
{ m:measureGroup.actionPriority() }
Revised Action Priority:
{ m:measureGroup.revisedActionPriority() }
The M2Doc services spfMetric and dangerousFailureRate are
available for FMEDA. You can use these to access the SPF (Single Point Fault) and DFR
(Dangerous Failure Rate) metrics respectively in FMEDA worksheets.
Each service takes two parameters, the safety goal and the variant. Note that using
null as a parameter is allowed, but can lead to an NaN (not a
number) result.
Examples
SPF metric for variant x:
{ m:dcSheet.spfMetric(null, dcSheet.variants->at(x)) }
SPF metric for safetyGoalA in variant x:
{ m:dcSheet.spfMetric(safetyGoalA, dcSheet.variants->at(x)) }
DFR metric for variant y:
{ m:dcSheet.dangerousFailureRate(null, dcSheet.variants->at(y)) }
DFR metric for safetyGoalB in variant y:
{ m:dcSheet.dangerousFailureRate(safetyGoalB, dcSheet.variants->at(y))
}