pycatia.mec_mod_interfaces.constraint¶
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.constraint.Constraint(com_object)¶
Note
CAA V5 Visual Basic Help (2020-06-11 12:40:47.360445)
System.IUnknownSystem.IDispatchSystem.CATBaseUnknownSystem.CATBaseDispatchSystem.AnyObjectConstraintA geometric constraint set for geometric elements of a part, a sketch, or aproduct.- activate() None ¶
Note
- CAA V5 Visual Basic Help (2020-06-11 12:40:47.360445))
- o Sub Activate()Unsuppresses a constraint for the update process. An activated constraintis again taken into account for the calculation of the part or product.Example:The following example es the pad1 pad:Example:The following example activates the tangencyCst constraint:tangencyCst.Activate
- Return type:
None
- property angle_sector: int¶
Note
- CAA V5 Visual Basic Help (2020-06-11 12:40:47.360445)
- o Property AngleSector() As CatConstraintAngleSectorReturns or sets the constraint angle (or angular) sector. The geometric elements of an angleconstraint (e.g. : 2 lines or 2 planes) divide the sketch or the space in 4 regions which arecalled angle or angular sectors, numbered from 0 to 3. 1 / 0 —/— 2/ 3 By default, theconstraint is created in the sector number 0. One angle sector corresponds exactly to particularvalues of the Dimension.Value, the Side and the Orientation. When changing the angle sector, theDimension.Value, Side and Orientation are also modified.Parameters:AngleSector=0The default sector of a constraint.Dimension.Value= angle Orientation= catCstOrientSame Side= catCstSidePositiveAngleSector=1Dimension.Value= angle-180 if angle>180 abs(angle)+180 otherwise Orientation= catCstOrientOpposite Side= catCstSidePositiveAngleSector=2Dimension.Value= abs(540-angle) if angle>180 180-fabs(angle) otherwise Orientation= catCstOrientOpposite Side= catCstSideNegativeAngleSector=3Dimension.Value= 360-abs(angle) Orientation= catCstOrientSame Side= catCstSideNegativeExample:The following example retrieves in angleSector the angle sectorof the angleCst angle constraint and then changes the anglesectorangleSector = angleCst.AngleSectorangleCst.AngleSector = 2
- Returns:
enum cat_constraint_angle_sector
- Return type:
int
- deactivate() None ¶
Note
- CAA V5 Visual Basic Help (2020-06-11 12:40:47.360445))
- o Sub Deactivate()Suppresses the constraint from being updated. A deactivated constraint isnot taken into account for the calculation of the part or of the product.Example:The following example deactivates the tangencyCst constraint from beingupdated:tangencyCst.Deactivate
- Return type:
None
- property dimension: Dimension¶
Note
- CAA V5 Visual Basic Help (2020-06-11 12:40:47.360445)
- o Property Dimension() As Dimension (Read Only)Returns the constraint dimension. The dimension may be meaningless for sometypes of constraints such as tangency constraints, or if the constraint is notcurrently satisfied. Use the Status property to check whether the constraint issatisfied.Example:The following example returns in cstDimension the dimension of thefirstCst constraint:Set cstDimension = firstCst.Dimension
- Return type:
- property distance_config: int¶
Note
- CAA V5 Visual Basic Help (2020-06-11 12:40:47.360445)
- o Property DistanceConfig() As CatConstraintDistConfigReturns or sets the distance constraint configuration. Distance constraintsbetween lines and cylinders offer often more degrees of freedom to geometrythan acually desired. This property allows to limit these degrees of freedomwithout having to redefine additional constraints. This property is useless forconstraints whose type is not distance.Example:The following example retrieves in distCstConfig the configuration ofthe distCst distance constraint:distCstConfig = distCst.DistanceConfig
- Returns:
enum cat_constraint_dist_config
- Return type:
int
- property distance_direction: int¶
Note
- CAA V5 Visual Basic Help (2020-06-11 12:40:47.360445)
- o Property DistanceDirection() As CatConstraintDistDirectionReturns or sets the distance constraint direction. This property is useless for constraints whosetype is not Distance (1). Distance constraints may be measured along a particular direction.Example:The following example retrieves in distCstDirection the configurationof the distCst distance constraint:distCstConfig = distCst.DistanceDirection
- Returns:
enum cat_constraint_dist_direction
- Return type:
int
- get_constraint_element(i_element_number: int) Reference ¶
Note
- CAA V5 Visual Basic Help (2020-06-11 12:40:47.360445))
- o Func GetConstraintElement(long iElementNumber) AsReferenceReads an element of a constraint.Parameters:iElementNumberThe number of the element of the constraint to be read. (1 for the first element,2 forthe second, 3 for the third). Notice it must not exceed the total number of elements ofthe constraint. (eg : not allowed to read the third element of a tangency).oCurrentElementAn element of the constraint.Example:The following example reads the first element of aconstraintDim reference1 As Referencereference1=tangencyCst.GetConstraintElement( 1 )
- Parameters:
i_element_number (int) –
- Return type:
- get_constraint_visu_location(o_anchor_point: tuple, o_anchor_vector: tuple) None ¶
Note
- CAA V5 Visual Basic Help (2020-06-11 12:40:47.360445))
- o Sub GetConstraintVisuLocation(CATSafeArrayVariantoAnchorPoint,CATSafeArrayVariant oAnchorVector)Returns the constraint visualisation location. When displayed on screen,the constraint is visualized as a dimension positioned close to the constrainedgeometric element(s). This method retrieves the data used to position thisrepresentation within the 3D space.Parameters:oAnchorPointA Safe Array made up of 3 doubles: X, Y, Z, representing thecoordinates in model space of the point where the constraint value isdisplayed.oAnchorVectorA Safe Array made up of 3 doubles : X, Y, Z, representing the vector normal to the planeonto which the constraint value is displayed.Example:The following example retrieves in anchorPt the anchor point of thetangencyCst tangency constraint:Dim anchorPoint(2)Dim anchorVector(2)tangencyCst.ConstraintVisuLocationanchorPoint,vectorPoint
- Parameters:
o_anchor_point (tuple) –
o_anchor_vector (tuple) –
- Return type:
None
- is_inactive() bool ¶
Note
- CAA V5 Visual Basic Help (2020-06-11 12:40:47.360445))
- o Func IsInactive() As booleanIndicates whether a constraint is suppressed from the update process. Asuppressed constraint is not taken into account for the calculation of part orthe product. The method returns True if the constraint is not active, False ifthe constraint is active.Example:The following example returns in isInactive whether the tangencyCstconstraint is suppressed from the update process:Set isInactive = tangencyCst.IsInactive
- Return type:
bool
- property mode: int¶
Note
- CAA V5 Visual Basic Help (2020-06-11 12:40:47.360445)
- o Property Mode() As CatConstraintModeReturns or sets the constraint driving mode. For constraint typessupporting the concept of value, such as distance constraints, the driving modetells whether the constraint value actually drives the geometry position, or,conversely, is driven by it.Example:The following example retrieves in currentMode the driving mode for thedistCst distance constraint:currentMode = distCst.Mode
- Returns:
enum cat_constraint_mode
- Return type:
int
- property orientation: int¶
Note
- CAA V5 Visual Basic Help (2020-06-11 12:40:47.360445)
- o Property Orientation() As CatConstraintOrientationReturns or sets the constraint orientation. This is used for constraintsthat involve two geometric elements and specifies the orientation for thesecond geometric element with regard to the first one, when several possibleorientations are all satisfying the constraint.Example:The following example retrieves the in distCstOrient the orientation ofthe distCst distance constraint:distCstOrient = distCst.Orientation
- Returns:
enum cat_constraint_orientation
- Return type:
int
- property reference_axis: int¶
Note
- CAA V5 Visual Basic Help (2020-06-11 12:40:47.360445)
- o Property ReferenceAxis() As CatConstraintRefAxisReturns or sets the constraint reference axis. AxisParallel orAxisPerpendicular constraint types define which axis they relate to throughthis property, which makes no sense for constraints of anothertype.Example:The following example retrieves in refAxis the reference axis for theaxisPerpCst AxisPerpendicular constraint:refAxis = axisPerpCst.ReferenceAxis
- Returns:
enum cat_constraint_ref_axis
- Return type:
int
- property reference_type: int¶
Note
- CAA V5 Visual Basic Help (2020-06-11 12:40:47.360445)
- o Property ReferenceType() As CatConstraintRefTypeReturns or sets the constraint reference type. This property is used onlyfor Reference constraints in the Assembly context.Example:The following example applies to the reference constraint refCst2 thereference type of the constraint refCst1.refCst2.ReferenceType = refCst1.ReferenceType
- Returns:
enum cat_constraint_ref_type
- Return type:
int
- set_constraint_element(i_element_number: int, i_new_element: Reference) None ¶
Note
- CAA V5 Visual Basic Help (2020-06-11 12:40:47.360445))
- o Sub SetConstraintElement(long iElementNumber,Reference iNewElement)Replaces an element of a constraint.Parameters:iElementNumberThe number of the element of the constraint to replace. (1 for thefirst element,2 for the second, 3 for the third).iNewElementA new element of the constraint.Example:The following example changes the second element of aconstraintDim reference1 As ReferencetangencyCst.SetConstraintElement ( 2, reference1)
- Parameters:
i_element_number (int) –
i_new_element (Reference) –
- Return type:
None
- set_constraint_visu_location(i_new_x: float, i_new_y: float, i_new_z: float) None ¶
Note
- CAA V5 Visual Basic Help (2020-06-11 12:40:47.360445))
- o Sub SetConstraintVisuLocation(double iNewX,double iNewY,double iNewZ)Sets a new location for the constraint visualization.Parameters:iNewXThe new value for the constraint anchor point X coordinateiNewYThe new value for the constraint anchor point Y coordinateiNewZThe new value for the constraint anchor point Z coordinateExample:The following example changes the anchor point coordinates to10,0,0tangencyCst.SetConstraintVisuLocation 10,0,0
- Parameters:
i_new_x (float) –
i_new_y (float) –
i_new_z (float) –
- Return type:
None
- property side: int¶
Note
- CAA V5 Visual Basic Help (2020-06-11 12:40:47.360445)
- o Property Side() As CatConstraintSideReturns or sets the constraint side. Some constraint types need torelatively position the constrained geometries, when several possibleconfigurations are all satisfying the constraint.Example:The following example retrieves in distCstSide the side of the distCstdistance constraint:distCstSide = distCst.Side
- Returns:
enum cat_constraint_side
- Return type:
int
- property status: int¶
Note
- CAA V5 Visual Basic Help (2020-06-11 12:40:47.360445)
- o Property Status() As CatConstraintStatus (Read Only)Returns the constraint status. The constraint status is a diagnosis onwhether the constraint is satisfied.Example:The following example retrieves the status of the distCst distanceconstraint.distCstSts = distCst.Status
- Returns:
enum cat_constraint_status
- Return type:
int
- property type: int¶
Note
- CAA V5 Visual Basic Help (2020-06-11 12:40:47.360445)
- o Property Type() As CatConstraintType (Read Only)Returns the constraint type.Example:The following example returns in cstType the type of the firstCstconstraint:cstType = firstCst.Type
- Returns:
enum cat_constraint_type
- Return type:
int