LK Script is a scripting language with syntax similar to C that is built in to SAM and the SAM SDKtool, and is used internally for SAM's user interface. It is analogous to VBA in Excel and allows you to automate repetitive or complex simulation tasks. You can use it to:

  • Read and write data to text files.
  • Read and write values of SAM input variables.
  • Run simulations.
  • Read values of SAM output variables.
  • Create graphs.

To open SAM's LK script editor, click New script on the File menu. For more, see the Macros and Scripting topic in SAM's Help system.

For examples of LK scripts for SAM, see LK Samples in the SAM GitHub repository. Use the raw link to download the LK script files:

Use raw link to download LK file from GitHub

The LK Guide manual describes the language (PDF 273 KB)

If you are interested in contributing to LK, you can do so at LK on GitHub.