Use OML Functions in HyperWorks Products
OML functions can be registered from the Compose graphical user interface or via a preference file and later opened in certain HyperWorks products.
Once registered, the OML functions are accessible in the following products, without invoking Compose: HyperGraph, HyperStudy, MotionView, and the HyperMesh Matrix Browser.
Register OML Functions in Compose
This method allows you to automatically register OML functions directly from Compose.
To register a written function, make sure it is saved on disk first (*.oml file).
Register OML Functions Using a Preference File
You can register a function by creating a preference file and explicitly registering it with HyperWorks Desktop.
After registering an *.oml file with the *RegisterOMLFunction() statement in a HyperWorks preference file, the OML functions in the file are available in the following HyperWorks applications, just like any other internal math function: HyperStudy (response functions), TextView, HyperView (notes), HyperGraph (curves, notes, datum lines, and plot labels), and Templex.
The path to the Compose installation is required for the HyperWorks application to use a specific version of Compose:
*SetOMLRootDir(path)
where path is the path to the Compose installation.
The syntax for the *RegisterOMLFunction() statement is:
*RegisterOMLFunction(Function, File, Parameters)
- Function
- The name of the OML function. This is a string.
- File
- The name of the OML file where the function resides. This is a string.
- Parameters
- The number of parameters that the function accepts as input. This is for syntax presentation only.
*SetOMLRootDir("E:/COMPOSE/Compose_2017.3")
*RegisterOMLFunction("mymean","E:/ST_COMPOSE/mymean.oml",1)
where mymean is the function in the mymean.oml file and that function takes one argument as input.
function y = mymean(x)
b = 0.2*ones(1,5);
a = 1;
y = filter(b,a,x);
end
Use an OML function in an OptiStruct DRESP3 Bulk Data Entry
In OptiStruct, the DRESP3 Bulk Data Entry allows you to define responses through user-defined external functions.