Repository.Xfmea.GetItemInSystemHierarchy Method: Difference between revisions

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




<onlyinclude>Gets the system hierarchy item with the designated ID number and returns it as an '''[[XfmeaItem Class|XfmeaItem]]''' object.</onlyinclude>   
<onlyinclude>Returns an '''[[XfmeaItem Class|XfmeaItem]]''' object, which represents an Xfmea, RCM++ or RBI system hierarchy item.</onlyinclude>   


== Syntax ==
== Syntax ==
Line 17: Line 17:
  '''VBA'''
  '''VBA'''
   
   
  {{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 system hierarchy item #1 from project #1.}}
  {{APIComment|'Get system hierarchy item #1 from project #1.}}
   {{APIPrefix|Dim}} Item {{APIPrefix|As}} XfmeaItem
   {{APIPrefix|Dim}} Item {{APIPrefix|As}} XfmeaItem
Line 32: Line 31:
  '''VB.NET'''
  '''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 system hierarchy item #1 from project #1.}}
  {{APIComment|'Get system hierarchy item #1 from project #1.}}
   {{APIPrefix|Dim}} Item {{APIPrefix|As}} XfmeaItem
   {{APIPrefix|Dim}} Item {{APIPrefix|As}} XfmeaItem

Revision as of 17:18, 8 April 2016

APIWiki.png


Member of: SynthesisAPI10.Repository


Returns an XfmeaItem object, which represents an Xfmea, RCM++ or RBI system hierarchy item.

Syntax

.Xfmea.GetItemInSystemHierarchy(HID)

Parameters

HID

Required. Integer. The record ID number of the system hierarchy item to retrieve.


Example

This example assumes that a system hierarchy item with ID#1 exists in the first available project of a repository.

VBA

 'Declare a new Repository object and connect to a Synthesis repository. 
  Dim MyRepository As New Repository
  MyRepository.ConnectToAccessRepository("C:\RSRepository1.rsr10")
  
 'Get system hierarchy item #1 from project #1. 
  Dim Item As XfmeaItem
  MyRepository.Project.SetCurrentProject (1)  
  Set Item = MyRepository.Xfmea.GetItemInSystemHierarchy(1)

 'Output sample: Display the name of the item. 
  MsgBox (Item.Nm)
VB.NET

 'Declare a new Repository object and connect to a Synthesis repository. 
  Dim MyRepository As New Repository
  MyRepository.ConnectToAccessRepository("C:\RSRepository1.rsr10")
  
 'Get system hierarchy item #1 from project #1. 
  Dim Item As XfmeaItem
  MyRepository.Project.SetCurrentProject (1)  
  Item = MyRepository.Xfmea.GetItemInSystemHierarchy(1)

 'Output sample: Display the name of the item. 
  MsgBox (Item.Nm)