The central element of the Mechanical APDL as a Server SDK is a CORBA interface you can use in building a client application. This interface is included in the standard installation of Mechanical APDL.
The following topics describe the CORBA interface and its use:
The ICoMapdlUnit interface provides a set of functions that perform
typical commands in ANSYS Mechanical for solving a simulation.
ICoMapdlUnitgetComponentName();Returns the name of the connected component.
setComponentName(in string
name);Sets the name of the component to
.name
getComponentDescription();Returns the description of the connected component.
setComponentDescription(in string
desc);Sets the description of the connected component to
.desc
uploadFileFromBuffer(in string
p_szFileName, in
CoOctetBuffer
p_pFileContent);Writes a file named
in the remote Mechanical APDL session working directory with
the contents of
p_szFileName.
If p_pFileContent
exists, it is overwritten.p_szFileName
downloadFileFromBuffer(in string
p_szFileName);Returns the contents of the file name
in the remote Mechanical APDL session working
directory.p_szFileName
executeCommand(in string
p_stringCommand);Issues a command to the connected Mechanical APDL session. Output from the command is not returned.
executeCommandToString (in string
p_stringCommand);Issues a command to the connected Mechanical APDL session and returns the output as a string.
terminate();Terminates the connected Mechanical APDL as a Server session.
The following exceptions can be generated by a Mechanical APDL as a Server session, and should be appropriately handled by client applications:
exception
EAnsysUnknown {
| ||
long
code;
| Code for the exception | |
string
description;
| Short description of the exception | |
string
scope;
| Area from where the exception has been thrown | |
string
interfaceName;
| Interface generating the exception (currently only ICoMapdlUnit) | |
string
operation;
| Method called | |
string
moreInfo;
| Additional information about the exception | |
}
| ||
exception
EAnsysInvalidArgument {
| ||
long
code;
| Code for the exception | |
string
description;
| Short description of the exception | |
string
scope;
| Area from where the exception has been thrown | |
string
interfaceName;
| Interface generating the exception (currently only ICoMapdlUnit) | |
string
operation;
| Method called | |
string
moreInfo;
| Additional information about the exception | |
short
position;
| Position of the invalid argument | |
}
| ||
In order to use the CORBA interface for your client application, you must build the interface modules for your development environment by compiling the supplied Interface Definition Language (IDL) file using a suitable IDL compiler.
In a standard installation, the Mechanical APDL as a Server IDL file is located in the directory C:\Program Files\ANSYS Inc\v182\ansys\customize\user.
Refer to the documentation for your CORBA implementation and development environment for details on how to compile the IDL file and including the resulting modules in your application.