All Frameworks Object Hierarchy This Framework Indexes
'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
ParameterProfiles
CATSafeArrayVariant
| o Sub CreateProfileInstance( | iProfileType, | |
| iInstanceName, | ||
| oAppParameterProfile) |
' 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
| o Sub DeleteProfileInstance( | ioParameterProfile) |
' 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);
| o Sub GetAllProfileInstances( | oAllInstancesOnProduct) |
'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
| o Sub GetProfileInstance( | iInstanceName, | |
| oProfileInstance) |
'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)
| o Sub GetProfileInstances( | iProfileType, | |
| oProfiles) |
'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
Copyright © 2003, Dassault Systèmes. All rights reserved.