Simulation > Mechanism Design and Mechanism Dynamics > Mechanism Dynamics > Custom Loads > Guidelines for Creating a Custom Load Application
Guidelines for Creating a Custom Load Application
To effectively write custom loads, you must be familiar with the Creo Parametric TOOLKIT application and have a thorough knowledge of the C programming language. You must also have in-depth experience using Mechanism Dynamics and a good understanding of how forces, measures, and all other modeling entities work.
A typical custom load application includes two phases:
Initialization routine—Requests the user for parameters to set up the custom load. You can also include error checking in this routine to ensure that the user has correctly defined the input.
Evaluation routine—Evaluates the custom load based on customized logic or the current value of existing measures in the Mechanism Dynamics model.
Keep in mind the following points when creating a custom load:
You should understand how the Mechanism Dynamics user perceives and interacts with the custom load. If you plan and design the custom load properly, it appears to the user almost as a built-in feature of Mechanism Dynamics.
You must specify what input to request from the user and what additional data to request from Mechanism Dynamics. You should also define what output is produced by the custom load, and what error conditions can occur.
You should always provide a help file with any custom load you make. Each help file you create enables you to communicate detailed information about a specific custom load to the user of the custom load. You can put this information in a simple ASCII file that is accessible when the user applies the custom load.
The <Creo Parametric install directory>/CustomLoad/CustomDLL.c file must be included in your program when you create a custom load. This file provides the communication layer between Creo Parametric and your custom load program. The CustomDLL.h file (located in the same directory) must also be included in any of your source files that calls a custom load API routine or that defines one of the user custom load routines that is called by Creo Parametric.
Custom loads applications are only supported in DLL mode, and they should be unlocked before they are distributed to end users.
Only one custom load executable can run at any one time in a session. If multiple custom loads are required by a model, they must all be defined in the same executable. All custom load API functions have a unique custom load name to identify the load being used.