Element Trees: Sweep
This section describes the principles of creating a sweep feature. Sections Element Trees: Principles of Feature Creation and Element Trees: Sketched Features provide the necessary background for this topic. Read those sections before this one.
Sweeps in Creo Toolkit
Creo Parametric provides access and creates a constant section sweep feature. You can create a solid or surface feature. You can also add or remove material while sweeping a section along one or more selected trajectories by controlling the section’s orientation, rotation, and geometry.
Sweep Feature
The element tree for the sweep feature is documented in the header file ProSweep.h, and is shown in the following figure.
Element Tree for Sweep Feature
Image
The following table describes the elements in the element tree for sweeps:
Element ID
Data Type
Description
PRO_E_FEATURE_FORM
PRO_VALUE_TYPE_INT
Specifies the feature form. The valid value is PRO_SWEEP defined in the enumerated data type ProFeatFormType in ProFeatForm.h.
PRO_E_SWEEP_TYPE
PRO_VALUE_TYPE_INT
Specifies the type of sweep. The valid value is PRO_SWEEP_TYPE_MULTI_
TRAJ
defined in the enumerated data type ProSweepType.
PRO_E_SWEEP_FRAME_COMP
Compound
This compound element specifies the trajectories and orientation of the section plane. For more information on this element, refer to the section Element Tree for PRO_E_SWEEP_FRAME_COMP.
PRO_E_SWEEP_PROF_COMP
Compound
This compound element defines the sweep type and holds the sketch related elements for the sweep cross section.
PRO_E_SWP_SEC_TYPE
PRO_VALUE_TYPE_INT
Specifies the type of sweep. The valid value is PRO_SWEEP_CONST_SECTION defined in the enumerated data type ProSweepSecType.
The option specifies a constant section sweep.
PRO_E_SWEEP_SECTION
Compound
This compound element contains the sketch for the sweep cross section.
PRO_E_SKETCHER
PRO_VALUE_TYPE_POINTER
Specifies a sketcher pointer. The user defined sketch can be directly retrieved from this element.
PRO_E_SWP_ATTR
Compound
This compound element defines the sweep attributes. The element is available only for surface sweeps.
PRO_E_END_SRF_ATTR
PRO_VALUE_TYPE_INT
Specifies the option to keep the end of sweep feature open or capped. The enumerated data type ProSweepEndSrfAttr contains the valid values for this element:
•  PRO_SWEEP_END_SRF_
OPEN
•  PRO_SWEEP_END_SRF_
CAPPED
PRO_E_STD_FEATURE_NAME
PRO_VALUE_TYPE_WSTRING
Specifies the name of the feature. The default value is SWEEP.
PRO_E_EXT_SURF_CUT_
SOLID_TYPE
PRO_VALUE_TYPE_INT
Specifies a solid or surface feature type. The enumerated data type ProSweepFeatType contains the following valid values for this element:
•  PRO_SWEEP_FEAT_TYPE
_SOLID
•  PRO_SWEEP_FEAT_TYPE
_SURFACE
PRO_E_REMOVE_MATERIAL
PRO_VALUE_TYPE_INT
Specifies whether to extrude or remove the material along the sweep. The enumerated data type ProSweepRemMaterial contains the following valid values for this element:
•  PRO_SWEEP_MATERIAL_ADD
•  PRO_SWEEP_MATERIAL_REMOVE
PRO_E_FEAT_FORM_IS_THIN
PRO_VALUE_TYPE_INT
Specifies whether to create a thin section. The enumerated data type ProSweepFeatForm contains the following valid values for this element:
•  PRO_SWEEP_FEAT_FORM
_NO_THIN
•  PRO_SWEEP_FEAT_FORM
_THIN
PRO_E_STD_MATRLSIDE
PRO_VALUE_TYPE_INT
Specifies the direction in which material will be added with respect to the sketch. This element is mandatory for all cuts and thin features. The enumerated data type ProSweepMatlSide contains the following valid values for this element:
•  PRO_SWEEP_MATERIAL_SIDE_ONE
•  PRO_SWEEP_MATERIAL_SIDE_TWO
•  PRO_SWEEP_MATERIAL_BOTH_SIDES
PRO_E_THICKNESS
PRO_VALUE_TYPE_DOUBLE
Specifies the thickness for the thin feature. This element is mandatory for thin features.
PRO_E_TRIM_QUILT
PRO_VALUE_TYPE_
SELECTION
Specifies the selection of quilt to be trimmed.
PRO_E_TRIM_QLT_SIDE
PRO_VALUE_TYPE_INT
Specifies the side of the quilt to be trimmed. This element is relevant when the element PRO_E_STD_MATRLSIDE has its value as PRO_SWEEP_MATERIAL_BOTH_SIDES.
The enumerated data type ProSweepTrimQltSide contains the following valid values for this element:
•  PRO_SWEEP_TRIMQLT
_SIDE_ONE
•  PRO_SWEEP_TRIMQLT
_SIDE_TWO
PRO_E_BODY
Compound element
Compound element for body options.
PRO_E_BODY_USE
PRO_VALUE_TYPE_INT
Mandatory. Specifies the body to add geometry to.
Defined by the enumerated data type ProBodyUseOpts and the valid values follow:
•  PRO_BODY_USE_NEW— Feature stores its geometry in the new body.
•  PRO_BODY_USE_SELECTED—Feature adds its geometry to single selected body.
PRO_E_BODY_SELECT
PRO_VALUE_TYPE_SELECTION
Specifies the reference to the selected bodies.
Mandatory if PRO_E_BODY_USE is set to PRO_BODY_USE_SELECTED.
PRO_E_SMT_NEW_BODY_LINKED
PRO_VALUE_TYPE_OPTION
Specifies if the sheetmetal body is linked to a part.
For elements specific to sheetmetal, refer to the section Production Applications: Sheetmetal.
Element Tree for PRO_E_SWEEP_FRAME_COMP
The element PRO_E_SWEEP_FRAME_COMP is a compound element, which defines the sweep type and holds the sketch related elements for the sweep cross section. The element tree for PRO_E_SWEEP_FRAME_COMP is as shown in the figure below:
Image
The following table describes the sub elements of the PRO_E_SWEEP_FRAME_COMP:
Element ID
Data Type
Description
PRO_E_FRM_OPT_TRAJ
Array
Specifies an array of single trajectory that is only one element.
PRO_E_OPT_TRAJ
Compound
This compound element specifies the trajectory.
PRO_E_STD_SEC_METHOD
PRO_VALUE_TYPE_INT
Specifies that the trajectory is selected. The valid value is PRO_SEC_SELECT defined in the enumerated data type ProSecMethod in ProStdSection.h.
PRO_E_STD_SEC_SELECT
Compound
This compound element specifies the collection of trajectory.
PRO_E_STD_CURVE_COLLECTION_APPL
PRO_VALUE_TYPE_SELECTION
Specifies the collection of curves and edge chains for the trajectory.
PRO_E_FRAME_SETUP
Compound
This compound element specifies the orientation of the section plane.
PRO_E_FRM_NORMAL
PRO_VALUE_TYPE_INT
Specifies the orientation of the section plane normal. The enumerated data type ProFrameNormal contains the valid values for this element:
•  PRO_FRAME_NORM_ORIGIN—The section plane normal is perpendicular to the origin trajectory throughout the sweep.
•  PRO_FRAME_PIVOT_DIR— The z-axis is tangent to the projection of the origin trajectory at the direction specified in the element PRO_E_FRM_PIVOT_DIR.
•  PRO_FRAME_CONST_Z_DIR
—The section plane remains parallel to the specified direction reference vector.
PRO_E_FRM_PIVOT_DIR
Compound
This compound element for the direction reference is relevant when the element PRO_E_FRM_NORMAL has its value as PRO_FRAME_PIVOT_DIR.
PRO_E_DIRECTION_COMPOUND
Compound
This compound element specifies the direction reference for PRO_E_FRM_PIVOT_DIR. The compound element is a standard Creo Parametric element subtree and is described in ProDirection.h.
PRO_E_FRM_CONST_Z
Compound
This compound element for the direction reference is relevant when the element PRO_E_FRM_NORMAL has its value as PRO_FRAME_CONST_Z_DIR.
PRO_E_DIRECTION_COMPOUND
Compound
This compound element specifies the direction reference for PRO_FRAME_CONST_Z_DIR. The compound element is a standard Creo Parametric element subtree and is described in ProDirection.h.
PRO_E_FRM_ORIENT
PRO_VALUE_TYPE_INT
Specifies how the rotation of the frame around the sketch plane's normal is oriented along the sweep. The enumerated data type ProFrameOrient contains the valid vales for this element:
•  PRO_FRAME_MIN
Corresponds to the Automatic option in Creo Parametric user interface. The direction of the x-vector is calculated so that the swept geometry is minimally twisted.
•  PRO_FRAME_NORM_SURF
—Orients the y-axis of the section plane to be normal to the surface on which the origin trajectory lies.
•  PRO_FRAME_CONSTANT—This option must be set when the element PRO_E_FRM_NORMAL has its value as PRO_FRAME_PIVOT_DIR.
•  PRO_FRAME_X_TRAJ—This option is not supported as Creo Parametric supports only single trajectory in sweep feature.
PRO_E_FRM_NORM_SURF
Compound
This compound element for the edge chains is relevant when the element PRO_E_FRM_ORIENT has its value as PRO_E_FRAME_NORM_SURF.
PRO_E_SURF_CHAIN_CMPND
Compound
This compound element specifies the surface edge collection and the collection method.
PRO_E_SURF_CHAIN_METHOD
PRO_VALUE_TYPE_INT
Specifies the collection method for the surface edges. The valid values for this element are:
•  PRO_SURF_CHAIN_METHOD
_DEFAULT1
•  PRO_SURF_CHAIN_METHOD
_DEFAULT2
Note
Both the options are available only if the trajectory is a two-sided edge of a surface. In case of one-sided edge, only one option is available.
PRO_E_SURF_CHAIN_REF
_SURFS
Array
Specifies an array of surface edges.
PRO_E_SURF_CHAIN_SURF
Compound
This compound element specifies the surface edge collection.
PRO_E_SURF_CHAIN_REF
PRO_VALUE_TYPE_SELECTION
Specifies the collection of two-sided edge of a surface.
PRO_E_FRM_NORM_SURF_SIDE
PRO_VALUE_TYPE_INT
This element is relevant when the element PRO_E_FRM_ORIENT has its value as PRO_E_FRAME_NORM_SURF.
Specifies the normal surface direction. The enumerated data type ProFrmNormSrfSide contains the valid vales for this element:
•  PRO_FRAME_NORM_SRF
_SIDE_INSIDE
•  PRO_FRAME_NORM_SRF
_SIDE_OUTSIDE
PRO_E_FRM_USER_X
PRO_VALUE_TYPE_INT
This element is relevant when the element PRO_E_FRM_ORIENT has its value as PRO_FRAME_MIN.
Specifies if the direction of x-axis at start is automatically computed or is user defined. The enumerated data type ProFrameStartX contains the valid values for this element:
•  PRO_FRAME_DEFAULT_START_X
•  PRO_FRAME_USER_
START_X
Note
It is sometimes necessary to specify the x-axis direction, for example, for straight line trajectories or trajectories that have a straight segment at the start.
PRO_E_FRM_START_X
Compound
This compound element for the direction reference is relevant when the element PRO_E_FRM_USER_X has its value as PRO_FRAME_USER_START_X.
PRO_E_DIRECTION_COMPOUND
Compound
This compound element specifies the direction reference for PRO_FRAME_USER_START_X. The compound element is a standard Creo Parametric element subtree and is described in ProDirection.h.
Creating a Sweep Feature
To Create a Sweep Feature
1. Create an incomplete feature without the PRO_E_SKETCHER element.
2. Call ProFeatureElemtreeExtract() with the feature handle to get the new feature tree. This results in an initialized PRO_E_SKETCHER element and sketch handle.
3. Create the section with the initialized sketch handle.
4. Call ProFeatureWithoptionsRedefine() to put the section in the Creo Parametric database to complete the sweep feature.
Note
If these elements PRO_E_FRAME_SETUP and PRO_E_FRM_ORIENT are not defined, you have to redefine the feature twice to get the valid initiated sketch handle.
Example 1: Creating a Sweep Feature
The sample code in UgCreoSweepCreate.c located at <creo_toolkit_loadpoint>/protk_appls/pt_userguide/ptu_featcreat shows how to create a sweep feature.
Simple Sweep Feature
The simple sweep element tree documented in the header file ProSweep.h is obsolete. Use the sweep element tree instead to create and access the SWEEP feature.
The element tree for the simple sweep feature is shown in the following figure.
Element Tree for Simple Sweep Feature
Image
The following table describes the elements in the element tree for simple sweeps:
Element ID
Data Type
Description
PRO_E_FEATURE_TYPE
PRO_VALUE_TYPE_INT
Feature type
PRO_E_FEATURE_FORM
PRO_VALUE_TYPE_INT
Feature form (PRO_SWEEP)
PRO_E_SWEEP_SPINE
Compound
Trajectory (like (PRO_E_STD_SECTION)
PRO_E_SWEEP_SECTION
Compound
Section (like PRO_E_STD_SECTION)
The element tree definitions of PRO_E_SWEEP_SPINE and PRO_E_SWEEP_SECTION take on the same form as the element PRO_E_STD_SECTION (documented in the header file ProStdSection.h).
Note
Release 20 of Pro/TOOLKIT supports only sketched, constant cross-sectional sweeps.
The following figure shows the valid elements within this subtree.
Element Subtree for Simple Sweep
Image
Swept, constant, cross-sectional feature forms are supported for the following feature types:
•  PRO_FEAT_FIRST_FEAT
•  PRO_FEAT_PROTRUSION
•  PRO_FEAT_CUT
•  PRO_FEAT_DATUM_SURF
Creating a Simple Sweep Feature
To Create a Simple Sweep Feature
1. Create an incomplete feature with the PRO_E_FEATURE_TYPE and PRO_E_FEATURE_FORM elements defined. Also define the compound elements PRO_E_SWEEP_SPINE and PRO_E_SWEEP_SECTION, down to the PRO_E_STD_SEC_METHOD element (see the subtree for details).
2. Call ProFeatureElemtreeExtract() with the feature handle to get the new feature tree. This results in an initialized PRO_E_SWEEP_SPINE subtree and sketch handle.
3. Create the spine section with the initialized sketch handle.
4. Call ProFeatureWithoptionsRedefine() as an incomplete feature to put the spine section in the Creo Parametric database.
5. Call ProFeatureElemtreeExtract() to get the new feature tree. This results in an initialized PRO_E_SWEEP_SECTION subtree and sketch handle. This step is necessary because the sweep section is dependent on the spine section.
6. Create the sweep section with the initialized sketch handle. This section automatically contains the centerline cross hairs of the sweep section.
The cross hairs can be used to locate and dimension the section.
7. Call ProFeatureWithoptionsRedefine() with any option except incomplete to complete the simple sweep feature.
Example 1: Creating a Simple Sweep First Feature Protrusion
The sample code in UgSweepCreate.c located at <creo_toolkit_loadpoint>/protk_appls/pt_userguide/ptu_featcreat shows how to create a simple sweep first feature protrusion using the Creo Parametric functions.
Example 2: Creating a Simple Sweep Protrusion Feature by Conventional Approach
The sample code in Ug3DSweepCreate.c located at <creo_toolkit_loadpoint>/protk_appls/pt_userguide/ptu_featcreat shows how to create a simple sweep protrusion feature by the conventional approach for the sketched features.
The user is prompted to select the following:
•  Sketching plane
•  Orientation plane
•  Orthogonal edge for the dimensioning of the spine (trajectory - PRO_E_SWEEP_SPINE) section
•  Orthogonal edge for the sweep section (PRO_E_SWEEP_SECTION)