Results Data
This section describes in more detail the data given to Creo+ by the Creo TOOLKIT application as the output from the results callback.
The output consists of two arrays, one for the feature parameters, the other for the feature geometry. Each of these is a ProArray allocated by Creo+ before calling the callback.
The structure for a feature parameter is:
typedef struct analysis_param
{
ProName name;
ProBoolean create;
ProLine description;
ProParamvalue *values;
} ProAnalysisParameter;
The name is that of the feature parameter that will be created. The create flag shows the default setting of the Create option for the parameter in the ANALYSIS dialog box. The description appears alongside the parameter in the ANALYSIS dialog box. The array of values should have only a single item in it in the current release. The structure ProParamvalue is the same one used for accessing user parameters through the functions in ProParameter.h and ProParamvalue.h. The value type must be “double” in the current release.
The structure for a geometry item is:
typedef struct analysis_geom
{
ProName name;
ProBoolean create;
ProAnalysisEntityType type;
ProAnalysisEntity *shapes;
} ProAnalysisGeomitem;
The name is given to the resulting datum (NOT to the feature), but with a numerical suffix to ensure that the name is unique in the Creo+ model. The create flag is exactly as for parameters.
The entity type is an enum which is a subset of the object types in ProType. The types supported by this release are:
|
PRO_ANALYSIS_CURVE
|
Curve
|
|
PRO_ANALYSIS_CSYS
|
Coord csys
|
|
PRO_ANALYSIS_POINT
|
Datum point
|
|
PRO_ANALYSIS_COMP_CRV
|
Composite curve
|
|
PRO_ANALYSIS_SURFACE
|
Surface
|
Array “shapes” contains any number of geometric entities of the same type. The union that represents an entity shape is:
typedef union
{
ProAnalysisSrfData *surface;
ProQuiltdata *quilt;
ProCurvedata *curve;
ProCsysdata csys;
} ProAnalysisEntity;
The fields in this union all have types that are generic geometry types in
Creo TOOLKIT, and are declared in the appropriate headers:
ProSurfacedata.h,
ProQuiltdata.h,
ProCurvedata.h,
ProCsysdata.h,
ProEdgedata.h. The first three fields, although they are pointers, are not opaque: in spawn mode or asynchronous mode they point to memory in the
Creo TOOLKIT process, not in the
Creo+ process. It is recommended that you build these structures using the functions in the corresponding header files, for example,
ProCurvedataAlloc(),
ProLinedataInit(), and so on.