Design Scripts are ASCII files that contain instructions for resymbolizing the printed output of design files. The instructions are contained in statements within the design script. Design scripts are created or modified using a text editor such as Notepad.
Design scripts contain two types of statements: comparison statements and assignment statements. Comparison statements test a single element attribute against a specified condition. If the attribute meets that condition, then assignment statements modify elements by changing the element's attributes.
The design script resymbolizes elements from the design file as they are processed by the printing system. For example, you can write a design script that checks the element to see if it is on a particular level and resymbolizes the element's display attributes if it is on the specified level.
If level symbology is enabled for the design or reference file you are plotting, the level symbology is applied before executing the design script. The design script overrides any other display attributes enabled for the file. For example, elements filled by the design script always plot filled, even if the area_fill display attribute is disabled.
The following design script examples demonstrate two techniques used in resymbolizing a design file: Text substitution and Screening. The first example demonstrates how to search for a specific text string element in a DGN file and replace it with another string. In example 1, the design file's name and the current date replace the text strings $DGNFILENAME$ and mmddyy, respectively.
! NAME ! txtsubst.pen ! ! DESCRIPTION ! Design Script to substitute the design filename and ! the current date for the strings ! $DGNFILENAME$ and mmddyy, respectively. ! ! If the current element is a text element, see if ! it contains one of the special place-holder ! strings. If it does, substitute an ! automatically-generated string for it. if (type == text) then if (characters == '$DGNFILENAME$') then characters = ip_design else if (characters == 'mmddyy') then characters = date endif endif
Example 2 demonstrates how to screen certain elements by plotting them in a light gray color. The following design script highlights the drawing sheet, text, and furniture on level 15 by screening all other elements.
! NAME ! screen.pen ! ! DESCRIPTION ! This design script demonstrates screening. ! ! Highlight all text, the sheet border (Level 1), ! and furniture (Level 15) by plotting it in pure ! black on top of all other elements. Screen ! (de-emphasize) all other elements by plotting ! them with a gray dither (halftone) pattern. ! if ((level .in. 1, 15) || (type == text)) then color = (0, 0, 0) ! R=0, G=0, B=0 is pure black priority = 100 else color = (200, 200, 200) ! R=200, G=200, B=200 is light gray weight = 4 priority = 10 endif