The API of SMARTAnnotate provides a mechanism that allows to use SMARTAnnotate functionalities in an automated and user independent manner.
Therefore, a bunch of tasks can be executed in an asynchronous Creo session to examine and manipulate models and drawings.
For instance, via a batch run,
it’s possible to translate a drawing using SMARTAnnotate API into the desired languages and export the result as PDF file
to a specific location.
In order to set up an asynchronous Creo batch session, you can either create your own asynchronous Creo application or use
the one that is provided via the SMARTAnnotate installation.
Regarding the first option, you’ll find all relevant information in the PTC Creo/Toolkit documentation.
As a third option it can be mentioned, that it’s also possible to call the SMARTAnnotate API functions within a SMARTAssembly
tab file. See the SMARTAssembly documentation for more information about the relevant keywords.
Environment
Independent of which option you’ll choose, it’s mandatory to define some environment specific settings. The following environment
variables have to be taken into account:
- PRO_COMM_MSG_EXE: Its value has to be set to the path of the file pro_comm_msg.exe, which is stored within the Creo installation folder under ”<Creo Install Dir>\Common Files\x86e_win64\obj”.
- PTC_WF_ROOT: The directory containing the workspace cache. Has to be empty before the batch session is started.
- PATH: Make sure that the folder ”<Creo Install Dir>\Common Files\x86e_win64\lib” is contained within the PATH variable, so that
the dynamic libraries ucore46.dll and udata64.dll can be retrieved by the Creo process.
- SAN_USER_CONFIG_PATH: The directory containing the (customized) configuration of SMARTAnnotate, which shall be used as basis for performing the
tasks on the models.
- BUW_BATCH_LOGGING_DIR_PATH: The directory path wherein the log file 'smartannotate_api.log' will be created. It provides details about the execution
status of the batch process and the certain tasks. If not set, the logging is done into the trail file of the Creo session.
- BUW_BATCH_MODE: Set the value ‘TRUE’ to prepare the application for API calls in non-user batch mode.
Tasks
Check out the chapter
API Function Overview to see all available batch tasks currently provided by SMARTAnnotate.