Feature Element Values
Functions introduced:
The object
ProValue is an opaque workspace handle used to contain the value of a feature element. It is the output of the functions
ProElementValueGet()and
ProElementValuesGet(), which read the values of a feature element, and is the input to
ProElementValueSet() and
ProElementValuesSet().
You can access the contents of a ProValue object by translating it into an object of type ProValueData, which is declared as a visible data structure. The declaration is as follows:
typedef struct pro_value_data
{
ProValueDataType type;
union
{
int i; /* integer */
double d; /* double */
void *p; /* pointer or reference */
char *s; /* string */
wchar_t *w; /* wide string */
ProSelection r; /* selection */
double **t; /* transform a matrix of 4x4 */
ProBoolean b; /* boolean */
} v;
} ProValueData;
typedef enum pro_value_data_type
{
PRO_VALUE_TYPE_INT = 1,
PRO_VALUE_TYPE_DOUBLE,
PRO_VALUE_TYPE_POINTER,
PRO_VALUE_TYPE_STRING,
PRO_VALUE_TYPE_WSTRING,
PRO_VALUE_TYPE_SELECTION
} ProValueDataType;
ProValueData is simply a holder for data values of many different types.
|
 From Pro/ENGINEER Wildfire 2.0 onwards, elements with multiple values, for example, PRO_E_FIXT_COMPONENTS, are deprecated. In subsequent releases, these elements will be superseded by reference elements or single-value, type-specific elements. Use the function ProElementValuetypeGet() to determine the type of the element.
|
The functions in this section access the contents of a ProValue through the ProValueData object.
The function
ProElementDirectionGet() calculates the direction vector and origin point based on the direction reference and flip orientation stored inside the direction element. The input argument
element is the
PRO_E_DIRECTION_COMPOUND compound element, which contains two sub elements inside
PRO_E_DIRECTION_REFERENCE and
PRO_E_DIRECTION_FLIP. The output argument are:
• vector—calculated ProVector direction vector.
• origin—calculated Pro3dPnt direction origin point.
The function
ProValueDataGet()provides the
ProValueData object for the specified
ProValue object.
The function
ProValueAlloc() allocates a new
ProValue in memory, as the first step towards setting the value of a feature element.
The function
ProValueDataSet() sets the value of a
ProValue object using the contents of a
ProValueData structure.
The function
ProValueFree() frees a
ProValue object in memory.
The function
ProWstringArrayToValueArray() provides a convenient way to allocate and fill an array of
ProValue structures that all contain wide string values.
The function
ProValueArrayToWstringArray() performs the reverse translation, allocating and filling an array of wide strings. In both cases, the output array is an expandable array, so you should release the memory using
ProArrayFree().
The transform member of the union
ProValueData is declared as double**. It must be passed a double[][] (a
ProMatrix structure). The utility functions
ProValuedataTransformGet() and
ProValuedataTransformSet() specify how to assign the
ProValueData in order to access the matrix correctly.