All Frameworks  Object Hierarchy  This Framework  Indexes   

Products (Collection)

The collection of the Product objects contained in a given Product object of a ProductDocument object.
A Product object can aggregate one or zero Products collection.

Method Index

AddComponent
Creates a component and adds it to the Products collection.
AddComponentsFromFiles
Creates a component for each file.
AddExternalComponent
Creates a component from the root product of another ProductDocument object.
AddNewComponent
Creates a component from the root product of a new ProductDocument object.
AddNewProduct
Creates a Product reference object.
Item
Returns a product from its index in the Products collection.
Remove
Removes a product from the Products collection.
ReplaceComponent
Creates a component which replace the given one.
ReplaceProduct
Creates a component which replace the given one.

Methods


o Func AddComponent( iReferenceProduct) As
Creates a component and adds it to the Products collection. A component is a Product object created from another Product object used as reference.
Parameters:
iReferenceProduct
The product used as reference
Example:
The following example creates the SpareWheel component from the reference product FrontRightWheel and adds the component to the ToolKits collection.
 Dim SpareWheel As Product
 Set SpareWheel = ToolKits.AddComponent(FrontRightWheel)
 
o Sub AddComponentsFromFiles( iFilesList,
iMethod)
Creates a component for each file. The components are added to the Products collection.
Parameters:
iFilesList
The paths of the files used to retrieve the reference or the shape of th component
iMethod
A string describing the expected type of the files
o Func AddExternalComponent( iProductDocument) As
Creates a component from the root product of another ProductDocument object. This root product is used as a reference to create the component. The component is added to the Products collection.
Parameters:
iProductDocument
The product document whose root object is to be used as reference to create the component
Example:
The following example creates the GearBox component by referencing the GearBoxDocument and adds it to the PowerTrains collection.
 Dim GearBox As Product
 Set GearBox = PowerTrains.AddExternalComponent(GearBoxDocument)
 
o Func AddNewComponent( iDocumenType,
iPartNumber) As
Creates a component from the root product of a new ProductDocument object. This root product is used as a reference to create the component. The component is added to the Products collection.
Parameters:
iProductDocument
The product document whose root object is to be used as reference to create the component
Example:
The following example creates the GearBox component by referencing the GearBoxDocument and adds it to the PowerTrains collection.
 Dim GearBox As Product
 Set GearBox = PowerTrains.AddNewComponent(GearBoxDocument, "A120-253X-7")
 
o Func AddNewProduct( iPartNumber) As
Creates a Product reference object. This creates a Product reference object and the associated component by specifying its type and adds it to the Products collection.
Parameters:
iPartNumber
The part number of the product to be created and added to the to the collection
Example:
The following example creates the Engine product and adds the created component to the PowerTrains collection.
 Dim Engine As Product
 Set Engine = PowerTrains.AddNewProduct(V6Engine)
 
o Func Item( iIndex) As
Returns a product from its index in the Products collection.
Parameters:
iIndex
The index of the product to retrieve in the collection of products. This index can either be the rank of the product in the collection or the name you assign to the product. As a numerics, this index is the rank of the product in the collection. The index of the first product in the collection is 1, and the index of the last product is Count. As a string, it is the name you assigned to the product using the
AnyObject.Name property
Returns:
The retrieved product
Example:
The following example returns in ThisProduct the third product, and in ThatProduct the product named Wheel in the CarParts product collection.
 Dim ThisProduct As Product
 Set ThisProduct = CarParts.Item(3)
 Dim ThatProduct As Product
 Set ThatProduct = CarParts.Item("Wheel")
 
o Sub Remove( iIndex)
Removes a product from the Products collection.
Parameters:
iIndex
The index of the product to remove. This index can either be the rank of the product in the collection or the name you assigned to the product. As a numerics, this index is the rank of the product in the collection. The index of the first product in the collection is 1, and the index of the last product is Count. As a string, it is the name you assigned to the product using the
AnyObject.Name property
Example:
The following example removes the sixth product and the product named LeftRearDisc from the Brakes product collection.
 Brakes.Remove(6)
 Brakes.Remove("LeftRearDisc")
 
o Func ReplaceComponent( iOldComponent,
iFilePath,
iMultiInstances) As
Creates a component which replace the given one.
Parameters:
iOldComponent
The component which will be replaced
iFilePath
the document to replace with
oNewComponent
the component replacing iOldComponent
o Func ReplaceProduct( iOldComponent,
iNewReference,
iMultiInstances) As
Creates a component which replace the given one.
Parameters:
iOldComponent
The component which will be replaced
iNewReference
the reference whom the old copmponent will be reconnected
oNewComponent
the component replacing iOldComponent

Copyright © 2003, Dassault Systèmes. All rights reserved.