Repository.Xfmea.GetAllXfmeaFunctions Method: Difference between revisions

From ReliaWiki
Jump to navigation Jump to search
mNo edit summary
No edit summary
Line 2: Line 2:




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


== Syntax ==
== Syntax ==
Line 20: Line 20:
  '''VBA|VB.NET'''
  '''VBA|VB.NET'''
   
   
  {{APIComment|'Add code to connect to a Synthesis repository.}}
  {{APIComment|'Declare a new Repository object and connect to a Synthesis repository.}}
   {{APIPrefix|Dim}} MyRepository {{APIPrefix|As New}} Repository
   {{APIPrefix|Dim}} MyRepository {{APIPrefix|As New}} Repository
  {{APIComment|...}}
  MyRepository.ConnectToAccessRepository({{APIString|"C:\RSRepository1.rsr10"}})
 
 
  {{APIComment|'Get a list of all FMEA functions associated with system hierarchy item #1 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 number of elements in the array.}}
  {{APIComment|'Output sample: Display the number of elements in the array.}}
  {{APIPrefix|Dim}} NumberofElements {{APIPrefix|As}} Integer
  {{APIPrefix|Dim}} NumberofElements {{APIPrefix|As}} Integer
  NumberofElements = UBound(ListofFunctions) - LBound(ListofFunctions) + 1
  NumberofElements = UBound(ListofFunctions) - LBound(ListofFunctions) + 1
  MsgBox (NumberofElements)
  MsgBox (NumberofElements)

Revision as of 17:57, 8 April 2016

APIWiki.png


Member of: SynthesisAPI.Repository


Gets a list of FMEA functions associated with a system hierarchy item. Returns an XfmeaFunction object that represents the FMEA functions.

Syntax

.Xfmea.GetAllXfmeaFunctions(HID, IncludeLinkedAnalyses)

Parameters

HID

Required. Integer. The record ID of the system hierarchy item.

IncludeLinkedAnalyses

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


Example

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

VBA|VB.NET

 'Declare a new Repository object and connect to a Synthesis repository. 
  Dim MyRepository As New Repository
  MyRepository.ConnectToAccessRepository("C:\RSRepository1.rsr10")
  
 '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)