Repository.Xfmea.AddItemToSystemHierarchy Method: Difference between revisions

From ReliaWiki
Jump to navigation Jump to search
(Created page with '{{Template:API}}{{Template:APIBreadcrumb|10|.Repository}} <onlyinclude>Saves a new XfmeaItem object to the current project. Returns a '…')
 
No edit summary
Line 29: Line 29:
   NewItem.Nm = {{APIString|"NewSubSystem"}}
   NewItem.Nm = {{APIString|"NewSubSystem"}}
   
   
  {{APIComment|'Add the new item to project #1, and position this new item under record ID #1.}}
  {{APIComment|'Add the new item to project #1 and position it under record ID #1.}}
  {{APIComment|'The new item will be visible in the Synthesis repository upon refresh.}}
  {{APIComment|'The new item will be visible in the Synthesis repository upon refresh.}}
   MyRepository.Project.SetCurrentProject(1)   
   MyRepository.Project.SetCurrentProject(1)   
Line 45: Line 45:
   NewItem.Nm = {{APIString|"NewSubSystem"}}
   NewItem.Nm = {{APIString|"NewSubSystem"}}
   
   
  {{APIComment|'Add the new item to project #1, and position this new item under record ID #1.}}
  {{APIComment|'Add the new item to project #1 and position it under record ID #1.}}
  {{APIComment|'The new item will be visible in the Synthesis repository upon refresh.}}
  {{APIComment|'The new item will be visible in the Synthesis repository upon refresh.}}
   MyRepository.Project.SetCurrentProject(1)   
   MyRepository.Project.SetCurrentProject(1)   
   MyRepository.Xfmea.AddItemToSystemHierarchy(NewItem,1)
   MyRepository.Xfmea.AddItemToSystemHierarchy(NewItem,1)

Revision as of 23:46, 21 July 2015

APIWiki.png


Member of: SynthesisAPI10.Repository


Saves a new XfmeaItem object to the current project. Returns a Boolean value; when true, indicates a successful save.

Syntax

.Xfmea.AddItemToSystemHierarchy(Item, ParentID)

Parameters

Item

The XfmeaItem object to be added. (Required)

ParentID

The record ID of the parent item. (Required)
The object will be saved as a next level item under the item with the specified record ID. You can view the record ID of all system hierarchy items by right-clicking the column headings, clicking Customize Columns, and then selecting the Record ID check box.


Example

This example assumes that a system hierarchy item with a record ID# 1 exists in the current project. The code creates a new system hierarchy item, and then saves it under the item with the said record ID.

VBA

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


 '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 record ID #1. 
 'The new item will be visible in the Synthesis repository upon refresh. 
 MyRepository.Project.SetCurrentProject(1)   
 Call MyRepository.Xfmea.AddItemToSystemHierarchy(NewItem,1)
VB.NET

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


 '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 record ID #1. 
 'The new item will be visible in the Synthesis repository upon refresh. 
 MyRepository.Project.SetCurrentProject(1)   
 MyRepository.Xfmea.AddItemToSystemHierarchy(NewItem,1)