Role: This interface allows the end-user to handle Applicative parameter profiles attributes. To create them, please refer to .
Applicative profiles are defined using a Feature Dictionary Editor application. The name of the attributes don't change after the CATFct file has been defined. End-user must know what the name of the attributes are.
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 can be used to retrieve a handle on a profile
'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 to get the name
Dim MyCurrentProfile as ParameterProfiles
Dim MyCurrentProfileName
For Each MyCurrentProfile In MyListOfProfiles
MyCurrentProfileName.GetName(MyCurrentProfileName)
Next
Methods
- Sub GetAttributeValue( iAttributeName, oEncapsulatedAttributeValue)
-
Gets the attribute value for the attribute mentioned
- Parameters:
-
- iAttributeName
- Name of the attribute for which the value has to be set (input) dd>
- oEncapsulatedAttributeValue
- Value of the attribute encapsulated as a CATBSTR string (output) dd>
- Example:
-
' declaration of handle for the profile Dim MyProfile As ParameterProfiles ' valuation Set MyProfile= ... ' declaration of variable for name Dim AttributeName Dim AttributeValue ' valuation based on user inputs AttributeName = "MyAttributeName" 'example ' getting the attribute value MyProfile.GetAttributeValue(AttributeName,AttributeValue)
- Sub GetName( oInstanceName)
-
Gets the new name for the Profile instance
- Parameters:
-
- oInstanceName
- Name of the Profile instance (output) dd>
- Example:
-
' declaration of handle for the profile Dim MyProfile As ParameterProfiles ' valuation Set MyProfile= ... ' declaration of variable for name Dim InstanceName ' setting the name MyProfile.GetName(InstanceName)
- Sub SetAttributeValue( iAttributeName, iEncapsulatedAttributeValue)
-
Sets a new attribute value for the attribute mentioned
- Parameters:
-
- iAttributeName
- Name of the attribute for which the value has to be set (input) dd>
- iEncapsulatedAttributeValue
- Value of the attribute encapsulated as a CATBSTR string (input) dd>
- Example:
-
' declaration of handle for the profile Dim MyProfile As ParameterProfiles ' valuation Set MyProfile= ... ' declaration of variable for name Dim AttributeName Dim AttributeValue ' valuation based on user inputs AttributeName = "MyAttributeName" 'example AttributeValue= "MyAttributeValue" 'example ' setting the attribute value MyProfile.SetAttributeValue(AttributeName,AttributeValue)
- Sub SetName( iNewInstanceName)
-
Sets a new name for the Profile instance
- Parameters:
-
- iNewInstanceName
- New name of the Profile instance (input) dd>
- Example:
-
' declaration of handle for the profile Dim MyProfile As ParameterProfiles ' valuation Set MyProfile= ... ' declaration of variable for name Dim InstanceName ' valuation InstanceName = "MyInstanceName.2" 'example ' setting the name MyProfile.SetName(InstanceName)