Capricorn: Dec.22-Jan.29 The Sundial Primer
created by Carl Sabanski
Capricorn: Dec.22-Jan.29

The Sundial Primer Index

DeltaCad Sundial Macros

DeltaCad makes available to the user a Basic programming language that can be used to automate drawing tasks. There is a chapter in the DeltaCad User's Guide, Macro Language, that lists the functions available along with a detailed description of each one. Once a macro has been created it can be used by anyone to perform the task it was designed to do.

A number of diallists have created various macros that will automatically generate a particular sundial within DeltaCad when they are run. The best thing is you do not need to know anything about macros or how to create them in order to use them. Once the sundial is generated you can then use all the DeltaCad drawing functions to modify it in any way you wish.  In this way you can create a customized sundial that will meet your design needs.  If DeltaCad is not your favourite Computer Aided Dialling (CAD) software save the drawing as a dxf or dwg file and open it in your software package to complete the design.

All DeltaCad macros have the extension "bas". Once a macro is created it can be run in a number of ways. The first is by double clicking on the file. The macro is automatically associated with DeltaCad and DeltaCad will start and the macro will be run. The second is shown in Figure 1. First start DeltaCad and select the "Macro " button. Select the "R" button and the "Run macro" window opens. The default directory is "DeltaCad" so if easy access of the macros is desired store them in this directory, which is found under "Program Files". However, any directory containing macro files can be selected. Note that only files with the "bas" extension are shown as they are the only ones that will operate when selected. Select the desired macro and then the "Run" button. The macro will be initiated.

Figure 1: Running a Macro Using the "R" Button

Figure 1: Running a Macro Using the "R" Button

The third method is shown in Figure 2. First start DeltaCad and select the down arrow button. A drop down menu or Macro List appears with all the macros available in the "DeltaCad" directory. Select the desired macro and then "Run Macro" button. The macro will be initiated.

Figure 1: Running a Macro Using the "Run Macro" Button

Figure 2: Running a Macro Using the "Run Macro" Button

The feature in Figure 2 is very useful as the macros can be given names that clearly identify what they can do. The macro files can be stored in any directory. Figure 3 shows how to add macros to the Macro List. Select the "Edit Macro List" button and then the "Add" button in the "Edit Macro List" window. Compose a "Macro name" that will adequately describe the macro and enter it in the "Edit a macro list entry". Enter the "Macro filename" or select the "Browse" button and find the macro file using the "Open" window. It's just that easy. Repeat the process for as many macros as you wish to have in the Macro List. It is now a simple matter of selecting the desired macro from the list and selecting the "Run Macro" button.

Figure3: Adding Macros to the Macro List

Figure 3: Adding Macros to the Macro List

Selecting the "E" button will open the "Cypress Enable Script Editor" and allow you to open an existing macro for editing or create a new macro. Selecting the "Edit Macro" button will open the currently displayed macro in the Macro List in the "Cypress Enable Script Editor". Figure 4 shows how to start the editor and select a file to be viewed and edited.

Figure 4: Opening a Macro in the Editor

Figure 4: Opening a Macro in the Editor

If you are interested in learning how to write macros studying ones that have already been written is an excellent way to learn. You can also modify existing macros to see what happens but remember to always save them under a different file name to keep the original available just in case. Figure 5 shows a typical macro file opened in the editor. It is always a good idea to open the macro file as there may be useful information provided by the author, particularly at the start of the macro.

Figure 5: Typical DeltaCad Macro

Figure 5: Typical DeltaCad Macro

As was mentioned earlier, there are a number of diallists who have written DeltaCad Macros for a variety of sundials. The following is an introduction to a number of these macros and  how you can use them to get you started on the fun trip to making your own sundial. The descriptions are general and do not go into the details of using the DeltaCad drawing functions to modify the macro generated drawing. You can find instruction sets in the Computer Aided Dialling (CAD) page that have quite a bit of information on using DeltaCad to get you started in dialling.

Some of the macros presented generate a sundial automatically with no inputs from the user. Others require user input to define specific parameters required to generate a site specific sundial. These inputs  will be discussed. Occasionally an error message may appear when the macro is running. In some cases if the option is selected to ignore this message the macro will still run to completion and generate a sundial. 


Ron Anthony

Fer de Vries

Valentin Hristov

Robert Hough

Steve Lelievre

Peter Mayer

Simon Wheaton-Smith

There are a total of 70 sundial and dialling related macros available created by the diallists listed above.