To Create Custom Tasks

Creates and schedules tasks based on existing custom task types or task types that you create.

You can create a custom task type using the Task Scheduler interface. You can also create a task that implements a COM interface, or you can create an executable with options that you set through command-line parameters. For instance, you can use a custom task to open a batch of text files. To use a COM interface or executable, you must know how to work in a program language such as VB.net.

Use an Existing Task Type

Requires a list of previously created tasks.

  1. In the Inventor Task Scheduler window, right-click, and select Create Task Custom Task .
  2. In Task Name, enter a name for the task.
  3. In the Task list box, select a task type from the list.
  4. In the Custom Task dialog, enter parameters according to the task type you selected. For instance, if you selected Notepad, the parameters could be C:\Temp\Migration.txt.
  5. Specify a schedule, or select the Immediately option.
  6. Specify a time-out threshold; then click OK.

Use a COM Object or Executable

  1. If you want to use the custom task functionality with COM, first create a COM component which is derived from IServiceModules. The file ServiceModuleInterfaceDef.tlb, which defines the COM interface -- IServiceModules, is installed at Program Files Autodesk Inventor [version] Bin. There are five methods defined in the interface:
    • HRESULT StartTask(). Must be implemented to start the actual custom work at a scheduled time.
    • HRESULT KillTask(void). Reserved.
    • HRESULT SetOptions ([in] VARIANT varOptions). Passes in the options specified on the UI.
    • HRESULT GetInventorProcessID([in, out] SAFEARRAY(long)* ppsaInventorProcIDs). Retrieves Inventor process IDs for monitor usage.
    • HRESULT SetCommand)(*[in} enumTaskCmd enumTaskCmd). Sets the commands for pause, stop, and resume task.
    Note: Reference the file ServiceModuleInterfaceDef.tlb within your project for access to the COM interface.
  2. In the Inventor Task Scheduler main menu, click Create Task Custom Task .
  3. In the Custom Task dialog box, enter a name for the new task, and click the <<...>> button near the Task Type list box.
  4. In the Custom Task Type dialog box, click New.
  5. In the Task Type dialog box, specify a task type name and program ID or application; then click OK.
    • If you are using a COM object, select Program ID and enter a name such as ServiceModule.MigrationManager or ConvertDLL.ConvertManager.
    • If you are using an executable, select Application (EXE File) and enter the name of an executable file, such as notepad.exe.
  6. In the Custom Task dialog box, select the new task in the Task Type menu.
  7. Enter parameters. Here are some examples:
    • For a notepad.exe file, specify the name of the text file to open.
    • If you are converting an IDW to a DWG using a COM object, enter the .idw and .dwg filenames, using the format IDW_FULLPATH_NAME|DWG_FULLPATH_NAME|, where the symbol | is used as a separator.

      E:\Datasets\Version12\part1111.idw|E:\Datasets\Version12\part1111.dwg

    • If you are converting an IDW to a DWG using an executable, enter the .idw and. dwg filenames, using the format IDW_FULLPATH_NAME;DWG_FULLPATH_NAME;, where the semicolon is used as a separator.

      E:\Datasets\Version12\part1111.idw;E:\Datasets\Version12\part1111.dwg

    Click OK.

  8. Specify a schedule, or select the Immediately option.
  9. Specify a time-out threshold; then click OK.