Assembling a Component Parametrically
Functions Introduced:
The function
ProAsmcompconstraintAlloc() allocates memory for the constraint data structure. This data structure describes the types of constraints that can be applied to the assembly component.
The function
ProAsmcompconstraintTypeGet() retrieves the constraint type of the specified constraint. The types of constraints are:
• PRO_ASM_UNDEF—Use this option to initialize a variable. This option is never returned by the function
ProAsmcompconstraintTypeGet() and can be ignored.
• PRO_ASM_MATE—Use this option to make two surfaces coincident with one another and facing each other.
• PRO_ASM_MATE_OFF—Use this option to make two planar surfaces parallel and facing each other.
• PRO_ASM_ALIGN—Use this option to make two planes coplanar, two axes coaxial or two points coincident. You can also align revolved surfaces or edges.
• PRO_ASM_ALIGN_OFF—Use this option to align two planar surfaces at an offset.
• PRO_ASM_INSERT—Use this option to insert a "male" revolved surface into a "female" revolved surface, making their respective axes coaxial.
• PRO_ASM_ORIENT—Use this option to make two planar surfaces to be parallel in the same direction.
• PRO_ASM_CSYS—Use this option to place a component in an assembly by aligning the coordinate system of the component with the coordinate system of the assembly.
• PRO_ASM_TANGENT—Use this option to force two surfaces to be tangent.
• PRO_ASM_PNT_ON_SRF—Use this option to align a point with a of a surface.
• PROS_ASM_EDGE_ON_SRF—Use this option to align a straight edge with a surface.
• PRO_ASM_DEF_PLACEMENT—Use this option to align the default coordinate system of the component to the default coordinate system of the assembly.
• PRO_ASM_SUBSTITUTE—This constraint type is used in simplified representations only when the component is replaced by a substitute component.
• PRO_ASM_PNT_ON_LINE—Use this option to force the intersection of a line with a point.
• PRO_ASM_FIX—Use this option to fix the current location of the component as a constraint.
• PRO_ASM_AUTO—Not for use by Creo TOOLKIT.
• PRO_ASM_ALIGN_ANG_OFF—This option can only be used in conjunction with another constraint. If you have two flat surfaces and create an align edge or axis constraint where the edge or axis lies on the surface, then you can specify an angle offset constraint between the two surfaces.
• PRO_ASM_MATE_ANG_OFF—This option can only be used in conjunction with another constraint. If you have two flat surfaces and create a mate edge or axis constraint where the edge or axis lies on the surface, then you can specify an angle offset constraint between the two surfaces.
• PRO_ASM_CSYS_PNT—This option can be used in User Defined, General, and Gimbal connections. Use this option to place a component in an assembly by aligning the origins of the coordinate systems. Here the axes are not aligned, and thus, the component can be freely rotated along the three rotation axes. In User Defined and Rigid connections you can switch from Coord Sys Point to Coord Sys constraint and vice-versa.
Use the function
ProAsmcompconstraintTypeSet() to set the constraints for the assembly component constraint.
The function
ProAsmcompconstraintAsmreferenceGet() retrieves the
ProSelection handle to a reference on the assembly and the orientation of the assembly for the specified assembly component constraint. The assembly orientation can have the following values:
• PRO_DATUM_SIDE_YELLOW—The primary side of the datum plane which is the default direction of the arrow.
• PRO_DATUM_SIDE_RED—The secondary side of the datum plane which is the direction opposite to that of the arrow.
• PRO_DATUM_SIDE_NONE—No orientation is specified.
The assembly orientation is applicable for legacy models prior to M260.
The function
ProAsmcompconstraintAsmreferenceSet() selects a reference on the assembly and sets the orientation of the assembly for a specified assembly component constraint.
|
Note:
|
The assembly reference selection must be assigned an assembly component path, even if the reference geometry is in the top-level assembly. In that situation the table_num value of the ProAsmcomppath structure would be 0.
|
The function
ProAsmcompconstraintCompreferenceGet() retrieves the
ProSelection handle to a reference on the placed component and the orientation of the component for the specified assembly component constraint. The component orientation can have the following values:
• PRO_DATUM_SIDE_YELLOW—The primary side of the datum plane which is the default direction of the arrow.
• PRO_DATUM_SIDE_RED—The secondary side of the datum plane which is the direction opposite to that of the arrow.
• PRO_DATUM_SIDE_NONE—No orientation is specified.
The component orientation is applicable for legacy models prior to M260.
ProAsmcompconstraintCompreferenceSet() selects a reference on the placed component and sets the orientation of the component for a specified assembly component constraint.
ProAsmcompconstraintOffsetGet() retrieves the offset value from the reference for the Mate or Align constraint type and the function
ProAsmcompconstraintOffsetSet() defines the offset value.
The function
ProAsmcompconstraintAttributesGet() retrieves the constraint attributes for the specified assembly component constraint. The function
ProAsmcompconstraintAttributesSet() sets the constraint attributes. The types of constraint attributes are:
• PRO_ASM_CONSTR_ATTR_FORCE—Force the constraint, causing strict alignment for axes, lines, and points. You can force a constraint only if the constraint type is Align.
• PRO_ASM_CONSTR_ATTR_IGNORE—Not for use by Creo TOOLKIT.
• PRO_ASM_CONSTR_ATTR_NONE—No constraint attributes are specified. This is the default value.
• PRO_ASM_CONSTR_ATTR_INTFC_DEPENDENT—When set in a component interface, the constraint cannot be changed by application of settings making it coincident, offset, or reoriented.
• PRO_ASM_CONSTR_ATTR_INACTIVE—The constraint should not be applied to the feature. This corresponds to the Constraint Enabled check box in the component feature user interface.
The function
ProAsmcompconstraintUserdataGet() retrieves the user data for the given constraint while the function
ProAsmcompconstraintUserdataSet() specifies the user data for the given constraint.
Use the function
ProAsmcompconstraintFree() to free the constraint data structure from the memory.
The function
ProAsmcompconstraintArrayFree() provides a single function to use to free an entire
ProArray of
ProAsmcompconstraint structures.