pycatia.mec_mod_interfaces.part

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.mec_mod_interfaces.part.Part(com_part_object)

Note

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

System.IUnknown
System.IDispatch
System.CATBaseUnknown
System.CATBaseDispatch
System.AnyObject
Part

The root level object inside a PartDocument object.
Role: It aggregates all the objects making up the part
document.
It provides many factories and collections. The collections list only the
direct children of the part. Selection.Search allows to get all objects of one
type.

See also:
PartDocument
activate(i_object: AnyObject) None

Note

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

Unsuppresses an object for the update process. A unsuppressed object is
again taken into account for the calculation of the part.

Parameters:

iObject
The object to unsuppress for the update process

Example:
The following example unsuppresses the pad1 pad:

Set partRoot = partDoc.Part
Set pad1 = partRoot.FindObjectByName(“Pad.1”)
partRoot.Activate(pad1)
Parameters:

i_object (AnyObject) –

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 current
product.

Example:

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


Dim EngineAnalysis As Analyze
Set EngineAnalysis = Engine.Analyze
Return type:

Analyze

property annotation_sets: Collection

Note

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

Returns the collection object containing the annotation sets. All the
annotation sets that are aggregated in the part might be accessed thru that
collection.

Example:
The following example returns in annotationSets the annotation sets of
the partRoot part from the partDoc part document:

Set partRoot = partDoc.Part
Dim annotationSets As AnnotationSets
Set annotationSets = partRoot.AnnotationSets
Returns:

Collection

property axis_systems: AxisSystems

Note

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

Returns the collection object containing the coordinate systems. All the
coordinate systems that are aggregated in the part might be accessed thru that
collection.

Example:
The following example returns in axisSystems the coordinate systems of
the partRoot part from the partDoc part document:

Set partRoot = partDoc.Part
Dim axisSystems As AxisSystems
Set axisSystems = partRoot.AxisSystems
Returns:

AxisSystems

This will only return axis systems under the Axis Systems node. Axis systems within a Geometrical Set will not be returned.

property bodies: Bodies

Note

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

Returns the collection object containing the bodies that are direct
children of the part.
It does not return all the bodies of the part, particularly the bodies in a
boolean operation.

Example:
The following example returns in bodiesColl the collection of the
bodies of the partRoot part from the partDoc part
document:

Set partRoot = partDoc.Part
Set bodiesColl = partRoot.Bodies
Return type:

Bodies

property constraints: Constraints

Note

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

Returns the collection object containing the part constraints. Only 3D
constraints are concerned here, 2D constraints are managed in
sketches.

Example:
The following example returns in csts the constraints of the partRoot
part from the partDoc part document:

Set partRoot = partDoc.Part
Set csts = partRoot.Constraints
Return type:

Constraints

create_reference_from_b_rep_name(i_label: str, i_object_context: AnyObject)

Note

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

Creates a reference from a GenericNaming label. This allows manipulation of
B-Rep (Type Functinal and Relimited) that are not easy to
access.

Parameters:

iLabel
The GenericNaming identification for an object. This is a cryptic
form for “the edge surrounded by the face extruded from line.12 of sketch.4 and
the face…”)
iObjectContext
The Object Context of Resolution This is the feature used for label
GenericNaming resolution

Returns:
The reference to a B-Rep sub-element such a face or an edge
Parameters:
  • i_label (str) –

  • i_object_context (AnyObject) –

Return type:

Reference

create_reference_from_geometry(i_object: AnyObject) Reference

Note

Microsoft Visual Basic Object Browser
Function CreateReferenceFromGeometry(iObject As AnyObject) As Reference
Member of MECMOD.Part
Parameters:

i_object (AnyObject) –

Return type:

Reference

create_reference_from_name(i_label: str)

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 GenericNaming label. This allows manipulation of
B-Rep (type Functional Only) that are not easy to access.

Parameters:

iLabel
The GenericNaming identification for an object. This is a cryptic
form for “the edge surrounded by the face extruded from line.12 of sketch.4 and
the face…”)

Returns:
The reference to a B-Rep sub-element such a face or an edge
Parameters:

i_label (str) –

Return type:

Reference

create_reference_from_object(i_object: AnyObject)

Note

CAA V5 Visual Basic Help (2020-06-11 12:40:47.360445))
o Func CreateReferenceFromObject(AnyObject iObject) As
Reference

Creates a reference from a operator. Use of reference allows a uniform
handling of B-Rep and non B-Rep objects.

Parameters:

iObject
The geometric object to be referenced. It can be a plane, a line or
a point.

Returns:
The reference to the object. This way, a direction can be either an
edge of a pad or a 3D line.
Parameters:

i_object (AnyObject) –

Return type:

Reference

deactivate(i_object: AnyObject) None

See inactivate :param i_object: :rtype: None

property density: float

Note

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

Returns the part density.

Example:
The following example displays the density of the
part:

Set partRoot = partDoc.Part
MsgBox “The density is “ & partRoot.Density
Return type:

float

property file_name: str
Return type:

str

find_object_by_name(i_obj_name: str) AnyObject

Note

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

Finds an object that is not a collection by its name. Scan in depth among
all the direct and indirect children (expensive, but hard to
escape).

Parameters:

iObjName
The name to be searched

Returns:
The object, if found
Example:
The following example tests if the object was found:

Set partRoot = partDoc.Part
Set obj = partRoot.FindObjectByName(“Wrong name”)
If TypeName(obj)=”Nothing” Then
MsgBox “Object not found”
End If
Parameters:

i_obj_name (str) –

Return type:

AnyObject

property full_name: str
Return type:

str

property geometric_elements: GeometricElements

Note

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

Returns the collection object containing the part geometrical elements.
Only 3D elements are concerned here, 2D elements are managed in sketches. The
origin elements are also accessible thru that collection.

Example:
The following example returns in geomElts the 3D elements of the
partRoot part from the partDoc part document:

Set partRoot = partDoc.Part
Set geomElts = partRoot.GeometricElements
Return type:

GeometricElements

get_customer_factory(i_factory_iid: str) Factory

Note

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

Returns a customer factory from a code string defined by the customer. It
allows a customer to define its own factory to create its own
objects.

Parameters:

iFactoryIID
The code name of the factory
Parameters:

i_factory_iid (str) –

Return type:

Factory

property hybrid_bodies: HybridBodies

Note

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

Returns the collection object containing the hybrid bodies that are direct
children of the part.

Example:
The following example returns in hybridBodiesColl the collection of
hybrid bodies of the partRoot part from the partDoc part
document:

Set partRoot = partDoc.Part
Set hybridBodiesColl = partRoot.HybridBodies
Return type:

HybridBodies

property hybrid_shape_factory: HybridShapeFactory

Note

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

Returns the part hybrid shape factory. It allows the creation of hybrid
shapes in the part.

Example:
The following example returns in hybridShapeFact the hybrid shape
factory of the partRoot part from the partDoc part
document:

Set partRoot = partDoc.Part
Dim hybridShapeFact As Factory
Set hybridShapeFact = partRoot.HybridShapeFactory
Return type:

HybridShapeFactory

property in_work_object: AnyObject

Note

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

Returns or sets the in work object of the part. The in work object is the
object after which a new object is added.

Example:

Set partRoot = partDoc.Part
Set partRoot.InWorkObject = cylindricPad
If ( partRoot.InWorkObject <> cylindricPad ) Then
MsgBox “There is a big problem”
End If
Return type:

AnyObject

inactivate(i_object: AnyObject) None

Note

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

Suppresses an object from being updated. A suppressed object is not taken
into account for the calculation of the part.

Parameters:

iObject
The object to suppress from being updated

Example:
The following example suppresses the pad1 pad from being
updated:

Set partRoot = partDoc.Part
Set pad1 = partRoot.FindObjectByName(“Pad.1”)
partRoot.Inactivate(pad1)
Parameters:

i_object (AnyObject) –

Return type:

None

is_inactive(i_object: AnyObject) bool

Note

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

Indicates whether an object is deactivated. A deactivated object is not
taken into account for the calculation of the part.

Parameters:

iObject
The object to examine

Example:
The following example returns in isInactive whether the pad1 pad is
deactivated:

Set partRoot = partDoc.Part
Set pad1 = partRoot.FindObjectByName(“Pad.1”)
isInactive = partRoot.IsInactive(pad1)
Parameters:

i_object (AnyObject) –

Return type:

bool

is_up_to_date(i_object: AnyObject) bool

Note

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

Indicates whether an object needs to be updated. An object which is not
up-to-date has not be calculated with the last
specifications.

Parameters:

iObject
The object to examine

Example:
The following example returns in isuptodate whether the pad1 pad is
up-to-date:

Set partRoot = partDoc.Part
Set pad1 = partRoot.FindObjectByName(“Pad.1”)
isuptodate = partRoot.IsUpToDate(pad1)
Parameters:

i_object (AnyObject) –

Return type:

bool

property main_body: Body

Note

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

Returns or sets the main body of the part.

Example:
The following example returns the main body of the part of the current
document.

Dim mainBody As Body
Set mainBody=CATIA.ActiveDocument.Part.MainBody
Return type:

Body

property ordered_geometrical_sets: OrderedGeometricalSets

Note

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

Returns the collection object containing the ordered geometrical sets of
the part.

Example:
The following example returns in ogsColl the collection of ordered
geometrical sets of the partRoot part from the partDoc part
document:

Set partRoot = partDoc.Part
Set ogsColl = partRoot.OrderedGeometricalSets
Return type:

OrderedGeometricalSets

property origin_elements: OriginElements

Note

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

Returns the object defining the part 3D reference axis
system.

Example:
The following example returns in originElts the origin of the partRoot
part from the partDoc part document:

Set partRoot = partDoc.Part
Set originElts = partRoot.OriginElements
Return type:

OriginElements

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 part parameters. All the
parameters that are aggregated in the different objects of the part might be
accessed thru that collection.

Example:
The following example returns in params the parameters of the partRoot
part from the partDoc part document:

Set partRoot = partDoc.Part
Dim params As Parameters
Set params = partRoot.Parameters
Return type:

Parameters

path() Path

Returns the pathlib.Path() object of the document fullname. example e://users//psr//Parts//MyNicePart.CATPart >>> Part.path().name MyNicePart.CATPart >>> Part.path().parent e://users//psr//Parts// >>> Part.path().suffix .CATPart

Return type:

Path()

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 part relations. All the
relations that are used to valuate the parameters of the part might be accessed
thru that collection.

Example:
The following example returns in rels the relations of the partRoot
part from the partDoc part document:

Set partRoot = partDoc.Part
Set rels = partRoot.Relations
Return type:

Relations

property shape_factory: ShapeFactory

Note

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

Returns the part shape factory. It allows the creation of shapes in the
part.

Example:
The following example returns in shapeFact the shape factory of the
partRoot part from the partDoc part document:

Set partRoot = partDoc.Part
Dim shapeFact As Factory
Set shapeFact = partRoot.ShapeFactory
Return type:

ShapeFactory

property sheet_metal_factory: Factory

Note

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

Returns the sheet metal factory of the part. It allows the creation of
sheet metal elements in the part.

Example:
The following example returns in sheetMetalFact the sheet metal factory
of the partRoot part from the partDoc part document:

Set partRoot = partDoc.Part
Dim sheetMetalFact As Factory
Set sheetMetalFact = partRoot.SheetMetalFactory
Returns:

Factory

Returns:

Factory

property sheet_metal_parameters: AnyObject

Note

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

Returns the sheet metal parameters of the part.

Example:
The following example returns in sheetMetalParm the sheet metal
parameters of the partRoot part from the partDoc part
document:

Set partRoot = partDoc.Part
Dim sheetMetalParm As SheetMetalParameters
Set sheetMetalFact = partRoot.SheetMetalParameters
Return type:

AnyObject

update() None

Note

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

Updates of the part result with respect to its specifications. Any
composing specification that hasn’t its result up-to-date will recompute it,
thus propagating changes to the whole part.

Example:
The following example update the part:

Set partRoot = partDoc.Part
partRoot.Update
Return type:

None

update_object(i_object: AnyObject) None

Note

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

Updates an object with respect to its specifications. Any composing
specification of the object that hasn’t its result up-to-date will recompute
it, thus propagating changes to the object.

Parameters:

iObject
The object to be updated

Example:
The following example updates Pad.1:

Set partRoot = partDoc.Part
Set pad1 = partRoot.FindObjectByName(“Pad.1”)
partRoot.UpdateObject(pad1)
Parameters:

i_object (AnyObject) –

Return type:

None

property user_surfaces: Collection

Note

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

Returns the collection object containing the user surfaces. All the user
surfaces that are aggregated in the part might be accessed thru that
collection.

Example:
The following example returns in userSurfaces the user surfaces of the
partRoot part from the partDoc part document:

Set partRoot = partDoc.Part
Dim userSurfaces As UserSurfaces
Set userSurfaces = partRoot.UserSurfaces
Return type:

Collection