Analysis Callbacks
 
When registering a Toolkit-Based Analysis type, callbacks must be provided for each of the following 13 types:
ui
dims
infoalloc
infofree
compcheck
compute
display
output
savecheck
infosave
inforetrieve
infocopy
result
Each callback is passed an argument of the ProAnalysis type, which is an opaque handle and identifies the analysis information stored by Creo Parametric.
The following table explains when the callbacks are called, and how each one should be used.
When Creo Parametric creates a toolkit-based analysis or analysis feature:
Callback
Description
infoalloc
Allocate memory for the Creo TOOLKIT application information about the toolkit-based analysis.
ui
Creo TOOLKIT prompts the user for inputs that define the analysisfor example, select a surface datum point on which to position a csys.
compcheck
Tell Creo Parametric whether the computation can be performed. If the Creo TOOLKIT application cannot perform the computation (for example, because input data is unavailable), it returns an error and the regeneration fails.
compute
Perform the analysis computation and store the results in memory.
display
Display graphics showing the computation result.
output
Pass a set of text lines to Creo Parametric for display in the ANALYSIS dialog box to show the result of the computation.
infocopy
Copy the application information from an existing analysis to a new one. Call infocopy during creation because of the way in which Creo Parametric handles feature creation.
dims
Creo TOOLKIT gives Creo Parametric a list of double values needed to calculate the geometry. Creo Parametric stores these as model dimensions.
result
Creo TOOLKIT gives Creo Parametric a description of the feature parameters and geometry items that result from the computation of the analysis. Creo Parametric may also call this callback when it needs to know only the number and names of parameters and datums; an example is when the user selects Feature Info. For more details, refer to the section Results Data.
When the Creo Parametric user saves the analysis to the solid:
Callback
Description
savecheck
Tell Creo Parametric whether the description of the analysis can be saved.
infosave
Give Creo Parametric a list of geometry items referenced by the analysis. Creo Parametric stores these using its own internal mechanism for storing references. The references appear in the model as feature references, and are used to determine the relationship of the feature to other features, and therefore when the feature needs to be regenerated.
OR
Store any other data as external data.
When the Creo Parametric user retrieves a solid containing analyses:
Callback
Description
inforetrieve
Creo Parametric provides an array of ProSelection objects representing the geometry references it stored with the analysis. (This means that the Creo TOOLKIT application does not need to save these references between sessionsCreo Parametric uses its own mechanism.)
When the Creo Parametric user leaves the ANALYSIS dialog box without saving the new analysis, or erases a solid containing a toolkit-based analysis:
Callback
Description
infofree
The Creo TOOLKIT application frees the memory used by its internal description of the analysis.
Many of the callbacks will be called during other commands in Creo Parametric whenever the toolkit-based analysis or analysis feature is affected.
Was this helpful?