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 > .
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.