pycatia.product_structure_interfaces.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.IUnknownSystem.IDispatchSystem.CATBaseUnknownSystem.CATBaseDispatchSystem.AnyObjectProductRepresents the product.The product is the object that helps you model your real products by building atree structure whose nodes are product objects. Each of them may contain otherproduct objects gathered in a product collection. The terminal product objectsin the tree structure have no aggregated product collection. Even if allproducts are located somewhere in the product tree structure, some of them canbe used as reference products to create other products named components, whichare instances of the reference product. For example, the left front wheel in acar can be used as reference to create the other wheels. Be careful: someproperties and methods are dedicated to reference objects only, and some othersare for components only. This is clearly stated for each property or methodconcerned.- activate_default_shape() None ¶
Note
- CAA V5 Visual Basic Help (2020-06-11 12:40:47.360445))
- o Sub ActivateDefaultShape()Activate default shape.
- Return type:
None
- activate_shape(shape_name: str) None ¶
Note
- CAA V5 Visual Basic Help (2020-06-11 12:40:47.360445))
- o Sub ActivateShape(CATBSTR ShapeName)Activate one shape.Parameters:ShapeNameThe name of the shape.
- Parameters:
shape_name (str) –
- Return type:
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 shaperepresentation is the object that gives a geometric shape and allows thevisualization of the product. It can be a CATIA V4 model, a VRML file, or anyother type of document that can be displayed. In a multi representationcontext, the master shape representation is the most meaningful representationof the product according to the user. This is the default shape for the multirepresentation.Note: This master shape representation is optional.Parameters:iShapePathNameThe path name where the master shape representation can be foundExample:This example adds the e:ModelsEngine.model asthe master shape representation to the Engineproduct.Engine.AddMasterShapeRepresentation(“e:ModelsEngine.model”)
- Parameters:
i_shape_path_name (str) –
- Returns:
None
- add_shape_representation(i_shape_path_name: str, i_shape_name: str, i_rep_behavior: int, i_context: bool) 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. Arepresentation is the object that gives a geometric shape and allows thevisualization of the product. It can be a CATIA V4 model, a VRML file, or anyother 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 representationwith different behavior (or the same) is supportedParameters:iShapePathNameThe path name where the representation can be foundiShapeNameThe name that is given to the representation This name is a userfree choiceiRepBehaviorThe behavior of the added representation. It can take the valuescatRep3D if the representation is a 3D one, catRep2D if the representation is a2D one, or catRepText if the representation is a text one.iContextA condition to specify if the added representation can be displayedwith the representation of other products.Example:This example adds the e:ModelsEngine.model asa 3D representation to the Engine product within an assemblycontext.Engine.AddShapeRepresentation(“e:ModelsEngine.model”,”MyShape”,catRep3D,TRUE)
- Parameters:
i_shape_path_name (str) –
i_shape_name (str) –
i_rep_behavior (int) – enum cat_rep_type
i_context (bool) –
- Return type:
None
- property analyze: 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 currentproduct.Example:This example retrieves in EngineAnalysis the Analyze objectofthe Engine product.Dim EngineAnalysis As AnalyzeSet EngineAnalysis = Engine.Analyze
- Return type:
- apply_work_mode(new_mode: int) None ¶
Note
- CAA V5 Visual Basic Help (2020-06-11 12:40:47.360445))
- o Sub ApplyWorkMode(CatWorkModeType newMode)Applies a new working mode.Parameters:newModeThe new working mode.
- Parameters:
new_mode (int) – enum cat_work_mode_type
- Return type:
None
- attributes()¶
Returns a string describing the products attributes. :return: str
- constraints() Constraints ¶
Note
- CAA V5 Visual Basic Help (2020-06-11 12:40:47.360445))
- o Func Connections(CATBSTR iConnectionsType) As CollectionReturns the product’s constraints. The constraint collection of a productgathers the constraints this product should respect to be positioned in thespace.Example:This example retrieves the constraint collection fortheEngine product.Dim EngineConstraints As CollectionSet EngineConstraints = Engine.Constraints
- Parameters:
i_connections_type (str) –
- Returns:
Collection
- count_children()¶
- Returns:
int()
- create_reference_from_name(i_label: str) Reference ¶
Note
- CAA V5 Visual Basic Help (2020-06-11 12:40:47.360445))
- o Func CreateReferenceFromName(CATBSTR iLabel) As ReferenceCreates a reference from a name. A reference is an object that can standfor any geometrical object. Creating references is necessary for addingconstraints between two components using Brep elements of the representationsof these components.Parameters:iLabelThe path of the Brep element to use in the constraint. This path ispassed as a character string comprising the component path from the rootproduct to the component concerned, concatenated to the Brep element path inthe product’s representation. Components are separated using “/”, and theproduct path is separated from the Brep using “/!”. For separating parameterfrom product path use “”.Returns:The created referenceExample:This example creates a reference from the path of a Brep elementin the Prod2 product located below the Root rootproduct. The face is located in the Pad.1 pad and limited bytheCircle.1 circle.Dim Ref As ReferenceRef = Prod2.CreateReferenceFromName(“Root/Prod2/!Face:(Brp:(Pad.1:0(Brp:(Circle.1))):None())”)
- Parameters:
i_label (str) –
- Return type:
- property definition: str¶
Note
- CAA V5 Visual Basic Help (2020-06-11 12:40:47.360445)
- o Property Definition() As CATBSTRReturns or sets the product’s definition.Definition is valid for reference products only.Example:This example retrieves the definition of theEngine product in EngineDef.EngineDef = Engine.Definition
- Return type:
str
- desactivate_default_shape() None ¶
Note
- CAA V5 Visual Basic Help (2020-06-11 12:40:47.360445))
- o Sub DesactivateDefaultShape()Deactivate default shape.
- Return type:
None
- desactivate_shape(shape_name: str) None ¶
Note
- CAA V5 Visual Basic Help (2020-06-11 12:40:47.360445))
- o Sub DesactivateShape(CATBSTR ShapeName)Deactivate one shape.Parameters:ShapeNameThe name of the shape.
- Parameters:
shape_name (str) –
- Return type:
None
- property description_instance: str¶
Note
- CAA V5 Visual Basic Help (2020-06-11 12:40:47.360445)
- o Property DescriptionInst() As CATBSTRReturns or sets the product’s description for a componentproduct.DescriptionInst is valid for component products only.The description is a comment assigned to the component product to helpdescribe or qualify it.Example:This example sets the description for theEngineComp product.Desc = “This is the Engine component product description”EngineComp.DescriptionInst(Desc)
- Return type:
str
- property description_reference: str¶
Note
- CAA V5 Visual Basic Help (2020-06-11 12:40:47.360445)
- o Property DescriptionRef() As CATBSTRReturns or sets the product’s description for a referenceproduct.DescriptionRef is valid for reference products only.The description is a comment assigned to the reference product to helpdescribe or qualify it.Example:This example sets the description for theEngine product.Desc = “This is the Engine reference product description”Engine.DescriptionRef(Desc)
- Return type:
str
- extract_bom(i_file_type: int, i_file: str) 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 ofmaterial displays, for every sub-assembly in the product, the one level depthcomponents and some of their properties.Parameters:iFileTypeSet this parameter to catFileTypeHTML to save to the htmlformat.Set this parameter to catFileTypeTXT to save to the textformat.The catFileTypeMotif should not be used.iFileFile where the bill of material will be saved
- Parameters:
i_file_type (int) – enum cat_file_type
i_file (str) –
- Return type:
None
- property file_name¶
- Returns:
str()
- property full_name¶
- Returns:
str()
- static generate_ALLCATPart(product: Product) Document ¶
Generate an ALLCATPart (CATPart) from CATProduct.
- get_active_shape_name()¶
Note
- CAA V5 Visual Basic Help (2020-06-11 12:40:47.360445))
- o Func GetActiveShapeName() As CATBSTRReturns the name of the active shape.Returns:oShapeName The name of the active shape.
- Returns:
str
- get_all_shapes_names(olistshape: tuple) 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 allocatedwith a size given by GetNumberOfShapes.
- Parameters:
olistshape (tuple) –
- Return type:
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 CATBSTRReturns the default shape.Returns:oShapeName The name of the default shape.
- Returns:
str
- get_master_shape_representation(i_load_if_necessary: bool) AnyObject ¶
Note
- CAA V5 Visual Basic Help (2020-06-11 12:40:47.360445))
- o Func GetMasterShapeRepresentation(boolean iLoadIfNecessary) AsCATBaseDispatchRetrieves the product’s master shape representation.Parameters:iLoadIfNecessaryParameter to set to True if the master shape representation shouldbe loaded to determine if it exists, or to False otherwise.Example:This example retrieves in MSRep theEngine product’s master shape representation.Dim MSRep As ObjectSet MSRep = Engine.GetMasterShapeRepresentation(True)
- Parameters:
i_load_if_necessary (bool) –
- Return type:
- get_master_shape_representation_path_name() str ¶
Note
- CAA V5 Visual Basic Help (2020-06-11 12:40:47.360445))
- o Func GetMasterShapeRepresentationPathName() As CATBSTRRetrieves the product’s master shape representationpathname.Example:This example retrieves in MSRep theEngine product’s master shape representation.Set MSRepPath = Engine.GetMasterShapeRepresentationPathName
- Return type:
str
- get_number_of_shapes() int ¶
Note
- CAA V5 Visual Basic Help (2020-06-11 12:40:47.360445))
- o Func GetNumberOfShapes() As shortReturns the number of ShapesReturns:oNbShapes The number of Shapes.
- Return type:
int
- 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 CATBSTRReturns the path name of a shape for a given shape name.Parameters:iShapeNameThe 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: bool, i_shape_name: str, i_rep_behavior: int, i_context: bool) AnyObject ¶
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 CATBaseDispatchRetrieves the product’s representation with the givenparameters.Parameters:iLoadIfNecessaryParameter to set to True if the master shape representation shouldbe loaded to determine if it exists, or to False otherwise.iShapeNameThe name of the representation of the product.iRepBehaviorThe behavior of the representation. It can take the values catRep3Dif the representation is a 3D one, catRep2D if the representation is a 2D one,or catRepText if the representation is a text one.iContextA condition to specify if the representation is displayed with therepresentation of other products.Example:This example retrieves in MSRep theEngine product’s 3D representation named “PART”.Dim MSRep As ObjectSet MSRep = Engine.GetMasterShapeRepresentation(True,”PART”,catRep3D,TRUE)
- Parameters:
i_load_if_necessary (bool) –
i_shape_name (str) –
i_rep_behavior (int) – enum cat_rep_type
i_context (bool) –
- Returns:
AnyObject
- get_technological_object(i_application_type: str) AnyObject ¶
Note
- CAA V5 Visual Basic Help (2020-06-11 12:40:47.360445))
- o Func GetTechnologicalObject(CATBSTR iApplicationType) AsCATBaseDispatchReturns the product’s applicative data which type is the given parameter.The data returned can be either a collection or a simpleobject.Parameters:iApplicationTypeThe type of applicative data searched.Example:This example retrieves the constraints for theEngine product.Dim EngineConstraints As CollectionSet EngineConstraints = Engine.GetTechnologicalObject(“Constraints”)
- Parameters:
i_application_type (str) –
- Return type:
- has_a_master_shape_representation() bool ¶
Note
- CAA V5 Visual Basic Help (2020-06-11 12:40:47.360445))
- o Func HasAMasterShapeRepresentation() As booleanReturns whether the product has a master shaperepresentation.True if the product has a master shape representation.Example:This example retrieves in HasMSRep whether theEngine product has a master shape representation.HasMSRep = Engine.HasAMasterShapeRepresentation()
- Return type:
bool
- has_children()¶
- Returns:
bool
- has_shape_representation(i_shape_name: str, i_rep_behavior: int, i_context: bool) bool ¶
Note
- CAA V5 Visual Basic Help (2020-06-11 12:40:47.360445))
- o Func HasShapeRepresentation(CATBSTR iShapeName,CatRepType iRepBehavior,boolean iContext) As booleanReturns whether the product has a representation of the given name with agiven behavior.True if the product has such a representation.Parameters:iShapeNameThe name of the representation of the product.iRepBehaviorThe behavior of the representation. It can take the values catRep3Dif the representation is a 3D one, catRep2D if the representation is a 2D one,or catRepText if the representation is a text one.iContextA condition to specify if the representation is displayed with therepresentation of other products.Example:This example retrieves in HasRep whether theEngine product has a master shape representation.HasRep = Engine.HasRepresentation(“PART”,catRep3D,TRUE)
- Parameters:
i_shape_name (str) –
i_rep_behavior (int) – enum cat_rep_type
i_context (bool) –
- Return type:
bool
- is_catpart()¶
- Return type:
bool
- is_catproduct()¶
- Return type:
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 theproduct object and itself aggregates a movable object to which you can apply amove transformation by means of an isometry matrix. It moves your productmaster shape representation according to this isometry.Example:This example retrieves the move object for theEngine product.Dim EngineMoveObject As MoveSet EngineMoveObject = Engine.Move
- Returns:
Move
- property nomenclature: str¶
Note
- CAA V5 Visual Basic Help (2020-06-11 12:40:47.360445)
- o Property Nomenclature() As CATBSTRReturns 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 partis commonly known within an organization”.Example:This example retrieves the nomenclature theEngine product in EngineNom.EngineNom = Engine.Nomenclature
- Return type:
str
- property parameters: 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 theparameters that are aggregated in the different objects of the product might beaccessed through that collection.Example:The following example returns in params the parameters of theproductRoot product from the productDoc productdocument:Set productRoot = productDoc.ProductSet params = productRoot.Parameters
- Return type:
- property part_number: str¶
Note
- CAA V5 Visual Basic Help (2020-06-11 12:40:47.360445)
- o Property PartNumber() As CATBSTRReturns or sets the product’s part number.PartNumber is valid for reference products only.Example:This example sets theEngine product’s part number to A120-253X-7.Engine.PartNumber(“A120-253X-7”)
- Return type:
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 :rtype: Path
- property position: 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 objectaggregated by the product object that holds the position of the master shaperepresentation in the space.Example:This example retrieves the position object for theEngine product.Dim EnginePositionObject As PositionSet EnginePositionObject = Engine.Position
- Return type:
- property products: 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 currentproduct.Example:This example retrieves in EngineChildren the collectionofproducts contained in the Engine product.Dim EngineChildren As ProductsSet EngineChildren = Engine.Products
- Return type:
- property publications: 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.
- Return type:
- property reference_product: 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.
- Return type:
- property relations: 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 therelations that are used to valuate the parameters of the product might beaccessed thru that collection.Example:The following example returns in rels the relations of the productRootproduct from the productDoc product document:Set productRoot = productDoc.ProductSet rels = productRoot.Relations
- Return type:
- remove_master_shape_representation() None ¶
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 shaperepresentation is the object that gives a geometric shape and allows thevisualization of the product. It can be a CATIA V4 model, a VRML file, or anyother type of document that can be displayed. In a multi representationcontext, the master shape representation is the most meaningful representationof the product according to the user. This is the default shape for the multirepresentation.Note: This master shape representation is optional.Example:This example removes the master shape representation oftheEngine product.Engine.RemoveMasterShapeRepresentation()
- Return type:
None
- remove_shape_representation(i_shape_name: str, i_rep_behavior: int, i_context: bool) 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 theobject that gives a geometric shape and allows the visualization of theproduct.. It can be a CATIA V4 model, a VRML file, or any other type ofdocument that can be displayed.Note: This representation is optional.Parameters:iShapeNameThe name of the representation of the product.iRepBehaviorThe behavior of the representation. It can take the values catRep3Dif the representation is a 3D one, catRep2D if the representation is a 2D one,or catRepText if the representation is a text one.iContextA condition to specify if the representation is displayed with therepresentation of other products.Example:This example removes the 3D representation named “PART” oftheEngine product.Engine.RemoveMasterShapeRepresentation(“PART”,catRep3D,TRUE)
- Parameters:
i_shape_name (str) –
i_rep_behavior (int) – enum cat_rep_type
i_context (bool) –
- Return type:
None
- property revision: str¶
Note
- CAA V5 Visual Basic Help (2020-06-11 12:40:47.360445)
- o Property Revision() As CATBSTRReturns or sets the product’s revision number.Revision is valid for reference products only.Example:This example sets theEngine product’s revision number to 3A.Engine.Revision(“3A”)
- Return type:
str
- property source: int¶
Note
- CAA V5 Visual Basic Help (2020-06-11 12:40:47.360445)
- o Property Source() As CatProductSourceReturns 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 planfor obtaining the product”. The source can take the values catProductMade ifthe product is made internally, catProductBought if it is purchased from avendor, or catProductUnknown if its origin is notdetermined.Example:This example sets the source for theEngine product to catProductMade.Engine.Source(catProductMade)
- Returns:
enum cat_product_source
- Return type:
int
- property type: str¶
Returns the type of product (CATProduct, CATPart or Component).
- Return type:
str
- update() None ¶
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 partmaking the product or to the product’s representation. It takes into accountthe components of the product at any levelExample:The following example updates the root product:Dim RootProduct As ProductSet Rootproduct = productDoc.ProductRootproduct.Update
- Return type:
None
- property user_ref_properties: Parameters¶
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 theuser defined properties that are created in the reference product might beaccessed through that collection.Only available on reference products.Example:The following example returns in UserProps the properties of theproductRoot product from the productDoc productdocument:Set productRoot = productDoc.ProductSet UserProps = productRoot.UserRefProperties
- Return type: