Repository.Xfmea.AddXfmeaFunction 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 XfmeaFunction object to the current project. Ret…')
 
No edit summary
 
(12 intermediate revisions by the same user not shown)
Line 1: Line 1:
{{Template:API}}{{Template:APIBreadcrumb|10|.[[Repository Class|Repository]]}}
{{Template:API}}{{Template:APIBreadcrumb|.[[Repository Class|Repository]]}}




<onlyinclude>Saves a new [[XfmeaFunction Class|XfmeaFunction]] object to the current project. Returns a '''Boolean''' value; when true, indicates a successful save. </onlyinclude>
<onlyinclude>Adds a new FMEA function to a system hierarchy item. Returns a '''Boolean''' value; when true, indicates a successful save. </onlyinclude>
 
 
'''Remarks''': If the system hierarchy item does not already have an FMEA analysis, a new FMEA will be automatically created when you add the FMEA function.


==Syntax==
==Syntax==
Line 9: Line 12:
===Parameters===
===Parameters===
''func''
''func''
:Required. The [[XfmeaFunction Class|XfmeaFunction]] object to be added.
:Required. The [[XfmeaFunction Class|XfmeaFunction]] object that represents the FMEA function to be added.


''HID''
''HID''
:Required. Integer. The Hierarchy ID or record ID of the system hierarchy item to add the function to.  
:Required. Integer. The record ID of the parent system hierarchy item.




==Example==
==Example==
This example assumes that system hierarchy items exist in a repository. It creates a new Xfmea function, and then saves it to one of the system hierarchy items in the repository.
This example assumes that system hierarchy items exist in a repository. It creates a new FMEA function, and then saves it to one of the system hierarchy items in the repository.
  '''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|'Create a new FMEA function. The following code creates an FMEA function described as "New_Function."}}
  {{APIPrefix|Dim}} Function1 {{APIPrefix|As New}} XfmeaFunction
  Function1.Dsc = {{APIString|"New_Function"}}
   
   
  {{APIComment|'Add the new FMEA function to system hierarchy item #1 located in project #1.}}
{{APIComment|'Create a new Xfmea function. The following code creates a function described as "New_Function."}}
  MyRepository.Project.SetCurrentProject(1)
  {{APIPrefix|Dim}} Function1 {{APIPrefix|As New}} XfmeaFunction
  {{APIPrefix|Call}} MyRepository.Xfmea.AddXfmeaFunction(Function1,1)
  Function1.Dsc = {{APIString|"New_Function"}}
  {{APIComment|'Add the new function to system hierarchy item #1 located in project #1.}}
  MyRepository.Project.SetCurrentProject(1)
  {{APIPrefix|Call}} MyRepository.Xfmea.AddXfmeaFunction(Function1,1)


  '''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|'Create a new Xfmea function. The following code creates a function described as "New_Function."}}
  {{APIComment|'Create a new FMEA function. The following code creates an FMEA function described as "New_Function."}}
  {{APIPrefix|Dim}} Function1 {{APIPrefix|As New}} XfmeaFunction
  {{APIPrefix|Dim}} Function1 {{APIPrefix|As New}} XfmeaFunction
  Function1.Dsc = {{APIString|"New_Function"}}
  Function1.Dsc = {{APIString|"New_Function"}}
   
   
  {{APIComment|'Add the new function to system hierarchy item #1 located in project #1.}}
  {{APIComment|'Add the new FMEA function to system hierarchy item #1 located in project #1.}}
  MyRepository.Project.SetCurrentProject(1)
  MyRepository.Project.SetCurrentProject(1)
  MyRepository.Xfmea.AddXfmeaFunction(Function1,1)
  MyRepository.Xfmea.AddXfmeaFunction(Function1,1)

Latest revision as of 18:51, 22 August 2016

APIWiki.png


Member of: SynthesisAPI.Repository


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


Remarks: If the system hierarchy item does not already have an FMEA analysis, a new FMEA will be automatically created when you add the FMEA function.

Syntax

.Xfmea.AddXfmeaFunction(func, HID)

Parameters

func

Required. The XfmeaFunction object that represents the FMEA function to be added.

HID

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


Example

This example assumes that system hierarchy items exist in a repository. It creates a new FMEA function, and then saves it to one of the system hierarchy items in 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 FMEA function. The following code creates an FMEA function described as "New_Function." 
  Dim Function1 As New XfmeaFunction
  Function1.Dsc = "New_Function"

 'Add the new FMEA function to system hierarchy item #1 located in project #1. 
  MyRepository.Project.SetCurrentProject(1)
  Call MyRepository.Xfmea.AddXfmeaFunction(Function1,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 FMEA function. The following code creates an FMEA function described as "New_Function." 
  Dim Function1 As New XfmeaFunction
  Function1.Dsc = "New_Function"

 'Add the new FMEA function to system hierarchy item #1 located in project #1. 
  MyRepository.Project.SetCurrentProject(1)
  MyRepository.Xfmea.AddXfmeaFunction(Function1,1)