Application Programming Interface (API)
The API of SmartMBDTools provides a mechanism that allows to use SmartMBDTools 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 SmartMBDTools 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 SmartMBDTools installation.
Regarding the first option, you’ll find all relevant information in the PTC Creo/Toolkit documentation.
For more information about the asynchronous Creo application that is provided by SmartMBDTools, check out the chapter SmartMBDTools provided Batch Process.
As a third option it can be mentioned, that it’s also possible to call the SmartMBDTools 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.
  • SMBDT_USER_CONFIG_PATH: The directory containing the (customized) configuration of SmartMBDTools, 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 'smartmbdtools_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.
Tasks
Check out the chapter API Function Overview to see all available batch tasks currently provided by SmartMBDTools.