Contact Us
Contact our corporate or local offices directly.
The Altium NEXUS scripting system provides all the tools and features needed to create scripts that automate tasks in the software.
The script editor, debugger, and scripting panels work together to help you write and debug your scripts easily. A script can be run directly from the script editor or assigned to a menu, toolbar, or hotkey so that it can be applied to the current document – such as a PCB Layout – at any time.
Altium NEXUS showing Script Code and Form windows with the Object Inspector, Code Explorer, and Tool Palette panels.
The scripting system is composed of two main parts – the editor and the debugger. The main features are as follows:
Project access – Scripts can be saved in a script or design project. Routines from any script in a project are accessible to other scripts within the same project.
Scripting Editor – The scripting editor features a dedicated text editor with a range of options to set up the editing environment and syntax coloring.
Scripting Panels – The scripting system features a number of panels that help you code and debug scripts quickly.
Scripting Debugger – If a script has an error when it is being executed, a dialog appears with a concise error message. You have the ability to preview variables in the Watches window, trace code and control the execution of the script with the Script Debugger.
Scripting Languages – Scripts can be created in DelphiScript and if enabled as a legacy language, VBScript.
Script Projects support two script document types – Script Units and Script Forms. Script Units allow you to write standalone procedures and functions. Script Forms allow you to build dialogs with controls and event handlers, as well as procedures and functions.
*.pas
file that contains has event handlers and procedures/functions, and a *.dfm
file that has details of the script form itself along with its components and their locations.Example and reference scripts are a helpful resource for understanding how object interfaces, methods, processes, properties, and components are applied in scripts. They can also be used as the basis for your own script projects.
To quickly run a script example in Altium NEXUS, first open an example project or an individual script file from one of the example script folders – for example, the simple 'Hello World' project (HelloWorld.PRJSCR
) from the Scripts\Delphiscript Scripts\General
folder.
The DelphiScript Hello World project open in the Projects panel.
The project contains two versions of the 'Hello World' script, where the second (HelloWorlDialog.pas
) demonstrates the basic use of a Form unit. Double-click a script name to open and inspect the script in the editor – note that a script can be run without it being open in the editor.
To run one of the scripts, select File » Run Script from the main menus, then choose an available script procedure from the Select Item To Run dialog. When a version is run, a dialog will open to display the message.
The quick and simple way to run an example script.
The default preferences settings for the scripting system can be configured in the Preferences dialog, which is accessed by clicking on the control button at the top-right of the workspace.
The Text Editors – General page of the Preferences dialog allows you to set up your script editing requirements, such as the string search behavior, how lines are tabbed and indented, how keys are mapped, and a number of other advanced options.
The Text Editors – General page of the Preferences dialog
The Text Editors – Colors page of the Preferences dialog allows you to configure the Script Editor's syntax coloring for the scripting language of your choice, and set up the color of the elements within the script editor. For example, black for the background, white for the comment keywords, and so on.
The Text Editors – Colors page of the Preferences dialog
The Text Editors – Display page of the Preferences dialog allows you to configure the visual features of scripts, such as displaying right margins and line numbers, syntax highlighting and code outlining.
The Text Editors – Display page of the Preferences dialog
The Scripting System – Global Projects page of the Preferences dialog list script projects that are available (installed). Script projects can be installed, removed, or reordered.
The Scripting System – Global Projects page of the Preferences dialog
The Scripting System – Form Designer page of the Preferences dialog provides the grid and component designator options for a scripting form document.
The Scripting System – Form Designer page of the Preferences dialog
Contact our corporate or local offices directly.