*SetLocalUserFunction()

Specifies the local subroutine function and function name for an entity that uses user defined properties.

Syntax

*SetLocalUserFunction(varname, local_dll, local_func_type, local_funcname)

Arguments

varname
The variable name of the entity that uses a local subroutine.
Data type: variable
local_dll
The file name of the local function that is to be used by the user defined entity.
Data type: string
local_func_type
Valid values are: DLL|PYTHON|MATLAB. See Comments below.
Data type: keyword
local_funcname
The function name to be referred for the entity within the local function file (local_dll).
Data type: string

Example

Example 1
*Motion(mot_0, "Motion 0", JOINT, , TRANS)
*SetMotion(mot_0,                  USER, `USER(1001)`)
*SetLocalUserFunction(mot_0, "mymot.py" , PYTHON , , "mymotion")
Example 2
*Motion(mot_0, "Motion 0", JOINT, , TRANS)
*SetMotion(mot_0,                      USER, `USER(1001)`)
*SetLocalUserDLLFlag(mot_0,                      true)
  *SetLocalUserFunction(mot_0,                      , PYTHON)
*SetLocalUserDLL(mot_0,                      "mymot.py")
*SetLocalUserFuncname(mot_0,                      "mymotion")

Context

*BeginMdl()

*DefineAnalysis()

*DefineSystem()

*DefineAssembly()

*BeginContext()

Comments

This statement can be used to specify the function file name, function type and the function name that is referred by the user defined entity.

This statement can be considered as the superset of *SetLocalUserDLL and *SetLocalUserFuncname.

Using this function automatically sets the use_local_dll to "true". If the use_local_dll has to be set to "false", use *SetLocalUserDLLFlag subsequent to using this statement. Any previous *SetLocalUserDLLFlag statements to control the state of local_dll flag will be overridden.

The above set of examples are equivalent. By default, the MotionView GUI saves the user defined property as shown in Example 2.

PYTHON and MATLAB are applicable for MotionSolve only.

Use DLL as the option, if the solution is being solved in Linux with an .so function type. It is recommended to avoid specifying a .dll or .so extension in *SetLocalUserDLL so that the solver deck is portable between different platforms.

MotionView does not verify the availability of the file specified in local_dll at the mentioned location.

While working with MotionSolve, if a file in the local installation has to be used, it is recommended to specify the file name without the path. This is especially useful when the solution is executed on a different machine. It is recommended to avoid specifying a .dll or .so extension for the filename if local_func_type is DLL so that the solver deck is portable between different platforms.