Repository.Pool.AddPool: Difference between revisions

From ReliaWiki
Jump to navigation Jump to search
No edit summary
No edit summary
 
(4 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 [[CPool Class|cPool]] object to the current project. Returns a '''Boolean''' value; when true, indicates indicates a successful save.</onlyinclude>  
<onlyinclude>Adds a new spare part pool to the current project. Returns a '''Boolean''' value; when true, indicates indicates a successful save.</onlyinclude>  
 
 
'''Remarks''': If a pool with the same name already exists in the destination project, the name will be incremented automatically. For example, if "Pool1" already exists, the new pool might be renamed to "Pool2," "Pool3," etc.


If a pool with the same name already exists in the current project, the application will automatically increment the name. For example, if "Pool1" already exists, the new pool might be renamed to "Pool2," "Pool3," etc.
== Syntax ==
== Syntax ==
  '''.Pool.AddPool'''(''pool'')
  '''.Pool.AddPool'''(''pool'')
=== Parameters ===
=== Parameters ===
''pool''
''pool''
:The [[CPool Class|cPool]] object to be added. (Required)
:Required. The [[CPool Class|cPool]] object that represents the spare part pool to be added.




Line 16: Line 19:
  '''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 pool. The following example creates a pool named "MyNewSpares."}}
  {{APIComment|'Create a new pool. The following example creates a pool named "MyNewSpares."}}
  {{APIPrefix|Dim}} NewSpares {{APIPrefix|As New}} cPool
  {{APIPrefix|Dim}} NewSpares {{APIPrefix|As New}} cPool
  NewSpares.Name = {{APIString|"MyNewSpares"}}
  NewSpares.Name = {{APIString|"MyNewSpares"}}
   
   
  {{APIComment|'Add the new spare part pool to project #1. The spare part pool will be visible in the Synthesis repository upon refresh.}}
  {{APIComment|'Add the new spare part pool to project #1.}}
  MyRepository.Project.SetCurrentProject(1)   
  MyRepository.Project.SetCurrentProject(1)   
  {{APIPrefix|Call}} MyRepository.Pool.AddPool(NewSpares)
  {{APIPrefix|Call}} MyRepository.Pool.AddPool(NewSpares)


  '''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 pool. The following example creates a pool named "MyNewSpares."}}
  {{APIComment|'Create a new pool. The following example creates a pool named "MyNewSpares."}}
  {{APIPrefix|Dim}} NewSpares {{APIPrefix|As New}} cPool ({{APIString|"MyNewSpares"}})
  {{APIPrefix|Dim}} NewSpares {{APIPrefix|As New}} cPool ({{APIString|"MyNewSpares"}})
   
   
  {{APIComment|'Add the new spare part pool to project #1. The spare part pool will be visible in the Synthesis repository upon refresh.}}
  {{APIComment|'Add the new spare part pool to project #1.}}
  MyRepository.Project.SetCurrentProject(1)   
  MyRepository.Project.SetCurrentProject(1)   
  MyRepository.Pool.AddPool(NewSpares)
  MyRepository.Pool.AddPool(NewSpares)

Latest revision as of 20:35, 18 August 2016

APIWiki.png


Member of: SynthesisAPI.Repository


Adds a new spare part pool to the current project. Returns a Boolean value; when true, indicates indicates a successful save.


Remarks: If a pool with the same name already exists in the destination project, the name will be incremented automatically. For example, if "Pool1" already exists, the new pool might be renamed to "Pool2," "Pool3," etc.

Syntax

.Pool.AddPool(pool)

Parameters

pool

Required. The cPool object that represents the spare part pool to be added.


Example

This example creates a new spare part pool resource, and then saves it in the first available project in a Synthesis 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 pool. The following example creates a pool named "MyNewSpares." 
  Dim NewSpares As New cPool
  NewSpares.Name = "MyNewSpares"

 'Add the new spare part pool to project #1. 
  MyRepository.Project.SetCurrentProject(1)   
  Call MyRepository.Pool.AddPool(NewSpares)
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 pool. The following example creates a pool named "MyNewSpares." 
  Dim NewSpares As New cPool ("MyNewSpares")

 'Add the new spare part pool to project #1. 
  MyRepository.Project.SetCurrentProject(1)   
  MyRepository.Pool.AddPool(NewSpares)