HM_ExtAPI::RunHMTclString()

Executes command using internal HyperMesh Tcl interpreter and returns the result of execution.

Syntax

const char* RunHMTclString(
const char*  command,
int*  result_code = NULL
);

Type

HyperMesh Ext API Function

Description

Successful execution of RunHMTclString function does not guarantee that corresponding command was also successfully executed. In case when command execution encountered some error the string returned from RunHMTclString function contains command specific error description. Parameter result_code can be used to detect command specific errors without parsing the result string. The value of 0 returned by result_code parameter indicates successful command execution.

Note that the use of RunHMTclString function can make invalid entity handles returned by earlier calls to other API functions.

The following code can be used to delete all free lines in the model currently loaded into HyperMesh database.

hm_api->RunHMTclString("*createmark lines 1 all");
hm_api->RunHMTclString("*deletemark lines 1");

If the function succeeds, then the function returns string value of the result. The format of returned string depends on specific command specified by parameter command. Refer to HyperMesh Tcl documentation for further details. The return value of NULL indicates that HyperMesh DLL failed to initialize properly and cannot be used.

Requires including hm_extapi.h.

Inputs

command
[in] - Command string passed to internal HyperMesh Tcl interpreter for execution.
result_code
[out] - If not NULL then returns numeric code of execution result. The value of 0 indicates successful execution of the command.

Errors

None.