The Calcpad template uses scripting commands that are similar to the Padds macro language. In essence, the script is a series of two-letter commands similar to the keyboard shortcuts used in Padds.
Script commands are available to draw lines, write text and define special items. All commands use parameters, i.e. values, to define certain entities. Parameters are separated with spaces or commas. Several new commands have been introduced to for special effects like setting margins.
The template script commands can be categorised as follows:
Page Layout | ||
---|---|---|
XO meas YO meas |
: | Define the origin, or reference point, from where all entities are measured, e.g. 'XO 5' and 'YO 7.5' . The position of the origin is measured from the bottom left corner of the page. In fact, if you do not enter an origin the bottom left corner of the page will be used. You may repeatedly redefine the origin – the last definition is used for subsequent lines in the script. |
MA ml,mb,mr,mt | : | Set the left, bottom, right and top margins in millimetres, e.g. 'MA 15,15,285,195'. The margins define the workspace in Calcpad and the values are measured from the origin rather than the edges of the page. The margin command does not draw any lines. |
RT meas | : | Right column tab stop, measured in millimetres from the origin, e.g. 'RT 170'. The design modules use the right column for code references and other comments. |
Graphics | ||
BM ml,mb,mr,mt,file | : | Insert a Bitmap image and stretch it between the coordinates Xleft,Ybot and Xright,Ytop , e.g. 'BM 5,261,34.6.5,2779.5,LOGO.BMP'. The Bitmap is assumed to reside in the same folder as the template file. For the best printing results, the bitmap should be sized so that it can be placed at true size, e.g. an image of 700 pixels wide by 300 pixels high, placed 29.6 mm wide by 12.7 mm high should print well at 600 dpi. |
Lines | ||
LT meas | : | Set the line thickness in millimetres, e.g. 'LT 0.25'. |
LL x1,y1,x2,y2 | Draw a line from the coordinate X1,Y1 to X2,Y2, e.g. 'LL 5,10,5,110' to draw a vertical line 100mm long. | |
Text | ||
TF font,style | Set the font and style, e.g.'TF Times New Roman, Normal' | |
TS size | Set the text height in points, e.g. 'TS 11' | |
TT x,y,text | Write text at the coordinate Xleft,Ybot , e.g. 'TT 5,10,Project No'. | |
Header Items | ||
HI xl,yb,xr,yt,desc | Insert a header item in the rectangle defined by the coordinates Xleft,Ybot and Xright,Ytop, e.g. 'HI 150,270,Designed by'. In Calcpad, the header item is later referenced by its description. See page 2-7 for details on entering header information. | |
Other | ||
// text | Comments can be written after two slashes, e.g. '//comment'. |
Below is an abstract from the Default template script:
XO 15 // X Origin YO 15 // Y Origin BM 1,260, 41,267 PROKON.BMP // Load Bitmap x1,y1,x2,y2 LT 0.3 // Line Thickness mm LL 0, 0,186, 0 // Line x1,y1,x2,y2 LL 0,248,186,248 LL 0,268,186,268 LL 0, 0, 0,268 . . . . . . . . . LL 166, 0,166,248 TF Arial Italic // Text Font TS 8 // Text Size Points TT 156.5,267.8, Sheet // Text x,y,text TT 42.5,267.8, Job Number TT 42.5,262.8, Job Title TT 42.5,257.8, Client TT 42.5,252.8, Calcs by TT 90.5,252.8, Checked by TT 138.5,252.8, Date TT 3,259 , Software Consultants Pty Ltd TT 3,255.5, Internet: http://www.prokon.com TT 3,252 , E-Mail : mail@prokon.com MA 1, 1, 185, 247 // Margins left, b, r, t RT 166.5 // Right column tab stop TS 10 // Text Size Points HI 165.0,267.2, First Sheet No // Header Item HI 60.0,267.2, Job Number // x,y,Description HI 55.0,262.2, Job Title HI 55.0,257.2, Client HI 55.0,252.2, Calcs by HI 106.0,252.2, Checked by HI 150.0,252.2, Date