pycatia.dnb_human_modeling_interfaces.swk_segment¶
Module initially auto generated using V5Automation files from CATIA V5 R28 on 2020-09-25 14:34:21.593357
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.dnb_human_modeling_interfaces.swk_segment.SWKSegment(com_object)¶
Note
CAA V5 Visual Basic Help (2020-09-25 14:34:21.593357)
System.IUnknownSystem.IDispatchSystem.CATBaseUnknownSystem.CATBaseDispatchSystem.AnyObjectDNBHumanModelingInterfaces.SWKBodyElementSWKSegmentThis interface deals with a segment of a manikin.- apply_position(pi_position_increment: tuple, pi_start_segment: str) None ¶
Note
- CAA V5 Visual Basic Help (2020-09-25 14:34:21.593357))
- o Sub ApplyPosition(CATSafeArrayVariant piPositionIncrement,CATBSTR piStartSegment)Applies a new relative position for the segment.Parameters:piPositionIncrementThe new position to combine with the segment’s currentposition.This array must contain 12 numbers, and msut be initialized usingthe four columns of a transformation matrix. The first nine componentsrepresent the rotation matrix.The last three components represent the translationvector.piStartSegmentThe short name of the first segment of the kinematics chain. Theshort name specified has to identify a valid segment, which is an ancestor ofthe current one. For instance, is the segment to position is the right hand,then that start segment might be “RSArCl” (right clavicular). If the string“Default” is specified, then the start segment will be automatically chosen.Example:This example sets the segment to a 45-degree rotationaroundthe x axis and at a (10, 20, 30) translation from theorigin.Dim myPosition(11)‘Rotation (45 degrees around the x axis)myPosition(0) = 1.000myPosition(1) = 0myPosition(2) = 0myPosition(3) = 0myPosition(4) = 0.707myPosition(5) = 0.707myPosition(6) = 0myPosition(7) = -0.707myPosition(8) = 0.707‘Translation vector (10,20,30)myPosition(9) = 10.000myPosition(10) = 20.000myPosition(11) = 30.000myManikin.Body.GetItem(“LSHaCPr”).ApplyPositionmyPosition
- Parameters:
pi_position_increment (tuple) –
pi_start_segment (str) –
- Return type:
None
- attach(pi_object_to_attach: AnyObject) None ¶
Note
- CAA V5 Visual Basic Help (2020-09-25 14:34:21.593357))
- o Sub Attach(AnyObject piObjectToAttach)Attach a geometry to the segment.Parameters:piObjectToAttachThe object to attach. This object must be a movable object. Oncethe attach relationship is made, the object’s postition will be updated everytime the segment moves.
- Parameters:
pi_object_to_attach (AnyObject) –
- Return type:
None
- property attach_size: int¶
Note
- CAA V5 Visual Basic Help (2020-09-25 14:34:21.593357)
- o Property AttachSize() As long (Read Only)Returns the number of objects currently attached to thesegment.
- Return type:
int
- create_reach_envelope() None ¶
Note
- CAA V5 Visual Basic Help (2020-09-25 14:34:21.593357))
- o Sub CreateReachEnvelope()This method creates and displayed the reach envelope on the currentsegment. This segment must be part of the hand, otherwise an error code isreturned.Property IsOnHand can be used to check whether the segment is located onthe hand.
- Return type:
None
- destroy_reach_envelope() None ¶
Note
- CAA V5 Visual Basic Help (2020-09-25 14:34:21.593357))
- o Sub DestroyReachEnvelope()This method destroys the reach envelope previously created for thissegment.
- Return type:
None
- detach(pi_object_to_detach: AnyObject) None ¶
Note
- CAA V5 Visual Basic Help (2020-09-25 14:34:21.593357))
- o Sub Detach(AnyObject piObjectToDetach)Detach a geometry previously attached to the segment.Parameters:piObjectToDetachThe object to detach. This object’s will no longer be driven by thesegment’s position.
- Parameters:
pi_object_to_detach (AnyObject) –
- Return type:
None
- detach_all() None ¶
Note
- CAA V5 Visual Basic Help (2020-09-25 14:34:21.593357))
- o Sub DetachAll()Detach all objects attached so far to the segment.
- Return type:
None
- property end_position_x: float¶
Note
- CAA V5 Visual Basic Help (2020-09-25 14:34:21.593357)
- o Property EndPositionX() As double (Read Only)Returns the global x coordinate of the endpoint of thesegment.
- Return type:
float
- property end_position_y: float¶
Note
- CAA V5 Visual Basic Help (2020-09-25 14:34:21.593357)
- o Property EndPositionY() As double (Read Only)Returns the global y coordinate of the endpoint of thesegment.
- Return type:
float
- property end_position_z: float¶
Note
- CAA V5 Visual Basic Help (2020-09-25 14:34:21.593357)
- o Property EndPositionZ() As double (Read Only)Returns the global z coordinate of the endpoint of thesegment.
- Return type:
float
- get_attached_object(pi_index: int) AnyObject ¶
Note
- CAA V5 Visual Basic Help (2020-09-25 14:34:21.593357))
- o Func GetAttachedObject(long piIndex) As AnyObjectRetrieve one object currently attached to the segment.Parameters:piIndexThe index of the object to retrieve. First attached object is atindex 0.
- Parameters:
pi_index (int) –
- Return type:
- get_dof(pi_dof_number: int) SWKDOF ¶
Note
- CAA V5 Visual Basic Help (2020-09-25 14:34:21.593357))
- o Func GetDOF(long piDOFNumber) As SWKDOFReturns a specific degree of freedom of the segment.A segment may have up to three degrees of freedom,and these are numbered from 0 to 2.However, the degrees of freedom do not always haveconsecutive indices. For instance the forearmhas 2 DOFs, but these are numbered 0 and 2.That is why the set of DOFs under a segment cannotbe properly accessed as if it was a collection.To loop through the degrees of freedom of a segment,one should test the value of properties IsDOFAt0, IsDOFAt1 or IsDOFAt2, andwork with theDOF only if the value of one of the corresponding propertyisTrue.Parameters:piDOFNumberThe index of the DOF to retrieve.This parameter must be either 0, 1 or 2.
- Parameters:
pi_dof_number (int) –
- Return type:
- get_ik_offset(po_offset: tuple) None ¶
Note
- CAA V5 Visual Basic Help (2020-09-25 14:34:21.593357))
- o Sub GetIKOffset(CATSafeArrayVariant poOffset)Returns:The IK offset for this segment.
- Parameters:
po_offset (tuple) –
- Return type:
None
- get_ik_position(po_ik_position: tuple) None ¶
Note
- CAA V5 Visual Basic Help (2020-09-25 14:34:21.593357))
- o Sub GetIKPosition(CATSafeArrayVariant poIKPosition)Returns:The position used for IK on this segment.
- Parameters:
po_ik_position (tuple) –
- Return type:
None
- is_attached(pi_object: AnyObject) bool ¶
Note
- CAA V5 Visual Basic Help (2020-09-25 14:34:21.593357))
- o Func IsAttached(AnyObject piObject) As booleanReturns:true if the object passed in the parameter is attached to the segment,false otherwise.
- Parameters:
pi_object (AnyObject) –
- Return type:
bool
- property is_dof_at0: bool¶
Note
- CAA V5 Visual Basic Help (2020-09-25 14:34:21.593357)
- o Property IsDOFAt0() As boolean (Read Only)Returns True if there is a DOF at index 0, False otherwise.
- Return type:
bool
- property is_dof_at1: bool¶
Note
- CAA V5 Visual Basic Help (2020-09-25 14:34:21.593357)
- o Property IsDOFAt1() As boolean (Read Only)Returns True if there is a DOF at index 1, False otherwise.
- Return type:
bool
- property is_dof_at2: bool¶
Note
- CAA V5 Visual Basic Help (2020-09-25 14:34:21.593357)
- o Property IsDOFAt2() As boolean (Read Only)Returns True if there is a DOF at index 2, False otherwise.
- Return type:
bool
- is_object_reachable(pi_object: AnyObject) bool ¶
Note
- CAA V5 Visual Basic Help (2020-09-25 14:34:21.593357))
- o Func IsObjectReachable(AnyObject piObject) As booleanReachability check.Returns:true if the object passed is reachable by the segment, false otherwise.The position taken is that of the center of the object.
- Parameters:
pi_object (AnyObject) –
- Return type:
bool
- property is_on_hand: bool¶
Note
- CAA V5 Visual Basic Help (2020-09-25 14:34:21.593357)
- o Property IsOnHand() As boolean (Read Only)This property is True if this segment belongs to the manikin’s hand.
- Return type:
bool
- property is_on_left_side: bool¶
Note
- CAA V5 Visual Basic Help (2020-09-25 14:34:21.593357)
- o Property IsOnLeftSide() As boolean (Read Only)This property is True if this segment is on the left side of the manikin.
- Return type:
bool
- property is_on_right_side: bool¶
Note
- CAA V5 Visual Basic Help (2020-09-25 14:34:21.593357)
- o Property IsOnRightSide() As boolean (Read Only)This property is True if this segment is on the right side of the manikin.
- Return type:
bool
- property is_on_spine: bool¶
Note
- CAA V5 Visual Basic Help (2020-09-25 14:34:21.593357)
- o Property IsOnSpine() As boolean (Read Only)This property is True if this segment belongs to the manikin’s spine.
- Return type:
bool
- is_reachable(pi_x: float, pi_y: float, pi_z: float) bool ¶
Note
- CAA V5 Visual Basic Help (2020-09-25 14:34:21.593357))
- o Func IsReachable(double piX,double piY,double piZ) As booleanReachability check.Returns:true if the location expressed in the coordinates is reachable by thesegment, false otherwise.
- Parameters:
pi_x (float) –
pi_y (float) –
pi_z (float) –
- Return type:
bool
- property length: float¶
Note
- CAA V5 Visual Basic Help (2020-09-25 14:34:21.593357)
- o Property Length() As double (Read Only)Returns the length of the segment, in centimeters.
- Return type:
float
- lock_posture(pi_dof_id: int) None ¶
Note
- CAA V5 Visual Basic Help (2020-09-25 14:34:21.593357))
- o Sub LockPosture(long piDOFId)Lock the posture of the segment.
- Parameters:
pi_dof_id (int) –
- Return type:
None
- mirror_copy_angular_limitations(pi_dof_id: int) None ¶
Note
- CAA V5 Visual Basic Help (2020-09-25 14:34:21.593357))
- o Sub MirrorCopyAngularLimitations(long piDOFId)Mirror copy the angular limitations of the segment.
- Parameters:
pi_dof_id (int) –
- Return type:
None
- mirror_copy_posture() None ¶
Note
- CAA V5 Visual Basic Help (2020-09-25 14:34:21.593357))
- o Sub MirrorCopyPosture()Copy the posture on the equivalent segment, on the other side of themanikin. For instance, it copies the posture from the right leg to the leftleg.
- Return type:
None
- mirror_copy_pref_angles(pi_dof_id: int) None ¶
Note
- CAA V5 Visual Basic Help (2020-09-25 14:34:21.593357))
- o Sub MirrorCopyPrefAngles(long piDOFId)Mirror copy the preferred angles of the segment.
- Parameters:
pi_dof_id (int) –
- Return type:
None
- property mirror_segment: AnyObject¶
Note
- CAA V5 Visual Basic Help (2020-09-25 14:34:21.593357)
- o Property MirrorSegment() As CATBaseDispatch (Read Only)This property returns the equivalent segment, but on the opposite side(ex.: right leg <-> left leg).
- Return type:
- property nb_do_fs: int¶
Note
- CAA V5 Visual Basic Help (2020-09-25 14:34:21.593357)
- o Property NbDOFs() As long (Read Only)Returns the number of degrees of freedom on the current segment.Each segment can have up to three degrees of freedom.Therefore the value of this property will never be higher than 3.
- Return type:
int
- optimize(pi_dof_id: int) None ¶
Note
- CAA V5 Visual Basic Help (2020-09-25 14:34:21.593357))
- o Sub Optimize(long piDOFId)Sets the limits to match the best PrefAngle for the DOF piDOFId
- Parameters:
pi_dof_id (int) –
- Return type:
None
- remove_limits(pi_dof_id: int) None ¶
Note
- CAA V5 Visual Basic Help (2020-09-25 14:34:21.593357))
- o Sub RemoveLimits(long piDOFId)Removes the angular limitations of the segment.
- Parameters:
pi_dof_id (int) –
- Return type:
None
- reset_angular_limitations(pi_dof_id: int, pi_reset: int) None ¶
Note
- CAA V5 Visual Basic Help (2020-09-25 14:34:21.593357))
- o Sub ResetAngularLimitations(long piDOFId,long piReset)Reset the angular limitations of the segment depending on piReset: 0 -> 2OR 3 OR 4 depending of the first encountered. 1 -> 2 AND 3 AND 4 2 -> Unlockthe value 3 -> Restore the angular limitations if it is “No Limits” 4 -> Setback the angular limitations to their default value (50.0%)
- Parameters:
pi_dof_id (int) –
pi_reset (int) –
- Return type:
None
- reset_posture() None ¶
Note
- CAA V5 Visual Basic Help (2020-09-25 14:34:21.593357))
- o Sub ResetPosture()Set the segment’s posture back to its default position.
- Return type:
None
- reset_pref_angles(pi_dof_id: int) None ¶
Note
- CAA V5 Visual Basic Help (2020-09-25 14:34:21.593357))
- o Sub ResetPrefAngles(long piDOFId)Reset the preferred angles of the segment.
- Parameters:
pi_dof_id (int) –
- Return type:
None
- set_percentage(pi_percentage: float, pi_dof_id: int) None ¶
Note
- CAA V5 Visual Basic Help (2020-09-25 14:34:21.593357))
- o Sub SetPercentage(double piPercentage,long piDOFId)Sets the angular limitations to a percentage for the DOF piDOFId
- Parameters:
pi_percentage (float) –
pi_dof_id (int) –
- Return type:
None
- set_position(pi_new_position: tuple, pi_start_segment: str) None ¶
Note
- CAA V5 Visual Basic Help (2020-09-25 14:34:21.593357))
- o Sub SetPosition(CATSafeArrayVariant piNewPosition,CATBSTR piStartSegment)Sets a new absolute position for the segment.Parameters:piNewPositionThe new position to place the segment.This array must contain 12 numbers, and msut be initialized usingthe four columns of a transformation matrix. The first nine componentsrepresent the rotation matrix.The last three components represent the translationvector.piStartSegmentThe short name of the first segment of the kinematics chain. Theshort name specified has to identify a valid segment, which is an ancestor ofthe current one. For instance, is the segment to position is the right hand,then that start segment might be “RSArCl” (right clavicular). If the string“Default” is specified, then the start segment will be automatically chosen.Example:This example sets the segment to a 45-degree rotationaroundthe x axis and at a (10, 20, 30) translation from theorigin.Dim myPosition(11)‘Rotation (45 degrees around the x axis)myPosition(0) = 1.000myPosition(1) = 0myPosition(2) = 0myPosition(3) = 0myPosition(4) = 0.707myPosition(5) = 0.707myPosition(6) = 0myPosition(7) = -0.707myPosition(8) = 0.707‘Translation vector (10,20,30)myPosition(9) = 10.000myPosition(10) = 20.000myPosition(11) = 30.000myManikin.Body.GetItem(“LSHaCPr”).SetPosition myPosition,“Default”
- Parameters:
pi_new_position (tuple) –
pi_start_segment (str) –
- Return type:
None
- swap_angular_limitations(pi_dof_id: int) None ¶
Note
- CAA V5 Visual Basic Help (2020-09-25 14:34:21.593357))
- o Sub SwapAngularLimitations(long piDOFId)Swap the angular limitations of the segment.
- Parameters:
pi_dof_id (int) –
- Return type:
None
- swap_posture() None ¶
Note
- CAA V5 Visual Basic Help (2020-09-25 14:34:21.593357))
- o Sub SwapPosture()Swap the posture with the equivalent segment, on the other side of themanikin. For instance, the right leg takes the posture of the left leg, andvice versa.
- Return type:
None
- swap_pref_angles(pi_dof_id: int) None ¶
Note
- CAA V5 Visual Basic Help (2020-09-25 14:34:21.593357))
- o Sub SwapPrefAngles(long piDOFId)Swap the preferred angles of the segment.
- Parameters:
pi_dof_id (int) –
- Return type:
None