Element Trees: Replace
This section describes the basic principles of creating a tweak surface replacement feature. The section Element Trees: Principles of Feature Creation is a necessary background for this topic. Read that section before this one.
Introduction
The surface replacement functionality enables you to replace the specified surface on a model with a datum plane or quilt. This is similar to the Replace option from TWEAK menu in Creo Parametric. See the corresponding section in the Part Modeling User’s Guide for a detailed description of the restrictions and requirements of the feature.
The Feature Element Tree
The element tree for a surface replacement feature is documented in the header file ProReplace.h, and is shown in the following figure.
Element Tree for Surface Replacement
Image
The following table describes the elements in the element tree for the surface replacement feature.
Element ID
Data Type
Description
PRO_E_FEATURE_TYPE
PRO_VALUE_TYPE_INT
PRO_FEAT_REPLACE_SURF
PRO_E_STD_REPLACED_SURF
PRO_VALUE_TYPE_SELECTION
The surface to be removed
PRO_E_STD_REPLACEMENT_SURF
PRO_VALUE_TYPE_SELECTION
The replacement surface
PRO_E_STD_KEEP_QUILT
PRO_VALUE_TYPE_INT
Specifies whether to keep the quilt
To keep the replacement surface (datum plane or quilt), add the element PRO_E_STD_KEEP_QUILT and set its value to 1. If you omit the element, or its value is 0, the replacement surface will be consumed by the replacement feature.
After you have defined the element tree, call the function ProFeatureCreate() to create the tweak surface replacement feature.