Snapshot Constraints
The constraints that can be applied to a snapshot are contained by the structure ProSnapshotConstraint. The declaration for ProSnapshotConstraint is as follows:
typedef struct proSnapshotConstraint
{
ProSnapshotConstraintType type;
ProSelection *sel_array;
double value;
ProBool user_active;
ProBool valid
} ProSnapshotConstraint;
The fields in the above structure are described as follows:
• type—Specifies the type of snapshot constraint. The type is represented by the enumerated type ProSnapshotConstraintType and can take one of the following values:
◦ PRO_SNAP_ALIGN—Select two points, two lines, or two planes from the top-level assembly. The two entities remain aligned during the drag operation.
◦ PRO_SNAP_MATE—Select two planes from the top-level assembly. The planes remain mated during the drag operation.
◦ PRO_SNAP_ORIENT—Select two planes that orient at an angle with each other.
◦ PRO_SNAP_MOTION_AXIS_POS—Select a motion axis to specify the motion axis position.
◦ PRO_SNAP_BODY_LOCK—Select the bodies to be locked together while dragging.
◦ PRO_SNAP_CONNECTION_DISABLE—Select a connection that will be disabled while dragging.
◦ PRO_SNAP_PARALLEL_VIEW_PLANE—Select a body that will move parallel only to the view plane. This constraint type is the same as the PRO_SNAP_ALIGN or PRO_SNAP_MATE types, but the second reference in this case is the view plane. This constraint type is available only via Creo TOOLKIT. If set by the Creo TOOLKIT application, this constraint type becomes visible in the Drag dialog box in the Creo Parametric user interface, but it cannot be stored.
◦ PRO_SNAP_CAM_LIFTOFF_ENABLE—Allows two cams with a cam-follower connection to separate and collide during a dragging operation.
◦ PRO_SNAP_CAM_LIFTOFF_DISABLE—Requires two cams with a cam-follower connection to be in contact with each other during the dragging operation.
|
 The constraint types PRO_SNAP_CAM_LIFTOFF_ENABLE and PRO_SNAP_CAM_LIFTOFF_DISABLE override the Enable Liftoff property that you set from the Cam-Follower Connection Definition dialog box in the Creo Parametric user interface.
|
• *sel_array—Specifies the ProArray of selections. The number of selections needed and the permitted selection types for each constraint type are specified in the following table:
|
Constraint Type
|
Number of Selections needed
|
Permitted Selection Types
|
|
PRO_SNAP_ALIGN
|
2
|
PRO_POINT, PRO_SURFACE_PNT, PRO_AXIS, PRO_EDGE, PRO_CURVE, PRO_DATUM_PLANE, PRO_SRF_PLANE_PNT, PRO_SURFACE
|
|
PRO_SNAP_MATE, PRO_SNAP_ORIENT
|
PRO_DATUM_PLANE, PRO_SRF_PLANE_PNT, PRO_SURFACE
|
|
|
PRO_SNAP_MOTION_AXIS_POS
|
1
|
PRO_MDO_CONN_AXIS_ROT_1/2/3, PRO_MDO_CONN_AXIS_TR_1/2/3, PRO_MDO_SLOT_AXIS
|
|
PRO_SNAP_CONNECTION_DISABLE
|
PRO_MDO_CONN, PRO_MDO_CAM_CONN, PRO_MDO_SLOT_CONN, PRO_MDO_GEAR_CONN
|
|
PRO_SNAP_PARALLEL_VIEW_PLANE
|
PRO_POINT, PRO_SURFACE_PNT, PRO_EDGE_START, PRO_EDGE_END, PRO_CRV_START, PRO_CRV_END, PRO_AXIS, PRO_EDGE, PRO_CURVE, PRO_SRF_PLANE_PNT, PRO_SURFACE, PRO_DATUM_PLANE
|
|
PRO_SNAP_CAM_LIFTOFF_ENABLE
|
PRO_MDO_CAM_CONN
|
|
PRO_SNAP_CAM_LIFTOFF_DISABLE
|
|
PRO_SNAP_BODY_LOCK
|
2 or more
|
PRO_PART, PRO_MDO_BODY
|
• value—Depending upon the constraint type, this field takes the following values:
◦ For the PRO_SNAP_ALIGN and PRO_SNAP_MATE constraint types, value specifies the linear distance between the references.
◦ For the PRO_SNAP_ORIENT type, value specifies the angle between the references.
◦ For the PRO_SNAP_MOTION_AXIS_POS type, value specifies the offset of the joint axis zero position. This value is angular for the rotation axis and linear for the translational axis. The references for the joint axis zero position may be default or as specified by the user.
• active—Specifies the ProBoolean option to enable or disable a constraint.
• valid—Specifies if the constraint is valid or invalid in the current model context. If this ProBoolean option is PRO_B_TRUE, the constraint is valid (active), and if it is PRO_B_FALSE, the constraint is invalid (suppressed).
Functions Introduced:
The function
ProSnapshotConstraintsGet() retrieves all the constraints of a specified snapshot. The snapshot can be of the top-level assembly or any of its subassemblies. Pass
NULL for the argument
path to specify the top-level assembly.
The function
ProSnapshotConstraintAdd() adds a constraint to the snapshot of the top-level assembly.
The function
ProSnapshotConstraintDelete() deletes a constraint from the snapshot of the top-level assembly.
The function
ProSnapshotConstraintUpdate() updates a constraint for the snapshot of the top-level assembly.
The function
ProSnapshotConstraintEvaluate() calculates the position of the motion axis for the constraint type
PRO_SNAP_MOTION_AXIS_POS for the active model in the
Creo Parametric window. This value does not depend on the current snapshot and it is not necessary for the snapshot to contain the constraint.