Click or drag to resize
Getting Started

All new script add-ins must derive from base class CTExtension (from assembly CTInterface.dll) and implement overrides for at least Hook(CTInterface) and UnHook(CTInterface). This brings minimal valid script add-in as follows:

C#
// @AUTO-REFERENCE { [CT_INSTALL_PATH]\CTInterface.dll }
// @AUTO-REFERENCE { [CT_INSTALL_PATH]\Interop.CTEngineLib.dll }

using ATR.CT.CTInterface;
using CTExtensions;
using CTEngineLib;

public class MyAddin : CTExtension
{

  public override bool Hook(CTInterface oCTInterface)
  {
    bool bHooked = false;
    if (oCTInterface != null)
    {
      // Hook to CTInterface events and set bHooked = true.
    }
    return bHooked;
  }

  public override void UnHook(CTInterface oCTInterface)
  {
    if (oCTInterface != null)
    {
      // Un-Hook all handlers from CTInterface
    }
  }

}

Navigate to the Manage Scripts node in the Database View of the CUSTOMTOOLS Administration Tool and then use the following instructions to deploy the script above:

  1. Choose <New Script> from the Selected script box and then write or copy-paste your script to the editor. You can also click the Browse button to load your script's source code from a file.

  2. In the Name box, you can freely define name for your script add-in.

  3. In the Class name box, type MyAddin because that is name of the public class implemented in the example script above that has a valid public constructor for CUSTOMTOOLS to be used as the script's entrypoint.

  4. Select the Load at start-up option so the script will be loaded with CUSTOMTOOLS startup and leave the Debug add-in option clear. For more information about debugging script addins, please see Debugging Script Add-In With Visual Studio (C#).

  5. Click the Check In button. Once the Check In button is clicked, the following operations are performed:

    • Referenced assemblies are added to the script add-in in case there are new ones according to the // @AUTO-REFERENCE notations. Existing references are not updated or deleted.

    • The script is compiled for the current local user.

      Note Note

      Because of the Microsoft .NET Framework restrictions, only one successfull compile of the same script may be performed during one CUSTOMTOOLS Administration Tool session. In case you have already compiled the script successfully, an error appear during the second compile attempt about that the file is already being used by another process. This does not neccessarily mean that the script would not compile successfully on the other client workstations while starting CUSTOMTOOLS.

    • On a successfull compile, the script add-in is stored to the CUSTOMTOOLS database, from where it is about to be loaded for each client on the next startup of CUSTOMTOOLS.

Important note Important

Your add-in have to compile successfully on every client workstation it is about to be used in. If you are using absolute paths to define referenced dll files, you should pay an extra attention because the absolute paths used in the script, have to exist in each client workstation right as they are defined in the script.