Repository.Xfmea.GetAllXfmeaFunctions Method: Difference between revisions

From ReliaWiki
Jump to navigation Jump to search
(Created page with '{{Template:API}}{{Template:APIBreadcrumb|10|.Repository}} <onlyinclude>Gets a list of all existing FMEA functions in the current project. Returns an '''[[X…')
 
No edit summary
Line 2: Line 2:




<onlyinclude>Gets a list of all existing FMEA functions in the current project. Returns an '''[[XfmeaFunction Class|XfmeaFunction]]''' object array that contains the properties of the functions.</onlyinclude>   
<onlyinclude>Gets a list of all existing FMEA functions associated with a system hierarchy item. Returns an '''[[XfmeaFunction Class|XfmeaFunction]]''' object array that contains the properties of the functions.</onlyinclude>   


== Syntax ==
== Syntax ==
Line 25: Line 25:
   
   
    
    
  {{APIComment|'Get a list of all FMEA functions in project #1.}}
  {{APIComment|'Get a list of all FMEA functions associated with system hierarchy item #1 in project #1.}}
   {{APIPrefix|Dim}} ListofFunctions() {{APIPrefix|As}} XfmeaFunction
   {{APIPrefix|Dim}} ListofFunctions() {{APIPrefix|As}} XfmeaFunction
   MyRepository.Project.SetCurrentProject (1)   
   MyRepository.Project.SetCurrentProject (1)   
   ListofFunctions = MyRepository.Xfmea.GetAllXfmeaFunctions(1,{{APIPrefix|True}})
   ListofFunctions = MyRepository.Xfmea.GetAllXfmeaFunctions(1,{{APIPrefix|True}})
   
   
  {{APIComment|'Output sample: Display the description and ID number of the first available function in the project.}}
  {{APIComment|'Output sample: Display the number of elements in the array.}}
   {{APIPrefix|Dim}} FunctionDsc {{APIPrefix|As}} String
   {{APIPrefix|Dim}} NumberofElements {{APIPrefix|As}} Integer
   {{APIPrefix|Dim}} FunctionID {{APIPrefix|As}} String
   NumberofElements = UBound(ListofFunctions) - LBound(ListofFunctions) + 1
  FunctionDsc = ListofFunctions(0).Dsc
   MsgBox (NumberofElements)
  FunctionID = ListofFunctions(0).FunctionID
   MsgBox (FunctionDsc & {{APIString|": "}} & FunctionID)

Revision as of 15:03, 21 August 2015

APIWiki.png


Member of: SynthesisAPI10.Repository


Gets a list of all existing FMEA functions associated with a system hierarchy item. Returns an XfmeaFunction object array that contains the properties of the functions.

Syntax

.Xfmea.GetAllXfmeaFunctions(HID, IncludeLinkedAnalyses)

Parameters

HID

Integer. The Hierarchy ID or record ID of system hierarchy item. (Required)

IncludeLinkedAnalyses

Boolean. Indicates whether to include linked FMEAs in the array. (Required)


Example

This example assumes that system hierarchy items with FMEA functions exist in the first available project of a repository.

VBA|VB.NET

 'Add code to connect to a Synthesis repository. 
  Dim MyRepository As New Repository
  ... 

 
 'Get a list of all FMEA functions associated with system hierarchy item #1 in project #1. 
 Dim ListofFunctions() As XfmeaFunction
 MyRepository.Project.SetCurrentProject (1)  
 ListofFunctions = MyRepository.Xfmea.GetAllXfmeaFunctions(1,True)

 'Output sample: Display the number of elements in the array. 
 Dim NumberofElements As Integer
 NumberofElements = UBound(ListofFunctions) - LBound(ListofFunctions) + 1
 MsgBox (NumberofElements)