product_structure_interfaces

analyze

Module initially auto generated using V5Automation files from CATIA V5 R28 on 2020-06-11 12:40:47.360445

Warning

The notes denoted “CAA V5 Visual Basic Help” are to be used as reference only. They are there as a guide as to how the visual basic / catscript functions work and thus help debugging in pycatia.

class pycatia.product_structure_interfaces.analyze.Analyze(com_object)

Note

CAA V5 Visual Basic Help (2020-06-11 12:40:47.360445)

System.IUnknown
System.IDispatch
System.CATBaseUnknown
System.CATBaseDispatch
System.AnyObject
Analyze

Represents the analysis object associated with a product.
get_gravity_center()

Note

CAA V5 Visual Basic Help (2020-06-11 12:40:47.360445))
o Sub GetGravityCenter(CATSafeArrayVariant
oGravityCenterCoordinatesArray)

Returns the gravity center coordinates of product.

Parameters:

Coordinates
The array storing the three gravity center coordinates. This array
must be previously initialized.

Example:

This example retrieves the gravity center coordinates
in
oGravityCenterCoordinatesArray from
the Analyze object associated with myProduct:

‘ Coordinates array initialization
Dim oGravityCenterCoordinatesArray ( 2 )
‘ Get value in array
Myproduct.Analyze.GetGravityCenter
oGravityCenterCoordinatesArray
Returns

None

get_inertia()

Note

CAA V5 Visual Basic Help (2020-06-11 12:40:47.360445))
o Sub GetInertia(CATSafeArrayVariant oInertiaMatrixArray)

Returns the inertia matrix array of product.

Parameters:

oInertiaMatrixArray
The array storing successively the three columns of inertia matrix.
This array must be previously initialized.

Example:

This example retrieves the inertia matrix components
in
oInertiaMatrixArray from
the Analyze object associated with myProduct:


‘ Components array initialization
Dim oInertiaMatrixArray ( 8 )
‘ Get value in array
Myproduct.Analyze.GetInertia oInertiaMatrixArray
‘ oInertiaMatrixArray ( 0 ) is the Ixx component
‘ oInertiaMatrixArray ( 1 ) is the Ixy component
‘ oInertiaMatrixArray ( 2 ) is the Ixz component
‘ oInertiaMatrixArray ( 3 ) is the Iyx component
‘ oInertiaMatrixArray ( 4 ) is the Iyy component
‘ oInertiaMatrixArray ( 5 ) is the Iyz component
‘ oInertiaMatrixArray ( 6 ) is the Izx component
‘ oInertiaMatrixArray ( 7 ) is the Izy component
‘ oInertiaMatrixArray ( 8 ) is the Izz component
Returns

tuple

property mass

Note

CAA V5 Visual Basic Help (2020-06-11 12:40:47.360445)
o Property Mass() As double (Read Only)

Returns the product mass value.

Example:

This example retrieves MassValue from

the Analyze object associated with myProduct:


MassValue = myProduct.Analyze.Mass
Returns

float

property volume

Note

CAA V5 Visual Basic Help (2020-06-11 12:40:47.360445)
o Property Volume() As double (Read Only)

Returns the product volume value.

Example:

This example retrieves VolumeValue from

the Analyze object associated with myProduct:


VolumeValue = myProduct.Analyze.Volume
Returns

float

property wet_area

Note

CAA V5 Visual Basic Help (2020-06-11 12:40:47.360445)
o Property WetArea() As double (Read Only)

Returns the product wet area (outer volume).


Note:
This method uses mm2 instead of default Catia V5 unit.

Example:

This example retrieves WetAreaValue from

the Analyze object associated with myProduct:


WetAreaValue = myProduct.Analyze.WetArea
Returns

float

assembly_convertor

Module initially auto generated using V5Automation files from CATIA V5 R28 on 2020-06-11 12:40:47.360445

Warning

The notes denoted “CAA V5 Visual Basic Help” are to be used as reference only. They are there as a guide as to how the visual basic / catscript functions work and thus help debugging in pycatia.

class pycatia.product_structure_interfaces.assembly_convertor.AssemblyConvertor(com_object)

Note

CAA V5 Visual Basic Help (2020-06-11 12:40:47.360445)

System.IUnknown
System.IDispatch
System.CATBaseUnknown
System.CATBaseDispatch
System.AnyObject
AssemblyConvertor

Product conversion object.
The AssemblyConvertor is the object that allows saving an
assembly to a specified format. Two objects exist from now on
: BillOfMaterial, which creates a bill of material (every
sub-assembly is represented, with all the one level depth
components), and ListingReport, which creates a listing report
(shows the product structure as it appears in the graph)
print(i_file_type=None, i_file=None, i_product=None)

Note

CAA V5 Visual Basic Help (2020-06-11 12:40:47.360445))
o Sub Print(CATBSTR iFileType,
CATBSTR iFile,
Product iProduct)

Extracts the product’s contents as a specified format. Saves it in a txt,
html or xls file (depends of the object).

Parameters:

iFileType
Type of the resulting file : TXT (for text file),
HTML (for html file), XLS (for xls file) or MOTIF
(do not use).
iFile
Path of the resulting file
iProduct
Product that will be converted
Parameters
  • i_file_type (str) –

  • i_file (str) –

  • i_product (Product) –

Returns

None

set_current_format(ilist_props=None)

Note

CAA V5 Visual Basic Help (2020-06-11 12:40:47.360445))
o Sub SetCurrentFormat(CATSafeArrayVariant ilistProps)

Defines the properties that will be used in the print
method.

Parameters:

ilistProps
list of properties to display
Parameters

ilist_props (tuple) –

Returns

None

set_secondary_format(ilist_props=None)

Note

CAA V5 Visual Basic Help (2020-06-11 12:40:47.360445))
o Sub SetSecondaryFormat(CATSafeArrayVariant ilistProps)

Defines the secondary properties that will be used in the print
method.

Parameters:

ilistProps
secondary list of properties to display
Parameters

ilist_props (tuple) –

Returns

None

product

Module initially auto generated using V5Automation files from CATIA V5 R28 on 2020-06-11 12:40:47.360445

Warning

The notes denoted “CAA V5 Visual Basic Help” are to be used as reference only. They are there as a guide as to how the visual basic / catscript functions work and thus help debugging in pycatia.

class pycatia.product_structure_interfaces.product.Product(com_object)

Note

CAA V5 Visual Basic Help (2020-06-11 12:40:47.360445)

System.IUnknown
System.IDispatch
System.CATBaseUnknown
System.CATBaseDispatch
System.AnyObject
Product

Represents the product.
The product is the object that helps you model your real products by building a
tree structure whose nodes are product objects. Each of them may contain other
product objects gathered in a product collection. The terminal product objects
in the tree structure have no aggregated product collection. Even if all
products are located somewhere in the product tree structure, some of them can
be used as reference products to create other products named components, which
are instances of the reference product. For example, the left front wheel in a
car can be used as reference to create the other wheels. Be careful: some
properties and methods are dedicated to reference objects only, and some others
are for components only. This is clearly stated for each property or method
concerned.
activate_default_shape()

Note

CAA V5 Visual Basic Help (2020-06-11 12:40:47.360445))
o Sub ActivateDefaultShape()

Activate default shape.
Returns

None

activate_shape(shape_name=None)

Note

CAA V5 Visual Basic Help (2020-06-11 12:40:47.360445))
o Sub ActivateShape(CATBSTR ShapeName)

Activate one shape.

Parameters:

ShapeName
The name of the shape.
Parameters

shape_name (str) –

Returns

None

static activate_terminal_node(products)

Method to ‘Activate Terminal Node’. Loops through ALL products in product and activates_default_shape(). :param list(Product) products:

add_master_shape_representation(i_shape_path_name=None)

Note

CAA V5 Visual Basic Help (2020-06-11 12:40:47.360445))
o Sub AddMasterShapeRepresentation(CATBSTR iShapePathName)

Adds the master shape representation to the product. The master shape
representation is the object that gives a geometric shape and allows the
visualization of the product. It can be a CATIA V4 model, a VRML file, or any
other type of document that can be displayed. In a multi representation
context, the master shape representation is the most meaningful representation
of the product according to the user. This is the default shape for the multi
representation.

Note: This master shape representation is optional.

Parameters:

iShapePathName
The path name where the master shape representation can be found


Example:

This example adds the e:ModelsEngine.model as
the master shape representation to the Engine
product.


Engine.AddMasterShapeRepresentation(“e:ModelsEngine.model”)
Parameters

i_shape_path_name (str) –

Returns

None

add_shape_representation(i_shape_path_name=None, i_shape_name=None, i_rep_behavior=None, i_context=None)

Note

CAA V5 Visual Basic Help (2020-06-11 12:40:47.360445))
o Sub AddShapeRepresentation(CATBSTR iShapePathName,
CATBSTR iShapeName,
CatRepType iRepBehavior,
boolean iContext)

Adds a representation to the product with a specific behavior. A
representation is the object that gives a geometric shape and allows the
visualization of the product. It can be a CATIA V4 model, a VRML file, or any
other type of document that can be displayed.

Note: The possible behavior supported are : 3D, 2D and text.
The representation can also be added within a context or not.
A representation on a product is optional, but many representation
with different behavior (or the same) is supported

Parameters:

iShapePathName
The path name where the representation can be found

iShapeName
The name that is given to the representation This name is a user
free choice
iRepBehavior
The behavior of the added representation. It can take the values
catRep3D if the representation is a 3D one, catRep2D if the representation is a
2D one, or catRepText if the representation is a text one.

iContext
A condition to specify if the added representation can be displayed
with the representation of other products.

Example:

This example adds the e:ModelsEngine.model as
a 3D representation to the Engine product within an assembly
context.


Engine.AddShapeRepresentation(“e:ModelsEngine.model”,”MyShape”,catRep3D,TRUE)
Parameters
  • i_shape_path_name (str) –

  • i_shape_name (str) –

  • i_rep_behavior (CatRepType) –

  • i_context (bool) –

Returns

None

property analyze

Note

CAA V5 Visual Basic Help (2020-06-11 12:40:47.360445)
o Property Analyze() As Analyze (Read Only)

Returns the Analyze object associated to the current
product.

Example:

This example retrieves in EngineAnalysis the Analyze object
of
the Engine product.


Dim EngineAnalysis As Analyze
Set EngineAnalysis = Engine.Analyze
Returns

Analyze

apply_work_mode(new_mode)

Note

CAA V5 Visual Basic Help (2020-06-11 12:40:47.360445))
o Sub ApplyWorkMode(CatWorkModeType newMode)

Applies a new working mode.

Parameters:

newMode
The new working mode.
Parameters

new_mode (int) –

Returns

None

attributes()

Returns a string describing the products attributes. :return: str

connections(i_connections_type=None)

Note

CAA V5 Visual Basic Help (2020-06-11 12:40:47.360445))
o Func Connections(CATBSTR iConnectionsType) As Collection

Returns the product’s constraints. The constraint collection of a product
gathers the constraints this product should respect to be positioned in the
space.

Example:

This example retrieves the constraint collection for
the
Engine product.


Dim EngineConstraints As Collection
Set EngineConstraints = Engine.Constraints
Parameters

i_connections_type (str) –

Returns

Collection

count_children()
Returns

int()

create_reference_from_name(i_label=None)

Note

CAA V5 Visual Basic Help (2020-06-11 12:40:47.360445))
o Func CreateReferenceFromName(CATBSTR iLabel) As Reference

Creates a reference from a name. A reference is an object that can stand
for any geometrical object. Creating references is necessary for adding
constraints between two components using Brep elements of the representations
of these components.

Parameters:

iLabel
The path of the Brep element to use in the constraint. This path is
passed as a character string comprising the component path from the root
product to the component concerned, concatenated to the Brep element path in
the product’s representation. Components are separated using “/”, and the
product path is separated from the Brep using “/!”. For separating parameter
from product path use “”.

Returns:
The created reference
Example:

This example creates a reference from the path of a Brep element

in the Prod2 product located below the Root root
product. The face is located in the Pad.1 pad and limited by
the
Circle.1 circle.


Dim Ref As Reference
Ref = Prod2.CreateReferenceFromName(
“Root/Prod2/!Face:(Brp:(Pad.1:0(Brp:(Circle.1))):None())”
)
Parameters

i_label (str) –

Returns

Reference

property definition

Note

CAA V5 Visual Basic Help (2020-06-11 12:40:47.360445)
o Property Definition() As CATBSTR

Returns or sets the product’s definition.
Definition is valid for reference products only.

Example:

This example retrieves the definition of the
Engine product in EngineDef.


EngineDef = Engine.Definition
Returns

str

desactivate_default_shape()

Note

CAA V5 Visual Basic Help (2020-06-11 12:40:47.360445))
o Sub DesactivateDefaultShape()

Deactivate default shape.
Returns

None

desactivate_shape(shape_name=None)

Note

CAA V5 Visual Basic Help (2020-06-11 12:40:47.360445))
o Sub DesactivateShape(CATBSTR ShapeName)

Deactivate one shape.

Parameters:

ShapeName
The name of the shape.
Parameters

shape_name (str) –

Returns

None

property description_instance

Note

CAA V5 Visual Basic Help (2020-06-11 12:40:47.360445)
o Property DescriptionInst() As CATBSTR

Returns or sets the product’s description for a component
product.
DescriptionInst is valid for component products only.
The description is a comment assigned to the component product to help
describe or qualify it.

Example:

This example sets the description for the
EngineComp product.


Desc = “This is the Engine component product description”
EngineComp.DescriptionInst(Desc)
Returns

str

property description_reference

Note

CAA V5 Visual Basic Help (2020-06-11 12:40:47.360445)
o Property DescriptionRef() As CATBSTR

Returns or sets the product’s description for a reference
product.
DescriptionRef is valid for reference products only.
The description is a comment assigned to the reference product to help
describe or qualify it.

Example:

This example sets the description for the
Engine product.


Desc = “This is the Engine reference product description”
Engine.DescriptionRef(Desc)
Returns

str

extract_bom(i_file_type=None, i_file=None)

Note

CAA V5 Visual Basic Help (2020-06-11 12:40:47.360445))
o Sub ExtractBOM(CatFileType iFileType,
CATBSTR iFile)

Extracts the product’s contents as a bill of materials (BOM). The bill of
material displays, for every sub-assembly in the product, the one level depth
components and some of their properties.

Parameters:

iFileType
Set this parameter to catFileTypeHTML to save to the html
format.
Set this parameter to catFileTypeTXT to save to the text
format.
The catFileTypeMotif should not be used.
iFile
File where the bill of material will be saved
Parameters
  • i_file_type (CatFileType) –

  • i_file (str) –

Returns

None

property file_name
Returns

str()

property full_name
Returns

str()

get_active_shape_name()

Note

CAA V5 Visual Basic Help (2020-06-11 12:40:47.360445))
o Func GetActiveShapeName() As CATBSTR

Returns the name of the active shape.

Returns:
oShapeName The name of the active shape.
Returns

str

get_all_shapes_names(olistshape=None)

Note

CAA V5 Visual Basic Help (2020-06-11 12:40:47.360445))
o Sub GetAllShapesNames(CATSafeArrayVariant olistshape)

List the name of all shapes.

Returns:
olistshape The list of the names The tab olistshape has to be allocated
with a size given by GetNumberOfShapes.
Parameters

olistshape (tuple) –

Returns

None

get_child(index)
Returns

Product()

get_children()
Returns

list(Product())

get_default_shape_name()

Note

CAA V5 Visual Basic Help (2020-06-11 12:40:47.360445))
o Func GetDefaultShapeName() As CATBSTR

Returns the default shape.

Returns:
oShapeName The name of the default shape.
Returns

str

get_master_shape_representation(i_load_if_necessary=None)

Note

CAA V5 Visual Basic Help (2020-06-11 12:40:47.360445))
o Func GetMasterShapeRepresentation(boolean iLoadIfNecessary) As
CATBaseDispatch

Retrieves the product’s master shape representation.

Parameters:

iLoadIfNecessary
Parameter to set to True if the master shape representation should
be loaded to determine if it exists, or to False otherwise.


Example:

This example retrieves in MSRep the
Engine product’s master shape representation.


Dim MSRep As Object
Set MSRep = Engine.GetMasterShapeRepresentation(True)
Parameters

i_load_if_necessary (bool) –

Returns

AnyObject

get_master_shape_representation_path_name()

Note

CAA V5 Visual Basic Help (2020-06-11 12:40:47.360445))
o Func GetMasterShapeRepresentationPathName() As CATBSTR

Retrieves the product’s master shape representation
pathname.

Example:

This example retrieves in MSRep the
Engine product’s master shape representation.


Set MSRepPath = Engine.GetMasterShapeRepresentationPathName
Returns

str

get_number_of_shapes()

Note

CAA V5 Visual Basic Help (2020-06-11 12:40:47.360445))
o Func GetNumberOfShapes() As short

Returns the number of Shapes

Returns:
oNbShapes The number of Shapes.
Returns

enum

get_products()

Returns a list of Product(). :return: [Product()]

get_shape_path_name(i_shape_name=None)

Note

CAA V5 Visual Basic Help (2020-06-11 12:40:47.360445))
o Func GetShapePathName(CATBSTR iShapeName) As CATBSTR

Returns the path name of a shape for a given shape name.

Parameters:

iShapeName
The name of the shape.

Returns:
oShapePathName The path name of the shape.
Parameters

i_shape_name (str) –

Returns

str

get_shape_representation(i_load_if_necessary, i_shape_name, i_rep_behavior, i_context)

Note

CAA V5 Visual Basic Help (2020-06-11 12:40:47.360445))
o Func GetShapeRepresentation(boolean iLoadIfNecessary,
CATBSTR iShapeName,
CatRepType iRepBehavior,
boolean iContext) As CATBaseDispatch

Retrieves the product’s representation with the given
parameters.

Parameters:

iLoadIfNecessary
Parameter to set to True if the master shape representation should
be loaded to determine if it exists, or to False otherwise.

iShapeName
The name of the representation of the product.
iRepBehavior
The behavior of the representation. It can take the values catRep3D
if the representation is a 3D one, catRep2D if the representation is a 2D one,
or catRepText if the representation is a text one.

iContext
A condition to specify if the representation is displayed with the
representation of other products.

Example:

This example retrieves in MSRep the
Engine product’s 3D representation named “PART”.


Dim MSRep As Object
Set MSRep = Engine.GetMasterShapeRepresentation(True,”PART”,catRep3D,TRUE)
Parameters
  • i_load_if_necessary (bool) –

  • i_shape_name (str) –

  • i_rep_behavior (CatRepType) –

  • i_context (bool) –

Returns

AnyObject

get_technological_object(i_application_type=None)

Note

CAA V5 Visual Basic Help (2020-06-11 12:40:47.360445))
o Func GetTechnologicalObject(CATBSTR iApplicationType) As
CATBaseDispatch

Returns the product’s applicative data which type is the given parameter.
The data returned can be either a collection or a simple
object.

Parameters:

iApplicationType
The type of applicative data searched.

Example:

This example retrieves the constraints for the
Engine product.


Dim EngineConstraints As Collection
Set EngineConstraints = Engine.GetTechnologicalObject(“Constraints”)
Parameters

i_application_type (str) –

Returns

AnyObject

has_a_master_shape_representation()

Note

CAA V5 Visual Basic Help (2020-06-11 12:40:47.360445))
o Func HasAMasterShapeRepresentation() As boolean

Returns whether the product has a master shape
representation.
True if the product has a master shape representation.

Example:

This example retrieves in HasMSRep whether the
Engine product has a master shape representation.


HasMSRep = Engine.HasAMasterShapeRepresentation()
Returns

bool

has_children()
Returns

bool

has_shape_representation(i_shape_name=None, i_rep_behavior=None, i_context=None)

Note

CAA V5 Visual Basic Help (2020-06-11 12:40:47.360445))
o Func HasShapeRepresentation(CATBSTR iShapeName,
CatRepType iRepBehavior,
boolean iContext) As boolean

Returns whether the product has a representation of the given name with a
given behavior.
True if the product has such a representation.

Parameters:

iShapeName
The name of the representation of the product.
iRepBehavior
The behavior of the representation. It can take the values catRep3D
if the representation is a 3D one, catRep2D if the representation is a 2D one,
or catRepText if the representation is a text one.

iContext
A condition to specify if the representation is displayed with the
representation of other products.

Example:

This example retrieves in HasRep whether the
Engine product has a master shape representation.


HasRep = Engine.HasRepresentation(“PART”,catRep3D,TRUE)
Parameters
  • i_shape_name (str) –

  • i_rep_behavior (CatRepType) –

  • i_context (bool) –

Returns

bool

is_catpart()
Returns

bool

is_catproduct()
Returns

bool

property move

Note

CAA V5 Visual Basic Help (2020-06-11 12:40:47.360445)
o Property Move() As Move (Read Only)

Returns the product’s move object. The move object is aggregated by the
product object and itself aggregates a movable object to which you can apply a
move transformation by means of an isometry matrix. It moves your product
master shape representation according to this isometry.

Example:

This example retrieves the move object for the
Engine product.


Dim EngineMoveObject As Move
Set EngineMoveObject = Engine.Move
Returns

Move

property nomenclature

Note

CAA V5 Visual Basic Help (2020-06-11 12:40:47.360445)
o Property Nomenclature() As CATBSTR

Returns or sets the product’s nomenclature.
Nomenclature is valid for reference products only.
According to the STEP AP203, the nomenclature is “a name by which the part
is commonly known within an organization”.

Example:

This example retrieves the nomenclature the
Engine product in EngineNom.


EngineNom = Engine.Nomenclature
Returns

str

property parameters

Note

CAA V5 Visual Basic Help (2020-06-11 12:40:47.360445)
o Property Parameters() As Parameters (Read Only)

Returns the collection object containing the product parameters. All the
parameters that are aggregated in the different objects of the product might be
accessed through that collection.

Example:
The following example returns in params the parameters of the
productRoot product from the productDoc product
document:

Set productRoot = productDoc.Product
Set params = productRoot.Parameters
Returns

Parameters

property part_number

Note

CAA V5 Visual Basic Help (2020-06-11 12:40:47.360445)
o Property PartNumber() As CATBSTR

Returns or sets the product’s part number.
PartNumber is valid for reference products only.

Example:

This example sets the
Engine product’s part number to A120-253X-7.


Engine.PartNumber(“A120-253X-7”)
Returns

str

path()

Returns the pathlib.Path() object of the document fullname. example e://users//psr//Parts//MyNiceProduct.CATProduct >>> Product.path().name >>> # MyNiceProduct.CATProduct >>> Product.path().parent >>> # e://users//psr//Parts// >>> Product.path().suffix >>> # .CATProduct :return: Path()

property position

Note

CAA V5 Visual Basic Help (2020-06-11 12:40:47.360445)
o Property Position() As Position (Read Only)

Returns the product’s position object. The position object is the object
aggregated by the product object that holds the position of the master shape
representation in the space.

Example:

This example retrieves the position object for the
Engine product.


Dim EnginePositionObject As Position
Set EnginePositionObject = Engine.Position
Returns

Position

property products

Note

CAA V5 Visual Basic Help (2020-06-11 12:40:47.360445)
o Property Products() As Products (Read Only)

Returns the collection of products contained in the current
product.

Example:

This example retrieves in EngineChildren the collection
of
products contained in the Engine product.


Dim EngineChildren As Products
Set EngineChildren = Engine.Products
Returns

Products

property publications

Note

CAA V5 Visual Basic Help (2020-06-11 12:40:47.360445)
o Property Publications() As Publications (Read Only)

Returns the collection of publications managed by the product.
Returns

Publications

property reference_product

Note

CAA V5 Visual Basic Help (2020-06-11 12:40:47.360445)
o Property ReferenceProduct() As Product (Read Only)

Returns the Reference Product of this instance.
Returns

Product

property relations

Note

CAA V5 Visual Basic Help (2020-06-11 12:40:47.360445)
o Property Relations() As Relations (Read Only)

Returns the collection object containing the product relations. All the
relations that are used to valuate the parameters of the product might be
accessed thru that collection.

Example:
The following example returns in rels the relations of the productRoot
product from the productDoc product document:

Set productRoot = productDoc.Product
Set rels = productRoot.Relations
Returns

Relations

remove_master_shape_representation()

Note

CAA V5 Visual Basic Help (2020-06-11 12:40:47.360445))
o Sub RemoveMasterShapeRepresentation()

Removes the master shape representation from the product. The master shape
representation is the object that gives a geometric shape and allows the
visualization of the product. It can be a CATIA V4 model, a VRML file, or any
other type of document that can be displayed. In a multi representation
context, the master shape representation is the most meaningful representation
of the product according to the user. This is the default shape for the multi
representation.

Note: This master shape representation is optional.

Example:

This example removes the master shape representation of
the
Engine product.


Engine.RemoveMasterShapeRepresentation()
Returns

None

remove_shape_representation(i_shape_name=None, i_rep_behavior=None, i_context=None)

Note

CAA V5 Visual Basic Help (2020-06-11 12:40:47.360445))
o Sub RemoveShapeRepresentation(CATBSTR iShapeName,
CatRepType iRepBehavior,
boolean iContext)

Removes a specific representation from the product. A representation is the
object that gives a geometric shape and allows the visualization of the
product.. It can be a CATIA V4 model, a VRML file, or any other type of
document that can be displayed.

Note: This representation is optional.

Parameters:

iShapeName
The name of the representation of the product.
iRepBehavior
The behavior of the representation. It can take the values catRep3D
if the representation is a 3D one, catRep2D if the representation is a 2D one,
or catRepText if the representation is a text one.

iContext
A condition to specify if the representation is displayed with the
representation of other products.

Example:

This example removes the 3D representation named “PART” of
the
Engine product.


Engine.RemoveMasterShapeRepresentation
(“PART”,catRep3D,TRUE)
Parameters
  • i_shape_name (str) –

  • i_rep_behavior (CatRepType) –

  • i_context (bool) –

Returns

None

property revision

Note

CAA V5 Visual Basic Help (2020-06-11 12:40:47.360445)
o Property Revision() As CATBSTR

Returns or sets the product’s revision number.
Revision is valid for reference products only.

Example:

This example sets the
Engine product’s revision number to 3A.


Engine.Revision(“3A”)
Returns

str

property source

Note

CAA V5 Visual Basic Help (2020-06-11 12:40:47.360445)
o Property Source() As CatProductSource

Returns or sets the product’s source.
Source is valid for reference products only.
According to the STEP AP203, the source is the “design organization’s plan
for obtaining the product”. The source can take the values catProductMade if
the product is made internally, catProductBought if it is purchased from a
vendor, or catProductUnknown if its origin is not
determined.

Example:

This example sets the source for the
Engine product to catProductMade.


Engine.Source(catProductMade)
Returns

enum cat_product_source

update()

Note

CAA V5 Visual Basic Help (2020-06-11 12:40:47.360445))
o Sub Update()

Updates the product. This update is performed with respect to the part
making the product or to the product’s representation. It takes into account
the components of the product at any level

Example:

The following example updates the root product:


Dim RootProduct As Product
Set Rootproduct = productDoc.Product
Rootproduct.Update
Returns

None

property user_ref_properties

Note

CAA V5 Visual Basic Help (2020-06-11 12:40:47.360445)
o Property UserRefProperties() As Parameters (Read Only)

Returns the collection object containing the product properties. All the
user defined properties that are created in the reference product might be
accessed through that collection.
Only available on reference products.

Example:
The following example returns in UserProps the properties of the
productRoot product from the productDoc product
document:

Set productRoot = productDoc.Product
Set UserProps = productRoot.UserRefProperties
Returns

Parameters

product_document

Module initially auto generated using V5Automation files from CATIA V5 R28 on 2020-06-11 12:40:47.360445

Warning

The notes denoted “CAA V5 Visual Basic Help” are to be used as reference only. They are there as a guide as to how the visual basic / catscript functions work and thus help debugging in pycatia.

class pycatia.product_structure_interfaces.product_document.ProductDocument(com_object)

Note

CAA V5 Visual Basic Help (2020-06-11 12:40:47.360445)

System.IUnknown
System.IDispatch
System.CATBaseUnknown
System.CATBaseDispatch
System.AnyObject
InfInterfaces.Document
ProductDocument

Represents the Document object for product structures.
When a ProductDocument is created, a root product is created whose parent is
the ProductDocument object. Its default name is RootProduct, which can be
overwritten thanks to the the AnyObject.Name property. This root product is at
the top of the product tree structure contained in the document. It has no
difference with the other contained products, except it has no father product
in the product tree structure within the document.
property product

Note

CAA V5 Visual Basic Help (2020-06-11 12:40:47.360445)
o Property Product() As Product (Read Only)

Returns the root product.

Example:

This example retrieves the root product of the
MyProductDoc
ProductDocument in RootProduct.


Dim RootProduct As Product
Set RootProduct = MyProductDoc.Product
Returns

Product

products

Module initially auto generated using V5Automation files from CATIA V5 R28 on 2020-06-11 12:40:47.360445

Warning

The notes denoted “CAA V5 Visual Basic Help” are to be used as reference only. They are there as a guide as to how the visual basic / catscript functions work and thus help debugging in pycatia.

class pycatia.product_structure_interfaces.products.Products(com_object)

Note

CAA V5 Visual Basic Help (2020-06-11 12:40:47.360445)

System.IUnknown
System.IDispatch
System.CATBaseUnknown
System.CATBaseDispatch
System.Collection
Products

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.
add_component(i_reference_product=None)

Note

CAA V5 Visual Basic Help (2020-06-11 12:40:47.360445))
o Func AddComponent(Product iReferenceProduct) As Product

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)
Parameters

i_reference_product (Product) –

Returns

Product

add_components_from_files(i_files_list=None, i_method=None)

Note

CAA V5 Visual Basic Help (2020-06-11 12:40:47.360445))
o Sub AddComponentsFromFiles(CATSafeArrayVariant iFilesList,
CATBSTR 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
Parameters
  • i_files_list (tuple) –

  • i_method (str) –

Returns

None

add_external_component(i_product_document=None)

Note

CAA V5 Visual Basic Help (2020-06-11 12:40:47.360445))
o Func AddExternalComponent(Document iProductDocument) As
Product

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)
Parameters

i_product_document (Document) –

Returns

Product

add_new_component(i_documen_type=None, i_part_number=None)

Note

CAA V5 Visual Basic Help (2020-06-11 12:40:47.360445))
o Func AddNewComponent(CATBSTR iDocumenType,
CATBSTR iPartNumber) As Product

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”)
Parameters
  • i_documen_type (str) –

  • i_part_number (str) –

Returns

Product

add_new_product(i_part_number=None)

Note

CAA V5 Visual Basic Help (2020-06-11 12:40:47.360445))
o Func AddNewProduct(CATBSTR iPartNumber) As Product

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)
Parameters

i_part_number (str) –

Returns

Product

item(i_index=None)

Note

CAA V5 Visual Basic Help (2020-06-11 12:40:47.360445))
o Func Item(CATVariant iIndex) As Product

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”)
Parameters

i_index (CATVariant) –

Returns

Product

remove(i_index=None)

Note

CAA V5 Visual Basic Help (2020-06-11 12:40:47.360445))
o Sub Remove(CATVariant 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”)
Parameters

i_index (CATVariant) –

Returns

None

replace_component(i_old_component=None, i_file_path=None, i_multi_instances=None)

Note

CAA V5 Visual Basic Help (2020-06-11 12:40:47.360445))
o Func ReplaceComponent(Product iOldComponent,
CATBSTR iFilePath,
boolean iMultiInstances) As Product

Creates a component which replace the given one.

Parameters:

iOldComponent
The component which will be replaced
iFilePath
the document to replace with
iMultiInstances
Parameter to set to True if all instances are to be replaced, or to
False otherwise. Returns the component replacing
iOldComponent


Note:
Part Number conflict will be resolved
automatically.
Parameters
  • i_old_component (Product) –

  • i_file_path (str) –

  • i_multi_instances (bool) –

Returns

Product

replace_product(i_old_component=None, i_new_reference=None, i_multi_instances=None)

Note

CAA V5 Visual Basic Help (2020-06-11 12:40:47.360445))
o Func ReplaceProduct(Product iOldComponent,
Product iNewReference,
boolean iMultiInstances) As Product

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

iMultiInstances
Parameter to set to True if all instances are to be replaced, or to
False otherwise. Returns the component replacing
iOldComponent
Parameters
  • i_old_component (Product) –

  • i_new_reference (Product) –

  • i_multi_instances (bool) –

Returns

Product

publication

Module initially auto generated using V5Automation files from CATIA V5 R28 on 2020-06-11 12:40:47.360445

Warning

The notes denoted “CAA V5 Visual Basic Help” are to be used as reference only. They are there as a guide as to how the visual basic / catscript functions work and thus help debugging in pycatia.

class pycatia.product_structure_interfaces.publication.Publication(com_object)

Note

CAA V5 Visual Basic Help (2020-06-11 12:40:47.360445)

System.IUnknown
System.IDispatch
System.CATBaseUnknown
System.CATBaseDispatch
System.AnyObject
Publication

The interface to access a CATIAPublication.
property relay

Note

CAA V5 Visual Basic Help (2020-06-11 12:40:47.360445)
o Property Relay(Publication iPub) (Write Only)

Valuates a publication object with another publication object. Role: This
method allows to valuate a publication with an intermediate
one.

Parameters:

iPub
The intermediate publication object

Example: The following example valuates the publication object Pub1
with the publication object Pub2

Pub1.Relay(Pub2)
Returns

False

property valuation

Note

CAA V5 Visual Basic Help (2020-06-11 12:40:47.360445)
o Property Valuation() As CATBaseDispatch

Returns published object. Role: This method gives access to the finally
published object.

Parameters:

oRef
The final reference of the publication object.

Example: This example returns the final reference Ref of the
publication object Pub1.

Dim Ref As Reference
Ref = Pub1.Valuation
Returns

AnyObject

publications

Module initially auto generated using V5Automation files from CATIA V5 R28 on 2020-06-11 12:40:47.360445

Warning

The notes denoted “CAA V5 Visual Basic Help” are to be used as reference only. They are there as a guide as to how the visual basic / catscript functions work and thus help debugging in pycatia.

class pycatia.product_structure_interfaces.publications.Publications(com_object)

Note

CAA V5 Visual Basic Help (2020-06-11 12:40:47.360445)

System.IUnknown
System.IDispatch
System.CATBaseUnknown
System.CATBaseDispatch
System.Collection
Publications

The collection of the Product publications.
A Product object can aggregate one or zero Publications
collection.
add(i_public_name=None)

Note

CAA V5 Visual Basic Help (2020-06-11 12:40:47.360445))
o Func Add(CATBSTR iPublicName) As Publication

Adds a publication object to the product and returns a pointer to the
publication object.

Parameters:

iPublicName
The name of the publication
oPub
The publication object

Example: The following example adds a new publication object with
the name “PubName” to the product and returns the publication object
Pub1.

Dim Prod1 As Product
Set Pub1 = Prod1.Add(PubName)
Parameters

i_public_name (str) –

Returns

Publication

item(i_identifier=None)

Note

CAA V5 Visual Basic Help (2020-06-11 12:40:47.360445))
o Func Item(CATVariant iIdentifier) As Publication

Returns the publication object corresponding to the given publication
name.

Parameters:

iIdentifier
The name of the publication
oPub
The publication object

Example: The following example returns Pub1 publication object from
the product referencing the published name PubId.

Dim Prod1 As Product
Set Pub1 = Prod1.Item(PubId)
Parameters

i_identifier (CATVariant) –

Returns

Publication

remove(i_identifier=None)

Note

CAA V5 Visual Basic Help (2020-06-11 12:40:47.360445))
o Sub Remove(CATBSTR iIdentifier)

Removes a publication from the product.

Parameters:

iIdentifier
The name of the publication

Example: The following example removes the publication object
corresponding to the name PubId.

Dim Prod1 As Product
Prod1.Remove(PubId)
Parameters

i_identifier (str) –

Returns

None

set_direct(i_identifier=None, i_pointed=None)

Note

CAA V5 Visual Basic Help (2020-06-11 12:40:47.360445))
o Sub SetDirect(CATVariant iIdentifier,
Reference iPointed)

Valuates a publication object directly with the object it
publishes.

Parameters:

iIdentifier
The name of the publication
iPointed
The published object
The following

Boundary objects is supported: Boundary

Example: The following example valuates the publication object of
product Prod1 having the name PubId with the reference object
RefObject.

Dim Prod1 As Product
Prod1.SetDirect(PubId,RefObject)
Parameters
  • i_identifier (CATVariant) –

  • i_pointed (Reference) –

Returns

None

set_relay(i_identifier=None, i_relayer=None, i_name_in_relay=None)

Note

CAA V5 Visual Basic Help (2020-06-11 12:40:47.360445))
o Sub SetRelay(CATVariant iIdentifier,
Publications iRelayer,
CATVariant iNameInRelay)

Valuates a publication object with another publication
object.

Parameters:

iIdentifier
The name of the publication to be valuated
iRelayer
The product aggregating the valuating intermediate publication
object
iNameInRelay
The name of the valuating publication object

Example: The following example valuates the publication object of
product Prod1 having the name PubId1 with the publication object of product
Prod2 having the name PubId2.

Dim Prod1 As Product
Prod1.SetRelay(PubId1,Prod2,PubId2)
Parameters
  • i_identifier (CATVariant) –

  • i_relayer (Publications) –

  • i_name_in_relay (CATVariant) –

Returns

None