Title Box Symbol
You can create the title box symbol using either the 2D Symbol Editor or a text editor. Since the symbol editor currently does not support arguments, you can use it to sketch the title box's graphics and text, then manually edit the symbol to add arguments.
The program calls the 'text22()' function. However, since "text" is not a very descriptive name for a symbol, a name remapping has been applied to rename it as 'CAD_pd_title()' in the example setup. In practice, the 'text22' function directly calls 'CAD_pd_title' in the 'textxxx.asy' source file.
The 'text22' function must include the full set of arguments required for a text-type label, but 'CAD_pd_title' does not!
In the example project, the symbol 'CAD_pd_title' adjusts the placement of the argument output values on the sheet. The graphical elements, such as lines, the logo, and the header texts, are defined in the symbol 'Cadmatic_pd_titlebox', which is called from within 'CAD_pd_title'.
'Cadmatic_pd_titlebox' can be edited with 2D Symbol Editor, but 'CAD_pd_title' is a scripted symbol.
/* @(#)CAD_pd_title.asy 1.1 95/11/23 */
/* CADMATIC TITLE BOX FOR DIAGRAMS */
CAD_pd_title(STRING datastr, color)
{
/*
** check if the box is animated (color = 8)
*/
if( color == 8 ){
/* Draw only few lines and no texts for faster animation */
POLY(0,0,185,0,185,56,0,56,0,0);
POLY(0,21,50,21);
POLY(50,0,50,56);
POLY(50,14,185,14);
POLY(85,14,85,56);
POLY(103,0,103,14);
}
else{
/* Not animated, draw the real title box */
SET_CODED_WSTR_ARG(datastr);
DrawingNumber="";
Revision="";
DescriptionRow1="";
DescriptionRow2="";
DescriptionRow3="";
DescriptionRow4="";
DesignedBy="";
DesignDate="";
CheckedBy="";
CheckDate="";
ApprovedBy="";
ApprovalDate="";
RevisionId="";
SaveDate="";
SaveTime="";
DiagramStatus="";
GET_NEXT_WSTR_ARG( DrawingNumber );
GET_NEXT_WSTR_ARG( Revision );
GET_NEXT_WSTR_ARG(DescriptionRow1);
GET_NEXT_WSTR_ARG(DescriptionRow2);
GET_NEXT_WSTR_ARG(DescriptionRow3);
GET_NEXT_WSTR_ARG(DescriptionRow4);
GET_NEXT_WSTR_ARG(DesignedBy);
GET_NEXT_WSTR_ARG(DesignDate);
GET_NEXT_WSTR_ARG(CheckedBy);
GET_NEXT_WSTR_ARG(CheckDate);
GET_NEXT_WSTR_ARG(ApprovedBy);
GET_NEXT_WSTR_ARG(ApprovalDate);
GET_NEXT_WSTR_ARG(RevisionId);
GET_NEXT_WSTR_ARG(SaveDate);
GET_NEXT_WSTR_ARG(SaveTime);
GET_NEXT_WSTR_ARG(DiagramStatus);
/* Add titlebox symbol */
Cadmatic_pd_titlebox();
/* Fill in the text boxes */
PEN(1);
COLOR(2);
CENTER(7);
LINETYPE(1,1);
SIZE(5,3.9,1.1);
TEXT( 120, 4, DrawingNumber );
TEXT(177, 4, RevisionId );
TEXT(87,43, DescriptionRow1 );
TEXT(87,35, DescriptionRow2 );
TEXT(87,27, DescriptionRow3 );
TEXT(87,19, DescriptionRow4 );
PEN(2);
SIZE(2,1.6,0.5);
TEXT(16,16, DesignedBy );
TEXT(32,16, DesignDate );
TEXT(16,9, CheckedBy );
TEXT(32,9, CheckDate );
TEXT(16,2, ApprovedBy );
TEXT(32,2, ApprovalDate );
TEXT(65,2, SaveDate );
TEXT(85,2, SaveTime );
TEXT(65,9, DiagramStatus );
}
} /* END OF CADMATIC TITLE BOX FOR DIAGRAMS */