Role: This interface allows the end-user to handle Applicative parameter profiles on a robot controller. It works on both:
- robots created using V5 mechanisms
- robots imported from DENEB D5
Applicative profiles are defined using a Feature Dictionary Editor application. The application will save CATFct files that must be referenced with a file Profile.xml, referenced through the environment variable CATDisciplinePath. For more information, please refer to the Device Building product documentation in the Advanced Tasks section on the setup.
To get a handle on the robot, the product must be the assembly node representing the robot (the one with a robot icon).
The following code snippet shows how to retrieve the handle on the factory.
'current document is a product
'the root product is a robot
'retrieving the root product
Dim MyProduct As Product
Set MyProduct = CATIA.ActiveDocument.Product
'retrieving the handle
Dim MyProfileFactory As ParameterProfilesFactory
Set MyProfileFactory = MyProduct.GetTechnologicalObject("ParameterProfilesFactory")
...
'retrieving the list of profiles as an array
Dim MyListOfProfiles() As ParameterProfiles
MyProfileFactory.GetAllProfileInstances(MyListOfProfiles)
'loop for each profile
Dim MyCurrentProfile as ParameterProfiles
For Each MyCurrentProfile In MyListOfProfiles
...
Next
Methods
- Sub CreateProfileInstance( iProfileType, iInstanceName, oAppParameterProfile)
-
Instantiates a particular profile type. The profile type is
user-defined: it is the name the user has set when defining
the profile in the CATFct file.
- Parameters:
-
- iProfileType
- Profile type name for which the instance has to be created (input) dd>
- iInstanceName
- Desired instance name for the instance to be created( input) dd>
- oAppParameterProfile
- Handle to the profile instance thus created (output) dd>
- Example:
-
' declaration of 2 variable handles Dim MyNewProfile As ParameterProfiles Dim MyProfileFactory As ParameterProfilesFactory ' valuation Set MyProfileFactory= ... ' declaration of variables for names Dim InstanceName Dim DefaultName DefaultName = "MyChoice." 'example 'Create 10 instances of the profile type MyProfileType For i=1 to 10 'concatenation of default name and index InstanceName = DefaultName & i ParmProfileFact.CreateProfileInstance( "MyProfileType", InstanceName, MyNewProfile) Next
- Sub DeleteProfileInstance( ioParameterProfile)
-
Deletes a particular profile instance
- Parameters:
-
- ioParameterProfile
- Handle to the profile instance which should be deleted( input) dd>
- Example:
-
' declaration of 2 variable handles Dim MyProfileToDelete As ParameterProfiles Dim MyProfileFactory As ParameterProfilesFactory ' valuation Set MyProfileToDelete= ... Set MyProfileFactory= ... 'deletion of the object MyProfileFactory.DeleteProfileInstance(MyProfileToDelete);
- Sub GetAllProfileInstances( oAllInstancesOnProduct)
-
Gets the array of all the handles of the profile instances (belonging to all profile types)
- Parameters:
-
- oAllInstancesOnProduct
- The array of all the handles to all the profile instances of all the profile types(output) dd>
- Example:
-
'retrieving the handle on the profile factory Dim MyProfileFactory As ParameterProfilesFactory set MyProfileFactory = ... ... 'retrieving the list of profiles as an array Dim MyListOfProfiles() As ParameterProfiles MyProfileFactory.GetAllProfileInstances(MyListOfProfiles) 'loop for each profile Dim MyCurrentProfile as ParameterProfiles For Each MyCurrentProfile In MyListOfProfiles ... Next
- Sub GetProfileInstance( iInstanceName, oProfileInstance)
-
Gets the handle to the profile instance against the instance name
- Parameters:
-
- iInstanceName
- The name of the profile instance(input) dd>
- oProfileInstance
- Handle to the profile instance which has the above name( output) dd>
- Example:
-
'retrieving the handle on the profile factory Dim MyProfileFactory As ParameterProfilesFactory set MyProfileFactory = ... ... 'defining the type Dim MyProfileName set MyProfileName= "MyProfile.1" 'example 'retrieving the profile Dim MyCurrentProfile as ParameterProfiles MyProfileFactory.GetProfileInstances( MyProfileName, MyListOfProfiles)
- Sub GetProfileInstances( iProfileType, oProfiles)
-
Gets the array of handles of the profile instances belonging to a particular profile type
- Parameters:
-
- iProfileType
- The Profile Type (input) dd>
- oProfiles
- The array of handles to the profile instances of the type specified above(output) dd>
- Example:
-
'retrieving the handle on the profile factory Dim MyProfileFactory As ParameterProfilesFactory set MyProfileFactory = ... ... 'defining the type Dim MyProfileType set MyProfileType = "MyProfileType" 'example 'retrieving the list of profiles as an array Dim MyListOfProfiles() As ParameterProfiles MyProfileFactory.GetProfileInstances( MyProfileType, MyListOfProfiles) 'loop for each profile Dim MyCurrentProfile as ParameterProfiles For Each MyCurrentProfile In MyListOfProfiles ... Next