RUNNING SCRIPT FUNCTIONS
In the most recent versions of AllyCAD, we have implemented a very powerful scripting language which is equivalent to Visual Basic for Applications (VBA).
This tech tip tutorial explains how to run Script functions, and some very basic information on how to get started writing your own scripts.
From the menu, select File > Script > Run Script
You will be prompted to browse for a Script function.
If the Scripts path is incorrect, and you see no script files (with extension .a4s), then click on the 'All users' icon in the File Open dialog (circled in RED in the picture below), or on the 'Local user' icon.
Double-click on the script file to run it.
In this example, we will run 'Draw balloon Text.a4s
AllyCAD will prompt you to enter the text for the balloon, and the text height and arrow length. Enter 'A
' as the text, then click OK
Follow the prompts to indicate the position of the balloon text, and then the end point of the arrow. Then press the space bar to end.
in the Balloon Settings dialog to quit the function.
: Some of the Toolkit > General functions
use scripts in the 'All users
' folder and you cannot run a script while another script is still running
. If you do you will get the following error message:
WRITING YOUR OWN SCRIPTS
From the menu, select File > Script > Edit Script
The Script Editor will appear. Use the Help menu in the Script Editor to find out how to write scripts, or open an existing script file to use as an example.
If you modify a script, do not save it back to the “All users” folder. Rather save it to the “Local user” folder (In the Script Editor menu, select File -> Save As, then click on the “Local user” icon in the Save As dialog).
It is advisable that all new scripts to be saved to the “Local user” folder, so that you can easily find them when you want to run them.