Repository.Xfmea.AddItemToSystemHierarchy Method

From ReliaWiki
Revision as of 16:02, 8 April 2016 by Kate Racaza (talk | contribs)
Jump to navigation Jump to search
APIWiki.png


Member of: SynthesisAPI.Repository


Adds a new system hierarchy item to a project. Returns a Boolean value; when true, indicates a successful save.

Syntax

.Xfmea.AddItemToSystemHierarchy(Item, ParentID)

Parameters

Item

Required. The XfmeaItem object to be added.

ParentID

Required. Integer. The record ID of the parent item. The object will be saved as a next level item under the parent item.


Example

This example assumes that system hierarchy items exist in the first available project of repository. The code creates a new system hierarchy item, and then saves it to the repository.

VBA

 'Declare a new Repository object and connect to a Synthesis repository. 
  Dim MyRepository As New Repository
  MyRepository.ConnectToAccessRepository("C:\RSRepository1.rsr10")
 
 'Create a new system hierarchy item. The following example creates an item called "NewSubsystem." 
  Dim NewItem As New XfmeaItem
  NewItem.Nm = "NewSubSystem"

 'Add the new item to project #1 and position it under system hierarchy item #1. 
  MyRepository.Project.SetCurrentProject(1)   
  Call MyRepository.Xfmea.AddItemToSystemHierarchy(NewItem,1)
VB.NET

 'Declare a new Repository object and connect to a Synthesis repository. 
  Dim MyRepository As New Repository
  MyRepository.ConnectToAccessRepository("C:\RSRepository1.rsr10")

 'Create a new system hierarchy item. The following example creates an item called "NewSubsystem." 
  Dim NewItem As New XfmeaItem
  NewItem.Nm = "NewSubSystem"

 'Add the new item to project #1 and position it under system hierarchy item #1. 
  MyRepository.Project.SetCurrentProject(1)   
  MyRepository.Xfmea.AddItemToSystemHierarchy(NewItem,1)