Repository.Xfmea.AddItemToSystemHierarchy Method: Difference between revisions
Jump to navigation
Jump to search
Kate Racaza (talk | contribs) No edit summary |
Kate Racaza (talk | contribs) No edit summary |
||
Line 9: | Line 9: | ||
=== Parameters === | === Parameters === | ||
''Item'' | ''Item'' | ||
:The [[XfmeaItem Class|XfmeaItem]] object to be added. | :Required. The [[XfmeaItem Class|XfmeaItem]] object to be added. | ||
''ParentID'' | ''ParentID'' | ||
:The record ID of the parent item. | :Required. Integer. The record ID of the parent item. The object will be saved as a next level item under the parent item. | ||
== Example == | == Example == | ||
This example assumes that | 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''' | '''VBA''' | ||
Line 29: | Line 28: | ||
NewItem.Nm = {{APIString|"NewSubSystem"}} | NewItem.Nm = {{APIString|"NewSubSystem"}} | ||
{{APIComment|'Add the new item to project #1 and position it under | {{APIComment|'Add the new item to project #1 and position it under system hierarchy item #1.}} | ||
{{APIComment|'The new item will be | {{APIComment|'The new item will be recorded in the Synthesis repository.}} | ||
MyRepository.Project.SetCurrentProject(1) | MyRepository.Project.SetCurrentProject(1) | ||
{{APIPrefix|Call}} MyRepository.Xfmea.AddItemToSystemHierarchy(NewItem,1) | {{APIPrefix|Call}} MyRepository.Xfmea.AddItemToSystemHierarchy(NewItem,1) | ||
'''VB.NET''' | '''VB.NET''' | ||
Line 45: | Line 46: | ||
NewItem.Nm = {{APIString|"NewSubSystem"}} | NewItem.Nm = {{APIString|"NewSubSystem"}} | ||
{{APIComment|'Add the new item to project #1 and position it under | {{APIComment|'Add the new item to project #1 and position it under system hierarchy item #1.}} | ||
{{APIComment|'The new item will be | {{APIComment|'The new item will be recorded in the Synthesis repository.}} | ||
MyRepository.Project.SetCurrentProject(1) | MyRepository.Project.SetCurrentProject(1) | ||
MyRepository.Xfmea.AddItemToSystemHierarchy(NewItem,1) | MyRepository.Xfmea.AddItemToSystemHierarchy(NewItem,1) |
Revision as of 15:46, 21 August 2015
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
- 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 '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 system hierarchy item #1. 'The new item will be recorded in the Synthesis repository. 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 system hierarchy item #1. 'The new item will be recorded in the Synthesis repository. MyRepository.Project.SetCurrentProject(1) MyRepository.Xfmea.AddItemToSystemHierarchy(NewItem,1)