Core: Features
This section describes the Creo TOOLKIT functions that deal with features as a whole and the way they relate to each other.
Access to the geometry objects created by features is described in the Core: 3D Geometry section.
Access to the internal structure of a feature is described in the Element Trees: Principles of Feature Creation section.
Feature Objects
Function Introduced:
Features are represented by the object ProFeature, which is declared as a DHandle, or data handle. It shares the same declaration as ProModelitem and ProGeomitem, and therefore contains the type and integer identifier as fields in the structure.
Like ProGeomitem, ProFeature is an instance of ProModelitem. ProFeature objects are contained in ProSolid objects, and contain ProGeomitem objects.
You can create a new ProFeature handle using the function ProFeatureInit().
Visiting Features
Function Introduced:
The function ProSolidFeatVisit() enables you to visit all the features in a part or assembly. It visits not only those features visible to the user, but also features used internally for construction purposes. To skip over such internal, “invisible” functions, call ProFeatureVisibilityGet().
Note that the function ProSolidFeatstatusGet() (described in detail in the Core: Solids, Parts, and Materials section.) provides an array of integer identifiers for all the features in a solid, thereby offering an alternate way of finding all the features.
Feature Inquiry
Functions Introduced:
As described earlier, the function ProSolidFeatVisit() finds all the features belonging to a part or an assembly. The feature inquiry functions provide more information about a particular feature.
The function ProFeatureTypeGet() provides the type of the feature. This feature type uses the data type ProFeattype, which is really an integer that takes defined values such as the following:
•  PRO_FEAT_FIRST_FEAT
•  PRO_FEAT_HOLE
•  PRO_FEAT_SHAFT
•  PRO_FEAT_ROUND
See the include file ProFeatType.h for the list of defined values.
The function ProFeatureTypenameGet() returns the name of the feature type. Given a ProFeature pointer to a specific feature, this function returns the name of the feature type, for example, CHAMFER, DATUM, COORDINATE SYSTEM, and so on. Arguments to this function must not be NULL.
The function ProFeatureSubtypeGet() provides the subtype (such as sheet metal) of a specified feature. Note that not all features support subtypes. This is like viewing valid model subtypes by opening the Model Tree settings command in Creo Parametric. Click Settings  Tree Columns menu and then select Feat Subtype in the Model Tree Columns dialog box, as an additional display column.
The function ProFeatureStatusGet() classifies the feature according to the following status values:
•  PRO_FEAT_ACTIVE—An ordinary feature.
•  PRO_FEAT_SUPPRESSED—A suppressed feature.
•  PRO_FEAT_FAMTAB_SUPPRESSED—A feature suppressed due to the family table settings.
•  PRO_FEAT_SIMP_REP_SUPPRESSED—A feature suppressed due to the simplified representation.
•  PRO_FEAT_PROG_SUPPRESSED—A feature suppressed due to Pro/PROGRAM.
•  PRO_FEAT_INACTIVE—A feature that is not suppressed, but is not currently in use for reasons other than the ones identified above.
•  PRO_FEAT_UNREGENERATED—A feature that has not yet been regenerated. This is due to a regeneration failure or if the status is obtained during the regeneration process.
•  PRO_FEAT_INVALID—The feature status could not be retrieved.
The function ProFeatureStatusflagsGet() retrieves the bitmask containing one or more of the following feature status bit flags for a specified feature:
•  PRO_FEAT_STAT_INVALID—Specifies an invalid feature.
•  PRO_FEAT_STAT_INACTIVE—Specifies an inactive feature. If the bit flag is set to 0, then it means an active feature.
•  PRO_FEAT_STAT_ACTIVE—Specifies an active feature.
•  PRO_FEAT_STAT_FAMTAB_SUPPRESSED—Specifies a feature suppressed due to the family table settings.
•  PRO_FEAT_STAT_SIMP_REP_SUPPRESSED—Specifies a feature suppressed due to the simplified representation.
•  PRO_FEAT_STAT_PROG_SUPPRESSED—Specifies a feature suppressed due to Pro/PROGRAM.
•  PRO_FEAT_STAT_SUPPRESSED—Specifies a suppressed feature.
•  PRO_FEAT_STAT_UNREGENERATED—Specifies an active feature that has not yet been regenerated. This is due to a regeneration failure or if the status is obtained during the regeneration process.
•  PRO_FEAT_STAT_FAILED—Specifies a failed feature.
•  PRO_FEAT_STAT_CHILD_OF_FAILED—Specifies a child of a failed feature.
•  PRO_FEAT_STAT_CHILD_OF_EXT_FAILED—Specifies a child of an external failed feature.
The function ProFeatureIsIncomplete() tells you whether a specified feature is incomplete. An incomplete feature is one that has been created by using ProFeatureCreate() from a Creo TOOLKIT application, but which does not yet contain all the necessary feature elements to allow regeneration.
The function ProFeatureIsNcseq() determines whether a feature is a Creo NC sequence.
The ProFeatureSolidGet() function provides the identifier of the solid that owns the specified feature.
The ProFeatureChildrenGet() and ProFeatureParentsGet() functions get the children and parents of the specified feature. For these functions, the parent of a feature means a feature it directly depends on, and a child is a feature that directly depends on it. This differs from the Creo Parametric command Info  Feature, which also shows indirect dependencies.
The function ProFeatureSelectionGet() is used for features that were created in a part as a result of a feature in a parent assembly. For example, if you create a hole in Assembly mode, then select a part to be intersected by that hole, the geometry of the hole is visible to Creo TOOLKIT as belonging to the part, even if the original feature is specified as being visible at the assembly level. This geometry—a list of the surfaces forming the hole—belongs to a feature in the part whose type is PRO_FEAT_ASSEM_CUT. The function ProFeatureSelectionGet(), when applied to that part feature, identifies the assembly, and the path down through it to the part in question, which contains the original feature.
During regeneration, Creo Parametric performs geometry checking to prevent regeneration errors. The geometry check process identifies features that could cause problems if the part or assembly is modified, but which do not cause regeneration failure in the model in its present state. The ProFeatureHasGeomchks() function outputs a variable of type ProBoolean that indicates whether a particular feature, identified as an input argument to the function, has geometry checks.
The function ProFeatureIsReadonly() provides information about the read status of the specified feature. Its first argument is a pointer to the feature’s (ProFeature) handle. If the feature is read only, the function outputs a ProBoolean with the value PRO_B_TRUE; otherwise, the value is PRO_B_FALSE.
The function ProFeatureIsEmbedded() identifies whether the feature is an embedded datum. Embedded features are visible in the model tree, but cannot be used as reference parents for features other than the feature into which they are embedded.
To determine whether insert mode is active in a specified solid, use the function ProInsertModeIsActive(). If activated, features are inserted into the feature list after the feature specified when ProFeatureInsertModeActivate() was called. New features continue to be inserted until you call the function ProInsertModeCancel(). See the section Manipulating Features for more information about insert mode.
The function ProFeatureCopyinfoGet() returns information about a copied feature. The information includes the type of copy operation, dependency, source feature, and additional features copied in the same operation. This function supersedes the Pro_copy_info structure returned by the Pro/Develop function prodb_feature_info().
The function ProFeatureZoneGet() returns the following parameters related to a feature zone:
•  p_planesProArray of planes.
•  p_oper_arrProArray of operations; where 0 specifies intersection of half spaces and 1 specifies union of half spaces. Creo Parametric retains the material that belongs to the intersection or union of the half spaces of the planes.
The function ProFeatureZonesectionCreate() creates a zone feature handle using reference planes and operations. The input arguments are as follows:
•  p_solid—A handle to the model.
•  zone_refs—An array of zone reference planes of type ProZoneReference. The structure ProZoneReference contains the geometric ID of the reference zone plane, the value for the operation, that is, 0 or 1 and the member ID of the part to which the reference plane belongs to. Pass NULL to memb_id_tab if the feature is owned by the part on which the zone is being created.
Creo Parametric retains the material that belongs to the intersection or union of the half spaces of the reference planes.
•  zone_name—The name of the zone feature handle. If a zone with the specified name exists, then the function returns the error PRO_TK_E_FOUND and the zone is not created.
The function ProFeatureZonesectionGet() returns the zone references for the specified feature. The output argument p_zone_refs contains an array of planes of type ProZoneReferenceWithflip. The structure ProZoneReferenceWithflip contains:
•  The geometric ID of the reference zone plane.
•  The value for the operation, where 0 specifies intersection of half spaces that is, the AND operator and 1 specifies union of half spaces that is, the OR operator.
•  The member ID of the part to which the reference plane belongs.
•  The side of the plane where the model is kept. 1 indicates positive normal of the plane and 1 indicates the opposite side.
Use the function ProZoneReferenceFree() to free the memory allocated to the zone reference data.
Use the function ProZoneReferenceArrayFree() to free the ProArray of zone reference data.
The function ProFeatureZonesectionWithflipCreate() creates a zone feature using reference planes and operations. This function allows you to flip the direction of zone planes while creating the zone feature.
The function ProFeatureZoneXsecgeomGet() creates an array of cross section geometry of type ProXsecGeometry for each zone plane. It returns an array of these arrays in the specified zone feature. Use the function ProFeatureZoneXsecGeomArrayFree() to free the memory allocated for the ProArray of ProArrays of type ProXsecGeometry.
The function ProModelitemIsZone() checks if the specified model item is a zone feature. Specify the handle to the model item as the input argument of this function.
Use the function ProFeatureIsInFooter() to check if the specified feature is currently located in the model tree footer. The footer is a section of the model tree that lists certain types of features such as, component interfaces, annotation features, zones, reference features, publish geometry, and analysis feature. The features in the footer are always regenerated at the end of the feature list. You can move features, such as, reference features, annotation features, and so on, to the footer. Some features, such as, component interfaces, zones, and so on, are automatically placed in the footer. Refer to the Creo Parametric online Help for more information on footer. Refer to the Creo Parametric online Help for more information on footer.
Use the function ProFeatureToFooterMove() to move the specified feature into the model tree footer.
Use the function ProFeatureFromFooterMove() to move the specified feature out of the model tree footer.
Some features behave like components because they have some properties that are similar to those of components. These features have some association with a solid model and are interpreted as placed components. When a component is placed it means it has been explicitly positioned at some location in the assembly. Examples of such features are solid welds, physical sensors, and so on. Solid welds organize their geometry as a special internal solid model, which gives them component-like characteristics. Similarly, physical sensors represent actual hardware that is placed on the model to measure parameters. Use the function ProFeatureIsComponentLike() to identify components and other features that behave like components. Refer to the section Assembly: Basic Assembly Access for more information on placed components.
Feature Geometry
Functions Introduced:
For information about feature geometry, see Core: 3D Geometry.
Manipulating Features
Functions Introduced:
The functions ProFeatureDelete() and ProFeatureSuppress() act like the right-mouse button Creo Parametric commands Delete and Suppress, except they do not repaint the window. You can process many features in a single call using an input of type ProFeatlist. Each of these functions takes an array of options as the input that indicates whether to also delete or suppress features dependent on those being acted on directly. The options used while deleting or suppressing features are as follows:
•  PRO_FEAT_DELETE_NO_OPTS—Delete or suppress the features without deleting or suppressing their dependent children features. This may result in regeneration failures. Use the option PRO_FEAT_DELETE_FIX, or one of the CLIP options to fix these failures.
•  PRO_FEAT_DELETE_CLIP—Delete or suppress the features along with their dependent children features.
•  PRO_FEAT_DELETE_FIX—Delete or suppress the features without deleting or suppressing their dependent children features. The fix model user interface will be prompted in case of a regeneration failure. This option must be used only in the Resolve mode. Otherwise, the function returns PRO_TK_BAD_CONTEXT.
•  PRO_FEAT_DELETE_RELATION_DELETE—Delete relations with obsolete dimensions.
•  PRO_FEAT_DELETE_RELATION_COMMENT—Change relations with obsolete dimensions into comments.
•  PRO_FEAT_DELETE_CLIP_ALL—Delete or suppress the features along with all the following features.
•  PRO_FEAT_DELETE_INDIV_GP_MEMBERS—Individually delete or suppress the features out of the groups to which they belong. If this option is not included, the entire group of features is deleted or suppressed. For this option to work, the option PRO_FEAT_DELETE_CLIP also has to be supplied.
•  PRO_FEAT_DELETE_CLIP_INDIV_GP_MEMBERS—Individually delete or suppress the children of features out of the group to which they belong. If this option is not included, the entire group containing the features and their children is deleted or suppressed. For this option to work, the options PRO_FEAT_DELETE_CLIP and PRO_FEAT_DELETE_INDIV_GP_MEMBERS also have to have supplied.
•  PRO_FEAT_DELETE_KEEP_EMBED_DATUMS—Retain the embedded datums stored in a feature while deleting the feature using ProFeatureDelete(). If this option is not included, the embedded datums will be deleted along with the parent feature.
The function ProFeatureRedefine() is equivalent to the Creo Parametric command Feature>Redefine. Additionally, it can redefine an existing feature with the new element tree. The data passed in through the new element tree replaces the existing data in the feature.
Creo TOOLKIT provides access to the Creo Parametric feature insert mode functionality with the ProFeatureInsertModeActivate() and ProInsertModeCancel() functions. The function ProFeatureInsertModeActivate() takes a single argument—the handle to the feature after which new features are to be inserted. This feature becomes the last feature in the feature regeneration list. All features that had appeared after that feature are temporarily suppressed. New features are added after the (new) last feature. Feature insertion continues until insert mode is terminated with a call to ProInsertModeCancel(). Its first argument is a handle to the solid, and the second is a ProBoolean that enables you to specify whether suppressed features are to be resumed.
The function ProFeatureReadonlySet() assigns a read-only status to model features. Its only argument is a ProFeature handle that specifies the last feature in the feature list to be designated as read only. All preceding features are read only; all features following this feature have standard access. From Creo Parametric 3.0 onward, the features that are made read-only appear under a separate container node at the top of the model tree. The node has its label as Read Only Features and also has a padlock glyph associated with it.
The function ProFeatureReadonlyUnset() removes the read-only status from all features in the specified solid. From Creo Parametric 3.0 onward, the container node Read Only Features is dismissed from the model tree when the read-only status is removed.
The function ProFeatureReorder() enables you to change the position of one or more features in the feature regeneration sequence. Its input arguments are as follows:
•  ProSolid solid—The handle to the solid owner of the features.
•  int *feat_ids—An array of feature identifiers that specifies the features to be reordered. The array should contain features that formed a contiguous sublist within the original feature regeneration list. If reordering a group, all the features in the group including the Group Header feature must be included in this array.
•  intn_feats—The number of features to reorder.
•  intnew_feat_num—An integer that indicates the intended location of the first feature in the specified set after reorder. This integer is not the feature identifier, but rather the regeneration sequence number of the feature. You obtain this number by calling the function ProFeatureNumberGet().
Use the function ProSolidFeatstatusGet() to get the current sequence and statuses. You must use care when you change the sequence of features. Unless you have advance knowledge of the relationship between the features you are reordering, you should use the functions ProFeatureParentsGet() and ProFeatureChildrenGet() before changing the feature order to ensure that no feature is reordered to be before its parent features.
Manipulating Features based on Regeneration Flags
Functions Introduced:
The functions in this section enable you to create, delete, or manipulate the specified features in a solid, based on the bitmask specified by the input argument flags. The bitmask must contain one or more regeneration control bit flags of the type PRO_REGEN_* defined in ProSolid.h. Refer to the Regenerating a Solid section in the Core: Solids, Parts, and Materials section for more information on the bit flags.
From Pro/ENGINEER Wildfire 5.0 onwards, the functions listed above supersede the following functions described in the Manipulating Features section.
•  ProFeatureCreate()
•  ProFeatureDelete()
•  ProFeatureSuppress()
•  ProFeatureResume()
•  ProFeatureRedefine()
•  ProFeatureReorder()
•  ProFeatureInsertModeActivate()
•  ProInsertModeCancel()
Use the superseding functions with the input argument flags set to PRO_REGEN_NO_FLAGS for the behavior that is similar to the one provided by the above deprecated functions.
The function ProFeatureInsertmodeWithoptionsUpdate() updates insert mode such that the specified feature becomes the last feature. The input arguments follow:
•  p_last_feat—the last feature. All the features after this feature are detached. Feature creation will resume after the update of the insert mode and are created after this specified last feature. If you cancel the insert mode, the detached features are added at the end.
•  flags—the regeneration control flags. Pass as bitmask containing one or more of the bit flags PRO_REGEN* defined in ProSolid.h.
Feature References
Functions Introduced:
The function ProFeatureReferenceEdit() replaces the old references of a feature with new references based on the bitmask specified for its input argument flags. The bitmask must contain one or more regeneration control bit flags of the type PRO_REGEN_* defined in ProSolid.h. Refer to the Regenerating a Solid section in the Core: Solids, Parts, and Materials section for more information on the bit flags.
The function ProMdlFeatBackupOwnerNamesGet() returns the names of the models, along the model path, from the top model to the owner model for the specified feature. The input arguments are:
•  model—Specifies the model, which contains the specified feature.
•  feature—Specifies a feature whose references are to be retrieved.
The function ProMdlFeatBackupRefMdlNamesGet() returns the names of the models, along the model path, from the top model to the external reference model for the specified feature. Feature references can be from a local or external model. The system creates a geometry backup of the local and external references, which is used for information and display purposes. This function retrieves the model names from the backup information. The input arguments are:
•  model—Specifies the model, which contains the specified feature.
•  feature—Specifies a feature whose references are to be retrieved.
•  path—Specifies the path as a ProArray of IDs of a subassembly or component from the top model to the reference model. Specify NULL for local reference.
To give an example on how to specify the path, consider an assembly A, which has a component C1 with ID 9 and a subassembly S with ID 7. The subassembly S has a component C2 with ID 11. If a feature under C1 references an object in the model of C2, the reference ID path must contain two IDs 7 and 11.
•  ref_id—Specifies the ID of the external reference, which is referenced in the specified feature.
Refer to the Creo Parametric Assembly Design online help for more information on references and backup data.
The function ProFeatureReferenceEditRefsGet() returns an array of the original references of a feature that are used to perform the edit reference operation. The input arguments follow:
•  solid—The part or assembly to which the features belong.
•  p_feat_handle—The feature handle.
•  flags—Indicates the type of references to collect. To collect all types of references, set the value to PRO_EDITREF_REF_TYPE_ALL.
The function returns the output argument r_orig_ref_arr as a ProArray of all the original references.
Use the function ProReferencearrayFree() to free the memory.
Use the function ProFeatureMdltreeDisplaynameGet() to retrieve the name of the node displayed in the model tree.
Feature Dimensions
Function Introduced:
The function ProFeatureDimensionVisit() visits all the dimensions which belong to the feature.
Note
Some feature dimensions are dependent on dimensions of other features. For example, sketch-based features with shared, patterned or external sections, dependent copied or mirrored features, and so on. In case of such dependent dimensions, use the function ProDimensionParentGet() to get the value of the parent dimension .
For more information about dimensions, refer to section Dimensions in the section Annotations: Annotation Features and Annotations.
Manipulating Patterns
From the Pro/ENGINEER Wildfire release, the following changes are implemented in patterns.
Patterns as Features
Patterns are treated as features in Creo Parametric. Patterns are assigned a header feature of the type PRO_E_PATTERN_HEAD.
The Pattern feature in Pro/ENGINEER Wildfire effects the previous releases of Pro/ENGINEER as follows:
•  Models containing patterns automatically get one extra feature of type PRO_FEAT_PATTERN_HEAD in the regeneration list. This changes the feature numbers of all the subsequent features, including those in the pattern.
•  The pattern access functions such as ProFeaturePatternGet(), ProPatternMembersGet() and ProPatternLeaderGet are unaffected by the addition of the pattern header feature. The pattern leader is still the first geometric feature contained in the pattern.
The new function ProPatternHeaderGet() returns the header feature.
Fill Patterns
Creo Parametric uses the Fill type of pattern.
Functions Introduced:
The function ProFeaturePatternStatusGet() classifies the feature according to its possible role in a feature pattern. The possible values are as follows:
•  PRO_PATTERN_NONE—The feature is not in a pattern.
•  PRO_PATTERN_LEADER—The feature is the leader of a pattern.
•  PRO_PATTERN_MEMBER—The feature is a member of a pattern.
•  PRO_PATTERN_HEADER—The feature is the header of a pattern.
The function ProFeatureGrppatternStatusGet() does the equivalent for group patterns. The possible values are as follows:
•  PRO_GRP_PATTERN_NONE—The feature is not in a group pattern.
•  PRO_GRP_PATTERN_LEADER—The feature is the leader of a group pattern.
•  PRO_GRP_PATTERN_MEMBER—The feature is a member of a group pattern.
•  PRO_GRP_PATTERN_HEADER—The feature is the header of a group pattern.
The function ProFeaturePatternleaderGet() returns the pattern leader feature for the specified pattern member feature.
The function ProFeaturePatternGet() obtains the ProPattern handle for the pattern containing the specified feature. (The ProPattern handle is described in detail in the section Element Trees: Patterns.)
To delete a pattern, pass the corresponding ProPattern handle to the function ProPatternDelete().
To obtain the leader feature for a given pattern, pass a ProPattern object to the function ProPatternLeaderGet().
To obtain the header feature for a given pattern, pass a ProPattern object to the function ProPatternHeaderGet().
To access pattern information use the pattern element tree described in Element Trees: Patterns. You can access element tree information using the functions ProElement*(), described in the section Element Trees: Principles of Feature Creation.
Table-Driven Patterns
The Table-Driven Pattern functions have been deprecated. Use the Table Pattern feature element tree to read and manipulate table patterns. See the section Table Patterns for more details.
Creating Local Groups
Function Introduced:
Local groups offer a way to collect several features together as if they were one feature. This functionality is particularly useful when you are creating patterns.
The function ProLocalGroupCreate() groups together features specified by an array of feature identifiers. The output of ProLocalGroupCreate() is the object ProGroup, which a typedef of a structure similar to ProFeature.
The feature identifiers passed to ProLocalGroupCreate() must correspond to features that possess consecutive regeneration numbers. That is, the feature identifiers can have any values, but the corresponding features must occupy a contiguous portion of the regeneration list. (To see the regeneration number of a feature, add the column Feat # to the model tree.)
If there are features whose regeneration numbers lie between those belonging to the features to be grouped, Creo Parametric asks the user whether these unspecified features are to be included in the group. If the user responds with No, the group is not created.
After you create a local group, you may want to refresh the model tree to see the changes. To refresh the model tree, call ProTreetoolRefresh().
Read Access to Groups
Groups in Creo Parametric represent sets of contiguous features that act as a single feature for purposes of some operations. While the individual features can be affected by most operations individually, certain operations apply to the entire group:
•  Suppress
•  Delete
•  Layer operations
•  Patterning operations
For more information about local groups, see the Part Modeling User's Guide.
User-Defined Features (UDFs) are groups of features that can be stored in a file. When a UDF is placed in a new model, the features created are automatically assigned to a group.
A local group is a set of features that have been explicitly assigned to a group, for purposes of ease of modification or patterning.
Note
All the functions in this section work for both UDFs and local groups.
Each instance of a group is identified in Creo TOOLKIT as a ProGroup structure. This structure is the same a ProFeature data handle:
      typedef struct pro_model_item {
                ProMdl  owner;
                int     id;
                ProType type;
      }  ProGroup;
The integer id in this case is the id of the group header feature, which is the first feature in the group. All groups, including those in models created before release 200i2, are assigned with a group header feature upon retrieval.
The consequences of the group header feature for users of previous versions of Pro/TOOLKIT is as follows:
•  Models that contain groups automatically get one extra feature in the regeneration list, of type PRO_FEAT_GROUP_HEAD. This changes the feature numbers of all subsequent features, including those in the group.
•  Each group automatically contains one new feature in the arrays returned by Pro/TOOLKIT.
•  Each group automatically gets a different leader feature (the group head feature is the leader). The leader is the first feature in the arrays returned by Pro/TOOLKIT.
•  Each group pattern contains, of course, a series of groups, and each group in the pattern is similarly altered.
Finding Groups
Functions Introduced:
The function ProSolidGroupVisit() allows you to visit the groups in the solid model. The function ProSolidGroupsCollect() returns an array of the group structures.
The function ProFeatureGroupStatusGet() tells you if the specified feature is in a group.
The function ProFeatureGroupGet() returns the ProGroup that includes the feature.
Group Information
Functions Introduced
The function ProUdfNameGet() returns the name of the group. For a local group, this is the name assigned upon creation. For a UDF-created group, this is the name of the UDF file. If the UDF is an instance in a UDF family table, the function also returns the instance name.
The function ProGroupFeatureVisit() traverses the members of the feature group. The function ProGroupFeaturesCollect() returns an array containing the feature handles.
The function ProUdfDimensionVisit() traverses the variable dimensions used in the creation of the UDF (this is only applicable to UDF-created groups). The function ProUdfDimensionsCollect() returns an array of the variable dimensions. The variable dimensions are the dimensions that Creo Parametric prompts for when you create the UDF.
The function ProUdfDimensionNameGet() returns the original dimension symbol for the variable dimension in the UDF. This symbol is different from the symbol assigned to the dimension in the group.
Note
In Creo Parametric 6.0.0.0 and later, for the function ProUdfDimensionNameGet(), it is mandatory to pass the input argument udf as ProGroup object type. If you pass any other object type, the function returns the PRO_TK_BAD_CONTEXT error.
Creating Groups
Functions Introduced:
The function ProLocalGroupCreate() creates a group out of a set of specified features. The features must represent a contiguous set of features in the solid model. (Refer also to Creating Local Groups).
Deleting Groups
Functions Introduced:
The function ProGroupUngroup() removes the indicated group and deletes the group header feature.
The function prototype ProGroupUngroupPreAction() should be used for a notification corresponding to the ProNotifyType PRO_GROUP_UNGROUP_PRE. This callback will be called just before the user ungroups an existing local group or UDF group in the user interface. If the application returns an error from this callback, ungroup activity will be prevented (thus providing a means by which UDFs or other groups may be effectively locked). If ungroup is being cancelled by the application, the application is required to provide an informational message to the user explaining this action.
The function prototype ProGroupUngroupPostAction() should be used for a notification corresponding to the ProNotifyType PRO_GROUP_UNGROUP_POST. This prototype provides information about the group that was just ungrouped:
•  solid—The solid model that owns the group.
•  group_id—The former group feature id.
•  udf_name—The name of the UDF the group was created from.
•  feature_list—The feature ids that were members of the group.
Updating or Replacing UDFs
This section lists operations, which you can perform on UDFs.
Functions Introduced:
The function ProUdfUpdate() updates a dependent UDF to the latest version of the .gph file. The function should be able to locate the .gph file from within the session or by the search path. Only dependent UDFs are updated from their original definitions.
Use the function ProUdfReplace() to replace a UDF placement with a similar UDF provided that the two UDF's must use the same reference types. The input to the function can include data that would be used to respond to prompts shown during an interactive replacement (for items like scale, dimension display and orientation prompts).
The function ProUdfFileIsPreCreo7() identifies if the .gph file is created or modified in a release earlier than Creo Parametric 7.0.0.0. The input argument gph_path is the path to the .gph file.
If the .gph file is created or modified in a release earlier than Creo Parametric 7.0.0.0, the function outputs a ProBoolean with the value PRO_B_TRUE; otherwise, the value is PRO_B_FALSE.
Placing UDFs
Function Introduced:
The function ProUdfCreate() is used to create a new group by retrieving and applying the contents of an existing UDF file. It is equivalent to the Creo Parametric command Model  User-Defined Feature.
To understand this function explanation, you must have a good knowledge and understanding of the use of UDFs in Creo Parametric. PTC recommends that you read about UDFs in the Part Modeling User's Guide, and practice defining and using UDFs in Creo Parametric before you attempt to use this function.
When you create a UDF interactively, Creo Parametric prompts you for the information it needs to fix the properties of the resulting features. When you create a UDF from Creo TOOLKIT, you can provide some or all of this information programmatically by assembling the data structure that is the input to the function ProUdfCreate().
During the call to ProUdfCreate(), Creo Parametric prompts you for the following:
•  Any information the UDF needs that you did not provide in the input data structure
•  Correct information to replace erroneous information
Such prompts are a useful way of diagnosing errors when you develop your application. This also means that, in addition to creating UDFs fully programmatically to provide automatic synthesis of model geometry, you can also use ProUdfCreate() to create UDFs semi-interactively. This can simplify the interactions needed to place a complex UDF, making it easier for the user and less prone to error.
Creating a UDF may require the following types of information:
•  Name—The name of the UDF library to create, and the instance name, if applicable.
•  Name or path—the name (or full path) of the UDF to create, and the instance name, if applicable.
•  Dependency—Whether the UDF is independent of the UDF definition, or is modified by changes made to it.
•  Scale—How to scale the UDF relative to the placement model.
•  Variable parameters—The new values of the variable parameters allowed to be changed during UDF placement.
•  Variable annotations—The new values of the variable gtol values, surface finish values and dimension tolerances allowed to be changed during UDF placement.
•  Variable dimensions—The new values of the variable dimensions and pattern parameters; those whose values can be modified each time the UDF is created.
•  Dimension display—Whether to show or blank non-variable dimensions created within the UDF group.
•  References—The geometrical elements (surfaces, edges, datum planes, and so on) that the UDF needs to relate the features it contains to the existing model features. The elements correspond to the picks that Creo Parametric prompts you for when you create the UDF interactively (using the prompts defined when the UDF was set up). You cannot select an embedded datum as the UDF reference.
•  Part intersections—If the UDF is being created in an assembly and contains features that modify existing solid geometry, you need to define which parts in the assembly are to be affected (or "intersected"), and at which level in the assembly each such intersection is to be visible.
•  Orientations—If a UDF contains a feature whose direction is defined with respect to a datum plane (for example, a hole feature that uses a datum plane at its placement plane), Creo Parametric needs to know in which direction the new feature is to point (that is, on which side of the datum plane it should lie). When you create such a UDF interactively, Creo Parametric prompts you for this orientation with a flip arrow.
•  Quadrants—If a UDF contains a linearly placed feature that references two datum planes to define its location (in the new model), Creo Parametric prompts you to pick the location of the new feature. This decides on which side of each datum plane the feature must lie. This choice is referred to as the "quadrant," because there are four combinations of possibilities for each linearly placed feature.
•  External symbols—The parameter or dimension to use in place of a missing external symbol from a note callout or relation.
•  Copied model names—If a UDF creates components in an assembly, this argument specifies the names of the new copied components that the placement creates.
The function ProUdfCreate() takes the following arguments:
•  solid—The solid model (part or assembly) on which to place the UDF.
•  data—The UDF creation data, described below.
•  asm_reference—An external reference assembly for calculating intersections and external references.
•  options—An array of option flags.
•  n_options—The size of the options array.
The UDF Input Data Structure ProUdfdata
Most of the input needed by the function ProUdfCreate() is contained in the single ProUdfdata structure. This structure can be assembled using the ProUdfdata functions.
The options in the data structure correspond closely to the prompts Creo Parametric gives you when you create a UDF interactively. PTC strongly recommends that before you write the Creo TOOLKIT code to fill the structure, you experiment with creating the UDF interactively using Creo Parametric, noting what prompts it gives you, and use this as a guide to the information you need to provide.
Functions Introduced:
The function ProUdfdataAlloc() allocates memory for the ProUdfdata structure. The function ProUdfdataFree() frees the data structure memory.
The function ProUdfdataNameSet() allows you to set the name of the UDF (the root of the file name) to create and, optionally, the instance in the UDF family table to use.
Use the function ProUdfdataPathSet() to set the path of the UDF file. ProUdfCreate() will use the input from this path, if set, otherwise the data from ProUdfdataNameSet() is used.
Use function ProUdfdataInstancenameSet() to assign the instance to be used when placing this UDF.
The function ProUdfdataDependencySet() specified the dependency of the UDF. The choices correspond to the choices available when you create the UDF interactively. The default for this option, if not explicitly specified, is to create the group independent of the UDF definition.
The function ProUdfdataScaleSet() specifies how to modify the dimensions of the UDF with respect to the placement model. The choices correspond to the options presented when you create the UDF interactively. A value for a user-defined scale can also be specified by this function. The default for this option, if not explicitly specified, is to use the same size for the UDF, regardless of the units of the placement model.
The function ProUdfdataDimdisplaySet() specifies how to present the non-variable dimensions in the created group. These values correspond to the options presented in Creo Parametric when placing the UDF interactively. The default for this option, if not explicitly specified, is to display the dimensions normally (allowing modification).
The function ProUdfdataOrientationAdd() adds to an array of orientation choices. These orientation options answer the Creo Parametric prompts that propose a flip arrow (presented, for example, when using datum planes as a reference). There should be one orientation answer presented for each prompt in Creo Parametric, and the order of the options should correspond to the order as presented in Creo Parametric. If an orientation option is not provided, the value “no flip” is applied.
The function ProUdfdataQuadrantAdd() adds to an array of 3-dimensional points that correspond to the picks answering the Creo Parametric prompts for the feature positions. The quadrant is requested when placing a hole or a shaft with respect to two datum planes if the UDF references were also datum planes. The order of quadrants specified should correspond to the order in which Creo Parametric prompts for them when the UDF is created interactively.
Variable Parameters and Annotations
The data structure for both variable parameters and annotations is ProUdfvarparam.
Functions Introduced:
The function ProUdfvarparamAlloc() allocates a UDF variable parameter or annotation structure which describes a variable parameter or annotation. The input arguments of this function are:
•  name—Specifies the parameter name. If it represents a variable annotation, then this must be one of the standard annotation parameter names:
  PTC_ GTOL_PRIMARY_TOL—gtol value
  PTC_ROUGHNESS_HEIGHT—surface finish value
  PTC_DIM_TOL_VALUE—dimension symmetric tolerance value
  PTC_DIM_UPPER_TOL_VALUE—upper dimension tolerance
  PTC_DIM_LOWER_TOL_VALUE—lower dimension tolerance
•  item—Specifies the owner item. This item must have type and id filled out. (The owner field is ignored by Creo Parametric). The following types are allowed here:
  PRO_FEATURE
  PRO_ANNOTATION_ELEM
Use the function ProUdfdataVarparamAdd() to add information about a variable parameter assignment to the UDF data.
The function ProUdfvarparamValueSet() assigns the value to be used for a variable parameter or annotation value when the UDF is placed. Note: you still must add the variable parameter to the UDF data using ProUdfdataVarparamAdd().
Use the function ProUdfvarparamFree() to free the UDF variant parameter handle.
Variable Dimensions and Pattern Parameters
The data structure for variable dimensions and pattern parameters is ProUdfvardim.
Functions Introduced:
The function ProUdfvardimAlloc() sets the values used to determine the variant dimension value. This function requires the following inputs:
•  dim_name—The symbol that the dimension or pattern parameter had when the UDF was originally defined; not the prompt that the UDF uses when interactively created. To make the name easy to remember, modify the symbols of all the dimensions that you want to select to be variable before you define the UDF that you plan to create with Creo TOOLKIT.
If you do not remember the name, find it by creating the UDF interactively in a test model and then using the Creo TOOLKIT functions ProUdfDimensionVisit() and ProUdfDimensionNameGet() on the resulting UDF.
If you get the name wrong, ProUdfCreate() does not recognize the dimension and prompts the user for the value.
•  value—The new value of the dimension or pattern parameter.
•  type—This enumerated type takes one of the following values:
  PROUDFVARTYPE_DIM—For a dimension.
  PROUDFVARTYPE_IPAR—For a pattern parameter.
The function ProUdfdataUdfvardimAdd() adds a variant dimension data structure to the UDF creation data.
The function ProUdfvardimValueSet() assigns the value to be used for a variable dimension value when the UDF is placed.
Note
The variant dimension must be added to the UDF data structure using ProUdfdatavardimAdd() in order for it to be used during placement.
Use the function ProUdfvardimFree() to free the UDF variant dimension handle.
UDF References
Functions Introduced:
The function ProUdfreferenceAlloc() creates a new reference data structure. The data that must be provided to allocate the structure is:
•  prompt—The prompt defined for this reference when the UDF was originally set up. It indicates which reference this structure is providing.
•  ref_item—A ProSelection object representing the geometry to use as the reference. You can allocate an embedded datum as the UDF reference. If the reference is external, the selection component path should represent the path to the owning model relative to the external reference assembly specified in the call to ProUdfCreate(). If this reference item refers to an annotation reference, you can pass NULL to make the placed annotation incomplete.
•  externalPRO_B_TRUE if the reference is external, and PRO_B_FALSE if it is internal.
  Internal—The referenced element belongs directly to the model that contains the UDF. For an assembly, this means that the element belongs to the top-level assembly.
  External—The referenced element belongs to an assembly member other than the placement member.
The function ProUdfdataReferenceAdd() adds the reference structure to the ProUdfdata structure.
Use the function ProUdfreferenceFree() to free the UDF reference handle.
Assembly Intersections
The data structure used for assembly intersections is ProUdfintersection.
Functions Introduced:
The function ProUdfintersectionAlloc() sets the values used to determine how a UDF placed in the context of an assembly intersects the members of the assembly. This function requires the following inputs:
•  intersect_part—The component path from either the placement assembly or the external reference assembly down to the intersected component. The external reference assembly is provided by the asm_reference argument to ProUdfCreate().
•  visibility—The depth of the component path into the assembly where the intersected UDF is visible. If visibility is equal to the length of the component path, the feature is visible in the part that it intersects and all assemblies and subassemblies. If visibility is 0, the feature is only visible in the top-level assembly.
•  instance_names—An array of names for the new instances of parts created to represent the intersection geometry.
The function ProUdfdataIntersectionAdd() adds the intersection structure to the ProUdfdata structure.
Use the function ProUdfintersectionFree() to free the UDF intersection handle.
External Symbol: Parameters
The data structure for external symbol parameters is ProUdfextparam.
Functions Introduced:
The function ProUdfextparamAlloc() allocates and sets a ProUdfextparam structure, which describes an external symbol referencing a parameter. The input arguments of this function are:
•  prompt—The prompt for the external parameter symbol.
•  parameter—The parameter which is used to resolve this external symbol in the placement model.
Use the function ProUdfdataExtparamAdd() to add information about an external symbol parameter to the UDF data. Use the function ProUdfextparamFree() to free the UDF external parameter handle.
External Symbol: Dimensions
The data structure for external symbol dimensions is ProUdfextdim.
Functions Introduced:
Use the function ProUdfextdimAlloc() to allocate and set a structure which describes an external dimension symbol required by the UDF. The input arguments of this function are:
•  prompt—Specifies the prompt used for this external symbol.
•  dimension—Specifies the dimension handle to be used to resolve the external symbol in the placement model.
Use the function ProUdfdataExtdimAdd() to add information about a required external dimension symbol to the UDF data. Use the function ProUdfextdimFree() to free the UDF dimension external symbol handle.
Copied Model Names
The data structure used for specifying new component model names is ProUdfmdlNames.
Functions Introduced:
The function ProUdfmdlMdlnamesAlloc() sets the values used to determine the names of new components created by the UDF placement. This function requires the following inputs:
•  old_name—The old name of the component.
•  new_name—The new name of the component to be created.
The function ProUdfmdlNamesSet() adds the model names structure to the ProUdfdata structure.
Reading UDF Properties
The functions in this section provide the ability to read the options for placement directly from a UDF file (a .gph file) in order for an application to decide at runtime the inputs it will use for placing a given UDF. The following functions operate on ProUdfdata. These functions are capable of reading properties from the UDF file so long as the UDF name or path has already been set by ProUdfdataNameSet() or ProUdfdataPathSet().
Some of the data retrieved by the functions in this section uses the same data types as the corresponding ProUdfdata set functions used for placing the UDF (as listed in the earlier section). However, data that you read out of the ProUdfdata is not related to data that you are using to place the UDF. You must explicitly pass each piece of data to the ProUdfdata functions if you want the UDF to be placed with this information.
Variable Dimensions
Functions Introduced:
Use the function ProUdfdataVardimsGet() to obtain an array of available variant dimensions that may be set when placing this UDF. You can use the function ProUdfvardimProarrayFree() to free this ProArray of variant dimensions.
Note
The handles obtained when the function ProUdfdataVardimsGet() is called are not automatically assigned to the UDF for placement. In order to place the UDF with a user-defined variant dimension value, you must use ProUdfdataVardimAdd().
Use the function ProUdfvardimNameGet() to obtain the symbol of the variant dimension. This symbol of the dimension in the reference model should be used in ProUdfvardimAlloc().
Use the function ProUdfvardimPromptGet() to obtain the prompt of the variant dimension.
Use the function ProUdfvardimDefaultvalueGet() to obtain the default value for the variant dimension.
Variable Parameters
Functions Introduced:
Use the function ProUdfdataVarparamsGet() to obtain an array of available variant parameters and/or annotation values that can optionally be set when placing this UDF. You can use the function ProUdfvarparamProarrayFree() to free this ProArray of variant items.
Note
The handles obtained when the function ProUdfdataVarparamsGet() is called are not automatically assigned to the UDF for placement. In order to place the UDF with a user-defined variant parameter or annotation value, you must use ProUdfdataVarparamAdd().
Use the function ProUdfvarparamOwnerGet() to obtain the feature or annotation element that owns this variant parameter or annotation value.
Use the function ProUdfvarparamNameGet() to obtain the name or the symbol of the variant parameter or annotation value.
Use the function ProUdfvarparamDefaultvalueGet() to obtain the default value for the variant parameter or annotation value.
UDF References
Functions Introduced:
Use the function ProUdfdataRequiredreferencesGet() to obtain a list of the references required to be set for UDF placement. In order to use this function, the UDF data must have its name or path set, and Creo Parametric must be able to successfully find the .gph file based on this information.
Use the function ProUdfrequiredrefPromptGet() to obtain the reference prompt for a UDF reference.
Use the function ProUdfrequiredrefTypeGet() to obtain the type of item that should be supplied for a UDF reference.
Use the function ProUdfrequiredrefIsannotationref() to determine if the reference is an annotation reference and is allowed to be left incomplete.
You can use the function ProUdfrequiredrefFree() to free a required reference handle for a UDF. Use the function ProUdfrequiredrefProarrayFree() to free a ProArray of handles to the required references of a UDF.
External Symbols
Functions Introduced:
Use the function ProUdfdataExternalsymbolsGet() to obtain an array of external symbols required by this UDF. You can free a UDF external symbol handle using the function ProUdfextsymbolFree() and use the function ProUdfextsymbolProarrayFree() to free an array of external symbol handles.
Use the function ProUdfextsymbolTypeGet() to obtain the type of external symbol required (dimension or parameter).
Use the function ProUdfextsymbolPromptGet() to obtain the prompt for this external symbol.
Use the function ProUdfextsymbolParametertypeGet() used to obtain the expected parameter type for an external symbol, if the type is PRO_UDFEXTSYMBOL_PARAM.
Instance Names
Function Introduced:
Use the function ProUdfdataInstancenamesGet() to obtain an array of the instance names that may be used when placing this UDF. You can free this ProArray of instances using the function ProArrayFree().
Notification on UDF Library Creation
Creo TOOLKIT provides the ability to be notified whenever a new UDF library is created or when one is modified. You can use this notification to store additional information about the UDF library file, for example, the names and values of parameters used in the UDF.
Functions Introduced:
Use the function prototype ProUdfLibraryCompletePostAction() for a notification corresponding to the ProNotifyType PRO_UDF_LIB_COMPLETE_POST. This function provides the name of the newly created or modified UDF library file, and a list of all the features included in the UDF.
Note
If you modify a UDF library, which is independent and contains no reference model then no features will be included in the input to the notification.
Multibody Support in a UDF and a Copy feature
Automatic Filling of the Body Reference
In Creo Parametric 7.0.0.0, when you are prompted for a body reference, the prompt will be automatically filled with the default body in the following cases:
•  When placing a UDF created in an earlier release, in a single body target model.
•  When placing a UDF created in an earlier release, in a multibody target model, and when the configuration option tk_pre_creo7_udf_body_autofill is set to yes. Use this configuration option to automatically fill the default body during UDF placement in Creo TOOLKIT.
•  In UDFs created in Creo Parametric 7.0.0.0, the body references are not automatically filled.
The following table lists the changes in the UDF functions ProUdfCreate() and ProUdfdataRequiredreferencesGet():
Version of gph file
Bodies in target model
Value of the configuration option tk_pre_creo7_udf_body_autofill
ProUdfCreate()
ProUdfdataRequiredreferencesGet()
Release earlier than Creo Parametric 7.0.0.0
Single Body
No
Returns PRO_TK_NO_ERRORand automatically fills the UDF with the only available body
Returns PRO_TK_NO_ERROR and also the body ref/prompt
Release earlier than Creo Parametric 7.0.0.0
Single Body
Yes
Returns PRO_TK_NO_ERROR but does not return the body ref/prompt
Release earlier than Creo Parametric 7.0.0.0
Multibody
No
• 
1. If body reference is not specified, returns PRO_TK_MULTIBODY_UNSUPPORTED and the UDF creation fails.
•  If correct body reference is specified, returns PRO_TK_NO_ERROR
Returns PRO_TK_NO_ERROR and also the body ref/prompt
Release earlier than Creo Parametric 7.0.0.0
Multibody
Yes
Returns PRO_TK_NO_ERROR and automatically fills the UDF with the default body
Returns PRO_TK_NO_ERROR but does not return the body ref/prompt
New
Single Body
No
Does not automatically fill the UDF.
Returns PRO_TK_NO_ERROR and also all the body ref/prompt
New
Single Body
Yes
New
Multibody
No
New
Multibody
Yes
API Behavior for All Combinations of UDF Type, Creation and Placement
The following cases use an example of the Solid Extrude or Cut feature requiring 3 references for placement — Top, Right and Front datum planes.
Subordinate UDF Created in a release earlier than Creo Parametric 7.0.0.0
Created in a Part or Assembly
UDFs that are Retrieved and Placed
 
Assembly
Part
Assembly
Irrespective of the value of the configuration option tk_pre_creo7_udf_body_autofill
ProUdfdataRequiredreferencesGet()—3
ProUdfCreate()—Success and returns PRO_TK_NO_ERROR
Irrespective of the value of the configuration option tk_pre_creo7_udf_body_autofill
ProUdfdataRequiredreferencesGet()—3
ProUdfCreate()—Success and returns PRO_TK_NO_ERROR. Default body is used implicitly
Part
Value of the configuration option tk_pre_creo7_udf_body_autofill is YES
ProUdfdataRequiredreferencesGet()—3
ProUdfCreate()— returns PRO_TK_NO_ERROR
Value of the configuration option tk_pre_creo7_udf_body_autofill is YES
ProUdfdataRequiredreferencesGet()—3
ProUdfCreate()—automatically fills the reference with the default body and returns PRO_TK_NO_ERROR.
Value of the configuration option tk_pre_creo7_udf_body_autofill is NO
ProUdfdataRequiredreferencesGet()—4
ProUdfCreate()— returns PRO_TK_NO_ERROR
Note
You need not fill the body reference.
ProUdfdataRequiredreferencesGet() is for query purpose only.
Value of the configuration option tk_pre_creo7_udf_body_autofill is NO
ProUdfdataRequiredreferencesGet()—4
Single body
ProUdfCreate()—automatically fills the reference with the default body and returns PRO_TK_NO_ERROR.
Multibody
ProUdfCreate()— returns PRO_TK_MULTIBODY_UNSUPPORTED, if you do not specify the body reference and the UDF creation fails.
ReturnsPRO_TK_NO_ERROR, if you do not specify the body reference correctly.
Stand-alone UDF with a Reference Model, Created in a Release Earlier than Creo Parametric 7.0.0.0
You can create a stand-alone UDF with a reference model in a part but not in an assembly
Created in a Part or Assembly
UDFs that are Retrieved and Placed
 
Assembly
Part
Assembly
NIL
NIL
Part
Value of the configuration option tk_pre_creo7_udf_body_autofill is YES
ProUdfdataRequiredreferencesGet()—3
ProUdfCreate()— returns PRO_TK_NO_ERROR
Value of the configuration option tk_pre_creo7_udf_body_autofill is YES
ProUdfdataRequiredreferencesGet()—3
ProUdfCreate()—automatically fill the reference with the default body and returns PRO_TK_NO_ERROR.
Value of the configuration option tk_pre_creo7_udf_body_autofill is NO
ProUdfdataRequiredreferencesGet()—4
ProUdfCreate()— returns PRO_TK_NO_ERROR
Note
You need not fill the body reference.
ProUdfdataRequiredreferencesGet() is for query purpose only.
Value of the configuration option tk_pre_creo7_udf_body_autofill is NO
ProUdfdataRequiredreferencesGet()—4
Single body
ProUdfCreate()—automatically fill the reference with the default body and returns PRO_TK_NO_ERROR.
Multibody
ProUdfCreate()— returns PRO_TK_MULTIBODY_UNSUPPORTED, if you do not specify the body reference and the UDF creation fails.
ReturnsPRO_TK_NO_ERROR, if you do not specify the body reference correctly.
Stand-alone UDF without Reference Model, Created in a Release Earlier than Creo Parametric 7.0.0.0
For a stand-alone UDF created without a reference model, there is no information where it was created and creating in an assembly is assumed. Therefore, body references are not appended.
Created in a Part or Assembly
UDFs that are Retrieved and Placed
 
Assembly
Part
Assembly or part. There is no information in the .gph file and as a result no difference from earlier releases
Irrespective of the value of the configuration option tk_pre_creo7_udf_body_autofill
ProUdfdataRequiredreferencesGet()—3
ProUdfCreate()—Success and returns PRO_TK_NO_ERROR
Irrespective of the value of the configuration option tk_pre_creo7_udf_body_autofill
ProUdfdataRequiredreferencesGet()—3
ProUdfCreate()—Success and returns PRO_TK_NO_ERROR
Default body is used implicitly
Stand-alone UDF without Reference Model, Created in Creo Parametric 7.0.0.0
Body references for features like Extrude or Cut created in a part in Creo Parametric 7.0.0.0 are included in the feature definition and saved in the UDF. When such UDFs are retrieved in a part, you are always prompted in the user interface for the body references, and ProUdfdataRequiredreferencesGet() always returns the actual number of references stored in the UDF.
Created in a Part or Assembly
UDFs that are Retrieved and Placed
 
Assembly
Part
Assembly
Irrespective of the value of the configuration option tk_pre_creo7_udf_body_autofill
ProUdfdataRequiredreferencesGet()—3
ProUdfCreate()— Success and returns PRO_TK_NO_ERROR.
Irrespective of the value of the configuration option tk_pre_creo7_udf_body_autofill
ProUdfdataRequiredreferencesGet()—3
ProUdfCreate()— Success and returns PRO_TK_NO_ERROR.
Default body is used implicitly.
Part
Irrespective of the value of the configuration option tk_pre_creo7_udf_body_autofill
ProUdfdataRequiredreferencesGet()—4 or more
1 or more body references.
ProUdfCreate()— returns PRO_TK_NO_ERROR
Note
You do not need to fill the body reference.
ProUdfdataRequiredreferencesGet() is for query purpose only.
Irrespective of the value of the configuration option tk_pre_creo7_udf_body_autofill
ProUdfdataRequiredreferencesGet()—4 or more
1 or more body references.
ProUdfCreate()—Single or Mutlibody — Do not fill the body reference.