Repository.Profile.GetProfile

From ReliaWiki
Revision as of 23:14, 22 March 2017 by Kate Racaza (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
APIWiki.png


Member of: SynthesisAPI.Repository


Returns a cProfile object that represents a given profile resource in the current project. Returns nothing if the profile does not exist or is not in the current project.


Syntax

Profile.GetProfile(ID)

Parameters

ID

Required. Integer. The ID number of the profile to retrieve.


Example

This example assumes that a profile with ID #1 exists in the first project of a Synthesis repository.

VBA

 'Declare a new Repository object and connect to a Synthesis repository. 
  Dim MyRepository As New Repository
  MyRepository.ConnectToAccessRepository("C:\RSRepository1.rsr11")
 
 'Get profile #1 from project #1. 
  Dim MyProfile As cProfile
  MyRepository.Project.SetCurrentProject(1)
  Set MyProfile = MyRepository.Profile.GetProfile(1)

 'Output sample: Display the name and ID of the profile. 
  Dim ProfileName As String
  Dim ProfileID As Integer
  ProfileName = MyProfile.Name
  ProfileID = MyProfile.ID
  MsgBox ("ID# " & ProfileID & ", " & ProfileName)
VB.NET

 'Declare a new Repository object and connect to a Synthesis repository. 
  Dim MyRepository As New Repository
  MyRepository.ConnectToAccessRepository("C:\RSRepository1.rsr11")
 
 'Get profile #1 from project #1. 
  Dim MyProfile As SynthesisAPI.cProfile
  MyRepository.Project.SetCurrentProject(1)
  MyProfile = MyRepository.Profile.GetProfile(1)

 'Output sample: Display the name and ID of the profile. 
  Dim ProfileName As String
  Dim ProfileID As Integer
  ProfileName = MyProfile.Name
  ProfileID = MyProfile.ID
  MsgBox ("ID# " & ProfileID & ", " & ProfileName)