Assignment Keywords
The following keyword descriptions include a brief description of the keyword function, the types of elements the keyword affects (if applicable), the valid data type(s) (if applicable), and an example of how to use the keyword. The section following the assignment keywords describes how to specify color in an assignment statement.
area_fill
For plotters that support polygon fill, the area_fill keyword plots closed elements as filled when set to true. Setting the assignment keywords fill_color or pattern implies setting area_fill to true. The area_fill keyword can be used to plot elements that would otherwise plot filled as outlines. Any closed element (except text) can be controlled with this keyword including closed b-spline curves, complex shapes, ellipses, and shapes.
Syntax:
area_fill = true area_fill = false
Example:
! ! Area fill all shapes. ! if (type == shape) then area_fill = true endif
boundary_color
The boundary_color keyword is used to specify the boundary color of an area or pattern-filled polygon. Boundary_color only affects filled elements with boundary_display set to true. For a detailed description on specifying color, see "Specifying Color in Assignment Statements" at the end of this section.
Syntax:
boundary_color = integer
(where integer is a color index in the range from 0 to 255)
boundary_color = "string"
(where string is a name from a color library)
boundary_color = (R,G,B)
(where RGB is in the range of 0 to 255)
Example:
! ! Set boundary_color and boundary_display for ! shapes on level 7. ! if ((type == shape) and (level == 7)) then area_fill = true color = 'blue' boundary_display = true boundary_color = 'red' endif
boundary_display
For elements that are filled in the design file or with the area_fill keyword in the design script, the boundary_display keyword specifies whether the boundary of a filled polygon is plotted. The boundary_display keyword has no effect on elements that are not filled.
Syntax:
boundary_display = true boundary_display = false
Example:
! ! Set boundary_color and boundary_display for ! shapes on level 7. ! if ((type == shape) and (level == 7)) then area_fill = true color = 'blue' boundary_display = true boundary_color = 'red' endif
case_sensitive
The case_sensitive keyword determines whether the case of letters is important in string comparisons made using the characters comparison keyword. The default value is false.
Syntax:
case_sensitive = true case_sensitive = false
Example:
! !Replace text elements having !characters "TITLE" with all-caps, and !replace "Title" with first letter caps title. ! case_sensitive = true if (characters == "TITLE") then characters = "FIRST FLOOR DESIGN" else if (characters == "Title") then characters = "First Floor Design" endif
characters
The characters keyword lets you replace a string in a text element with a new string. By putting text elements in your design file to act as place holders, you can later substitute these strings with useful information such as the date the file was plotted or the design file name. If the new string is shorter than the original string, it is padded with blanks. If the new string is longer, the original string expands to accommodate the extra characters.
The replacement text can be the value of several tokens:
- A literal text string
- Print definition keywords shown in the table below
- The value of one or more environment variables in conjunction with literal text
- The <expr?name=...> token to reference a named expression
- The envr_value keyword
The following keywords represent values from the print definition which can used to label a plot.
Keyword |
Value |
---|---|
am_pm |
Time of day: am or pm. (Example: AM) |
date |
Date the print processing occurs for a preview or print. (Example: 05-APR-1996) |
day_abbreviation |
Three-character abbreviation of day. (Example: Fri) |
day_name |
Full name of day. (Example: Friday) |
day_number |
Day in numeric format. (Example: 05) |
dgnspec |
File specification of the master design file. (Example: C:\MYPROJ\E1.DGN) |
hour |
Hour the print processing occurs for a preview or print. (Example: 11) |
hour_12 |
Hour number based on a 12 hour cycle. (Example: 05) |
hour_24 |
Hour number based on a 24 hour cycle. (Example: 17) |
ip_color_table |
The color table string stored in the design file. (Example: C:\MISC\COLOR.CTB) |
ip_design |
Design filename. (Example: C:\MYPROJ\PLAN.DGN) |
ip_design_script |
The name of the design script associated with the plot job. Returns blank if the file is a feature table. |
ip_feature_table |
The name of the feature table associated with the plot job. Returns blank if the file is a design script. |
ip_logical_name |
The reference logical name for the current element. (Example: C:\PROJ\BORDER.DGN) |
ip_mirror |
Mirror settings stored in the print definition. Valid values are X, Y, BOTH, or NONE. |
ip_model |
The model specified in the print definition. (Example: sheetone) |
ip_origin |
X and Y origin in the units specified by the ip_units keyword. (Example: 1.500000,2.000000) |
ip_origin_x |
X origin in the units specified by ip_units. (Example: 1.500000) |
ip_origin_y |
Y origin in the units specified by ip_units. (Example: 5.000000) |
ip_pen_table |
Name of the design script associated with the plot job. |
ip_plot_rescale |
X and Y plot rescale values from the print definition. (Example: 3.000000,2.000000) |
ip_plot_rescale_x |
X plot rescale value from the print definition. (Example: 3.000000) |
ip_plot_rescale_y |
Y plot rescale value from the print definition. (Example: 2.000000) |
ip_project |
The project specified in the print definition. (Example: Baldwinsville) |
ip_queue |
Returns the name of the Windows system printer, if defined, otherwise it returns an empty string. |
ip_ref_filename |
Full reference file specification for the current element.. (Example: C:\PROJ\FLOOR.DGN) |
ip_rotation |
The rotation of the plot specified as an angle in degrees in the range from 0 to 360. (Example: 45.000000) |
ip_scale |
The plot scale in the format specified by MS_PLT_SCALE_METHOD. Also returns the same value as the MS_PLTSCALE_SHORT accounting variable. (Example: 4.000000:1.000000) |
ip_short_color_table |
Color table name without the directory. (Example: COLORS.TBL) |
ip_short_design |
Master file name without the directory name. (Example: FLOOR27.DGN) |
ip_short_design_script |
Design Script name without the directory. (Example: STANDARD.PEN) |
ip_short_pen_table |
Design Script name without the directory. (Example: STANDARD.PEN) |
ip_short_feature_table |
Feature table name without the directory. (Example: DECATUR.FTB) |
ip_short_ref_filename |
Reference filename without the folder for the current element. (Example: FLOOR.DGN) |
ip_short_scale |
Returns the same value as ip_scale. |
ip_units |
Units specified for values such as size and origin. (Example: inches) |
ip_view |
Either the view name or number. (Example: 2) |
ip_viewgroup |
The current view group. (Example: sheetone Views) |
ip_workspace |
The name of the active WorkSpace, i.e. Example. |
ip_workset |
The name of the active WorkSet, i.e. Civil. |
ip_xsize |
X size of the plot in units specified by ip_units. (Example: 34.000000) |
ip_xysize |
X and Y size of the plot in the units specified by ip_units. (Example: 34.000000, 44.000000) |
ip_ysize |
Y size of the plot in the units specified by ip_units. (Example: 75.000000) |
long_date |
Date in long character format. (Example: Friday, April 05, 1996) |
long_time |
Time the print processing occurs for a preview or print in long time format. (Example: 11:59:17 PM) |
minute |
Minute the print processing occurs for a preview or print. (Example: 59) |
month_abbreviation |
Three-character abbreviation of month. (Example: Apr) |
month_name |
Full name of month. (Example: April) |
month_number |
Number of month. (Example: 04) |
ms_pen_table |
Name of the pen table associated with the plot job. If no pen table is defined, an empty string is returned. (Example: C:\PROJ\E5.TBL) |
ms_pltcfg_file |
The file specification for the Printer Driver Configuration file. (Example: ..\Default\pltcfg\pdf.pltcfg ). |
ms_short_pltcfg_file |
Printer Driver Configuration file without the directory. (Example: PDF.PLTCFG) |
ms_short_pen_table |
Pen table name without the directory. (Example: DECATUR.TBL) |
page_number |
Sequence number of the print definition in the print set while in Print Organizer. (Example: 1) If you are using Variable print definitions, see Guidelines for Using Page Numbering and Total Page Tokens With Variable Print Definitions. Sequence number of the plot in the document. |
plan_set_name |
The file specification for the print set name. (Example: C:\plans\myplan.pset) |
plan_set_short_name |
The print set name without the folder name. (Example: myplan.pset) |
plot_name |
The print definition name inside the Print dialog or Print Organizer. (Example: border) The name of the plot name. |
second |
Second number. (Example: 17) |
short_date |
Date in numeric format. (Example: 04/05/96) |
short_time |
Time in short time format. (Example: 11:59) |
short_year |
Year in two digit format. (Example: 96) |
sytime |
System date and time the print processing occurs for a preview or print. (Example: 5-APR-1996 09:47) |
time |
Time the print processing occurs for a preview or print. (Example: 09:47) |
total_pages |
Total number of print definitions in the print set. (Example: 5) If you are using Variable print definitions, see Guidelines for Using Page Numbering and Total Page Tokens With Variable Print Definitions. Total number of plots in the document. |
username |
Username of user who submitted the preview or print. (Example: jdoe) |
year |
Year the print processing occurs for a preview or print in four digit format. (Example: 1996) |
Syntax:
characters = "string"
(where string is any valid string or a keyword described in the previous table)
Example 1:
! ! Change "preliminary" to "final" for text on ! level 10. ! if (characters eq "preliminary" and type==text and level==10) then characters = "final" endif
Example 2:
! Replace the text string "PAGE" with ! a new string that contains the actual ! page number and total sheets in the set. if (characters == "PAGE") then characters = PAGE_NUMBER + "of" + TOTAL_PAGES endif
Example 3:
! ! Replace the string "Project Number" with ! the actual project number stored in ! the PROJECT_NUM environment variable. ! if (characters == "Project Number") then envr_variable = "PROJECT_NUM" characters = envr_value endif
Example 4:
! Substitute the queue name from the print definition for ! the text string "$$queue$$." ! if ((type == text) and (characters == '$$queue$$')) then characters = ip_queue endif
Example 5:
! Substitute the Windows Username for the ! text string "$USER$" and include a literal ! text sting in the replacement string. if ((type == text) and (characters == "$USER$")) then characters = "User:$(USERNAME)" endif
Example 6:
! Substitute the value of the Named Expression ! _Author for the text string $AUTHOR$. if ((type == text) and (characters == "$AUTHOR$")) then characters = "<expr?name=_Author>" endif
class
The class keyword changes the class of an element. The element will not plot if the new class has been disabled in the print definition or by the equivalent OpenPlant Support Engineering display flag.
Syntax:
class = integer
(where integer is in the range from 0 to 6)
class = constant
where constant is one of the following:
0 primary |
1 pattern_component |
2 construction |
3 dimension |
4 primary_rule |
5 linear_pattern |
6 construction_rule |
Example:
! ! Change construction class elements on level 5 ! to primary class elements. if ((class == construction) and (level == 5)) then class = primary endif
cls_end_width
The cls_end_width keyword sets the ending width, in master design file units, of the custom line style associated with the current element. When the same value is specified for both cls_origin_width and cls_end_width, the width of the line style's "dash strokes" narrow or widen uniformly. When different values are specified for these two keywords, the dash strokes taper from the start to the end of the element.
Width is an optional property of each dash stroke in a custom line style. This keyword has no effect on line style dash strokes that do not have width as a property.
Syntax:
cls_end_width = real number
Example:
! ! Change the width of the wide strokes in ! the "{ Wide Dash }" line style to 2 master ! design units. ! if (cls_name == '{ Wide Dash }') then cls_origin_width = 2.0 cls_end_width = 2.0 endif
cls_name
The cls_name keyword assigns a custom line style to the current element. The line style resource file used on the plot server must contain the line style.
Syntax:
cls_name = string
Example:
! ! Assign the "{ Diamond }" custom line ! style to all elements using line code 3. ! if (style == 3) then cls_name = '{ Diamond }' endif
cls_origin_width
The cls_origin_width keyword sets the starting width, in master design file units, of the custom line style associated with the current element. When the same value is specified for both cls_origin_width and cls_end_width, the width of the line style's "dash strokes" narrow or widen uniformly. When different values are specified for these two keywords, the dash strokes taper from the start to the end of the element.
Width is an optional property of each dash stroke in a custom line style. This keyword has no effect on line style dash strokes that do not have width as a property.
Syntax:
cls_origin_width = real number
Example:
! ! Change the width of the wide strokes ! in the "{ Wide Dash }" line style to 2 master ! design units. ! if (cls_name == '{ Wide Dash }') then cls_origin_width = 2.0 cls_end_width = 2.0 endif
cls_scale
The cls_scale keyword scales the custom line style associated with the current element.
Syntax:
cls_scale = real number
Example:
! ! Scale all linestyles by 1/2. ! if (cls_name .ne. 'none') then cls_scale = 0.5 endif
cls_shift_distance
The cls_shift_distance keyword shifts the custom line style associated with the current element. The shift distance is specified in master design file units.
Syntax:
cls_shift_distance = real number
Example:
! ! Shift the linestyle origin by 1 master ! design unit. ! if (cls_name == '{Batten}') then cls_shift_distance = 1.0 endif
cls_shift_fraction
The cls_shift_fraction keyword shifts the custom line style associated with the current element.
Syntax:
cls_shift_fraction = real number
Example:
! ! Shift the custom linestyle by 1/2 of the ! pattern length. ! if (cls_name .ne. 'none') then cls_shift_fraction = 0.5 endif
color
The color keyword changes the current element's color for nonfilled elements. Assigning a value to color also changes the boundary color, fill color, and pattern foreground color for closed polygons if these values have not been specifically set with the boundary_color, fill_color, and pattern_color keywords. For a detailed description on specifying color, see "Specifying Color in Assignment Statements" at the end of this section.
Note: If a named color or RGB color is used, the color that is used for the color comparison keyword will not be changed.
Syntax:
color = integer
(where integer is a color index in the range from 0 to 255)
color = "string"
(where string is a color name from a color library)
color = (R,G,B)
(where RGB is in the range of 0 to 255)
Example:
! ! Change color of lines, strings, and curves using ! the various methods for defining color. ! if (type eq line) then color = 1 ! Set the color to be index value 1. else if (type == line_string) then color = 'blue' ! Set the color to blue. else if (type == curve) then color = (0,0,255) ! Set the color to RGB value 0,0,255. endif
endcap
The endcap keyword controls the display of end points of nonclosed elements. Endcap has the following display options:
Syntax:
endcap = endcap_type
(where endcap_type is butt, extend, circle)
Example:
! ! Specify the endcap type based on the element ! type. ! if (type == line) then endcap = butt else if (type == line_string) then endcap = extend else if (type == arc) then endcap = circle endif
envr_value
The envr_value assignment keyword sets the current envr_variable to the specified string. This envr_variable = value pair is then written to the accounting file and can also be used as attribute data in a digital archive.
Syntax:
envr_value=string
Example 1:
! !This design script sets a plot sheet attribute !based on the characters stored in text elements !in the design file. The criteria to determine which !text contains the appropriate characters is !based on MicroSation tags. tag_set='dpr' tag_name='sheet' if ((type eq text) and (tag_character eq 'drawingno'))then envr_variable = "Drawingno" envr_value = characters else if ((type eq text) and (tag_character eq 'title')) then envr_variable = "Title" envr_value = characters else if ((type eq text) and (tag_character eq 'sheetno')) then envr_variable = "Sheetno" envr_value = characters endif
Example 2:
! !This design script sets a plot sheet attribute !based on the characters stored in text elements !in the design file. The criteria to determine which !text contains the appropriate characters is !based on level. if ((type eq text) and (level eq 2)) then envr_variable = "Account" envr_value = characters else if ((type eq text) and (level eq 4)) then envr_variable = "Project" envr_value = characters else if ((type eq text) and (level eq 6)) then envr_variable = "Revision" envr_value = characters endif
envr_value_num
You can set the value of envr_variable to a real number using the envr_value_num keyword. Envr_value and envr_value_num are interchangeable within the same design script. For example, if you set envr_value to the string value of "4", envr_value_num is automatically set to the real number 4. This enables you to extract a string from a design file (for example a page number), convert it to a real number so you can increment the value by 1, and then display it back as a string. The example design script that follows demonstrates this procedure.
The envr_variable = value pair is also written to the accounting file and can also be used as attribute data in a digital archive.
Syntax:
envr_value_num = real
(where real is any real number)
Example:
! This following design script increments the ! page number in the title block by 1. The page number ! is a text string on level 5. ! envr_variable = "pagenum" if ((type eq text) and (level eq 5)) then envr_value = characters envr_value_num = envr_value_num + 1 characters = envr_value endif
envr_variable
The envr_variable assignment keyword selects the print definition environment variable you want to use in the design script. The Comparison keywords envr_value and envr_value_num can be used to check the value of the variable.
Note: Environment variable names must start with a letter, may contain only letters, numbers, and underscores, and may not contain blanks.
Syntax:
envr_variable = string
Example:
! !If SKIP_TEXT is defined (as anything, e.g. !"iplot mod MY_IPARM -environment = [SKIP_TEXT=1]") !in the IPARM environment, ignore text and !text_node elements. ! envr_variable = "SKIP_TEXT" if (envr_value <> "") then if (type .IN. text, text_node) then ignore = true endif endif
fill_color
The fill_color keyword sets the fill color for area filled polygons. It also specifies the background color for patterned elements. Using this keyword automatically enables area_fill. The default fill color for an element is its element color. The pattern background is transparent by default. For a detailed description on specifying color, see "Specifying Color in Assignment Statements" at the end of this section.
Syntax:
fill_color = integer
(where integer is a color index in the range from 0 to 255)
fill_color = "string"
(where string is a color name from a color library)
fill_color = (R,G,B)
(where RGB is in the range of 0 to 255)
Example:
! ! Define fill color for shapes, complex shapes, ! and ellipses. ! if (type == shape) then fill_color = 5 else if (type == complex_shape) then fill_color = 'blue' else if (type == ellipse) then fill_color = (0,0,255) endif
font
The font keyword sets the font number for text elements.
Syntax:
font = integer
(where integer is in the range from 0 to 255)
Example:
! ! Change font for certain text strings. ! if ((type == text) and (font == 1)) then font = 2 else if ((type == text) and (font == 3)) then font = 7 endif
font_name
The font_name keyword sets the font name for text elements.
Syntax:
font_name = string
(where string is the font name in the symbology resource file.)
Example:
! ! Change font name for certain text strings. ! if ((type == text) and (font == 1)) then font_name = "Architectural" else if ((type == text) and (font == 3)) then font_name = "FONT060" endif
ignore_element
The ignore_element keyword determines if the element is plotted. If this keyword is set to true, the current element is not plotted.
Syntax:
ignore_element = true ignore_element = false
Example:
! ! Do not plot text elements on level 63. ! if ((type == text) and (level == 63)) then ignore_element = true endif
midline_joint
The midline_joint keyword controls the display of joints for both unfilled and filled elements. If the boundary_display is disabled for a filled element, setting the midline_joint keyword has no effect. The following list describes the options for this keyword:
miter |
the corresponding edges of two segments extend to their point of intersection (the default). |
bevel |
similar to miter except the segments are finished with butt end caps. |
butt |
the end of each segment displays with a rectangular joint. |
extend |
similar to butt except that each segment is extended by one-half its width. |
circle |
displays a semicircle at the end of each segment. |
Syntax:
midline_joint = midline_joint_type
(where midline_joint_type is butt, bevel, extend, circle, or miter)
Example:
! ! Set the midline_joint based on the reference ! file attachment number. ! if (file == 0) then ! Test for elements in the master file. midline_joint = butt else if (file == 1) then ! Test for elements in the first reference file. midline_joint = extend else if(file == 2)then ! Test for elements in the second reference file. midline_joint = circle else if(file == 3)then ! Test for elements in the third reference file. midline_joint = miter endif
pen
The pen keyword selects the pen on a pen plotter. Setting this keyword is equivalent to setting the color of the current element, except that the pen number equals the color number plus 1.
Syntax:
pen = integer
(where integer is in the range from 1 to 256)
Example:
! ! Set pen number based on element's level. if (level == 1) then pen = 1 else if (level == 2) then pen = 2 else if (level == 3) then pen = 3 endif
pen_width_nn
(Where nn is a value from 0 to 31)
The pen_width_nn keywords assign print line widths (physical thickness) in design script units to the 32 standard product weights. These design script assignment keywords override the weight-to-width maps defined in the printer driver configuration (.pltcfg) file, and are equivalent to the weight-to-width maps that may be defined in a pen table. These keywords behave in a similar manner as the weight_base / weight_delta keywords, but the pen_width_nn keywords allow each weight to be assigned independently.
! ! Specify the weight-to-width maps based on paper size. ! units = mm if (first_time) then if (ip_xsize_num > 17) then pen_width_00 = 0.169 pen_width_01 = 0.375 pen_width_02 = 0.5 pen_width_03 = 0.625 pen_width_04 = 0.75 pen_width_05 = 0.875 pen_width_06 = 1 pen_width_07 = 1.125 pen_width_08 = 1.25 pen_width_09 = 1.375 pen_width_10 = 1.5 pen_width_11 = 1.625 pen_width_12 = 1.75 pen_width_13 = 1.875 pen_width_14 = 2 pen_width_15 = 2.125 pen_width_16 = 2.25 pen_width_17 = 2.375 pen_width_18 = 2.5 pen_width_19 = 2.625 pen_width_20 = 2.75 pen_width_21 = 2.875 pen_width_22 = 3 pen_width_23 = 3.125 pen_width_24 = 3.25 pen_width_25 = 3.375 pen_width_26 = 3.5 pen_width_27 = 3.625 pen_width_28 = 3.75 pen_width_29 = 3.875 pen_width_30 = 4 pen_width_31 = 4.125 else pen_width_00 = 0.12675 pen_width_01 = 0.28125 pen_width_02 = 0.375 pen_width_03 = 0.46875 pen_width_04 = 0.5625 pen_width_05 = 0.65625 pen_width_06 = 0.75 pen_width_07 = 0.84375 pen_width_08 = 0.9375 pen_width_09 = 1.03125 pen_width_10 = 1.125 pen_width_11 = 1.21875 pen_width_12 = 1.3125 pen_width_13 = 1.40625 pen_width_14 = 1.5 pen_width_15 = 1.59375 pen_width_16 = 1.6875 pen_width_17 = 1.78125 pen_width_18 = 1.875 pen_width_19 = 1.96875 pen_width_20 = 2.0625 pen_width_21 = 2.15625 pen_width_22 = 2.25 pen_width_23 = 2.34375 pen_width_24 = 2.4375 pen_width_25 = 2.53125 pen_width_26 = 2.625 pen_width_27 = 2.71875 pen_width_28 = 2.8125 pen_width_29 = 2.90625 pen_width_30 = 3 pen_width_31 = 3.09375 endif endif
priority
The priority keyword modifies the order in which elements are plotted. By default, elements are plotted in the order they appear in the design file. Using the priority keyword, low priority elements are plotted before higher priority elements so that higher priority elements are plotted on top of lower priority elements. This can be useful when plotting area-filled elements. For example, if you want a text string to plot inside a filled polygon, the text must have a higher priority than the polygon so that the text is not covered. The default priority for an element is 0.
It is important to note that elements without priority are printed first, and then elements with priority are printed next, based on their priority; therefore, pen tables with negative priority to "push elements under" may require alteration.
Note: The priority keyword is not valid for filled elements plotting to a vector device. The priority keyword overrides the order implied by display update sequences.
Syntax:
priority = integer
(where integer is in the range from -1,000,000 to 1,000,000)
Example:
! ! Set priority of elements based on their color. if (type == shape) then area_fill = true if (color == 1) then priority = 10 else if (type == text) then !Plot text on top of the shapes. priority = 20 endif endif
scale
The scale keyword specifies a scale factor that is applied to elements that have a local origin, such as cells (normal and shared), arcs, ellipses, text, and text nodes. Text and text nodes are scaled about their justification point. The default scale is 1.0.
Syntax:
scale = real
(where real is any positive real number)
Example:
! ! Scale text by a factor of 1.5. ! if (type == text) then scale = 1.5 endif
screen_relative
The screen_relative keyword is used to modify the screen_relative bit in the current element's properties word. OpenPlant Support Engineering refers to screen relative as "view independent."
Syntax:
screen_relative = true screen_relative = false
Example:
! ! If element is a cell named 'LOGO', set the screen ! relative bit in the properties word. ! if ((type == cell) and (cellname == 'LOGO')) then screen_relative = true endif
screening
Screening lets you specify that a color is "washed out" towards white in the printed output. While a 100% screening means print the color as-is, a 50% screen, for example, moves a color halfway to white. This keyword can be used to save ink, or to de-emphasize elements plotted in that color.
Syntax:
screening = integer
(where integer is in the range from 1 to 99)
Example:
! ! If element is an ellipse, set a 50% screening. if (type == ellipse) then screening = 50 endif
size
The size keyword is used to modify the size of text and text node elements.
Syntax:
size = working units
Example:
! ! Set text size for text elements on level 1. ! if ((type == text) and (level == 1)) then size = 0:0:250 endif
style
The style keyword modifies the line style of the current element. Specify a new style by assigning the element an index in the range from 0 to 7, which corresponds to one of the predefined OpenPlant Support Engineering style types. A user-defined line style can be used by specifying the name of a line style from a line style library or by specifying a series of on and off transitions. Setting the style has no effect on area-filled or pattern-filled elements if the boundary display is not enabled. By default, the boundary display is disabled.
Note: If you use a named style or style definition, the line style used with the style comparison keyword does not change.
Syntax:
style = integer
(where integer is a line style index in the range of 0 to 7)
style = "string"
(where string is a line style name in a line style library named "DesignScriptStyles.slb" delivered in the folder defined by MS_DATA)
style = line style definition
(on, off, on, off...)
Example:
! ! Set the element's style based on its color using ! the various methods for defining a line style. ! units = mm switch (color) case 1 ? style = 3 case 2 ? style = 'dash-dot' case 3 ? style = (0.5, 0.3, 0.75, 0.3) endswitch
style_n
(Where n is a number value from 1 to 7)
The style_n keywords modify the pen up / pen down pattern definitions for the seven standard line styles. These design script assignment keywords override the line style patterns defined in the printer driver configuration (.pltcfg) file. The pattern can be specified using either the name of a line style defined in the line style library or by specifying a series of on and off transitions. This syntax is the same as the style assignment keyword.
Syntax:
style_<number> = "string"
(where number is a value from 1 to 7, and string is a line style name in the DesignScriptStyles.slb line style library delivered in the folder defined by MS_DATA)
style_<number> = line style definition
(where number is a value from 1 to 7, and line style definition is an on, off, on, off, etc. pattern using design script units)
For simple elements such as lines and shapes, the style and style_n keywords produce the same results. The style keyword may be used to assign a different pattern on a per-element basis. However, when applied to a compound element with multiple line styles, such as a dimension or multiline element, the style assignment changes the style of every line inside the element. The style_n assignments can be used to specify the pattern of the seven standard line styles without disturbing the style numbers within compound elements.
Example:
! ! Specify the pattern for the seven standard line styles based on paper size. ! units = inches if (first_time) then if (ip_xsize_num > 17) then style_1 = (0.03, 0.03) style_2 = (0.062, 0.062) style_3 = (0.125, 0.062) style_4 = (0.125, 0.062, 0.03, 0.062) style_5 = (0.045, 0.045) style_6 = (0.125, 0.062, 0.03, 0.062, 0.03, 0.062) style_7 = (0.0125, 0.045, 0.062, 0.045) else style_1 = (0.0225, 0.0225) style_2 = (0.0465, 0.0465) style_3 = (0.09375, 0.0465) style_4 = (0.09375, 0.0465, 0.0225, 0.0465) style_5 = (0.03375, 0.03375) style_6 = (0.09375, 0.0465, 0.0225, 0.03375, 0.0225, 0.03375) style_7 = (0.009375, 0.03375, 0.0465, 0.03375) endif endif
tags
The TAG_SET and TAG_NAME assignment keywords are used to specify tag set and tag name for later use by one of the comparison keywords.
Data Types:
Example:
! ! Assuming the design file uses two tag sets, ! "Home address" and "Work address," each ! containing a character tag named "City," ! change the color of all elements whose tags ! specify a home address of "Huntsville" or a ! work address of "Madison." ! ! Start by looking for "City" tags belonging to ! the "Home address" tag set. ! tag_set = 'Home address' tag_name = 'City' if (tag_char == 'Huntsville') then color = 4 endif ! Now look for tags in the "Work address" ! tag set. Note that the tag name is still "City". tag_set = 'Work address' if (tag_char == 'Madison') then color = 4 endif
thickness
The thickness keyword enables you to specify the line width in physical units instead of a line weight. The units value stored in the print definition is the default for the thickness keyword, but can be modified within the design script with the units keyword. Specifying a thickness does not change the weight used by the weight comparison keyword.
Syntax:
thickness = positive real number
Example:
! ! Set line thickness based on the element's color. ! units = inches switch (color) case 1 - 5 ? thickness = 0.125 case 6 - 10 ? thickness = 0.075 default ? thickness = 0.05 endswitch
translucent
If the translucent keyword is set to true, the current element is plotted such that any elements beneath it are not completely hidden. The default value for this keyword is false. The translucent keyword only affects non-filled elements and boundaries of filled elements if the boundaries are on. The translucent keyword is not valid for vector devices or devices driven with Microsoft printer drivers.
Note: The translucent keyword performs like the new transparency keyword with a value of 50. The translucent keyword affects both filled and non-filled elements and boundaries of filled elements if the boundaries are on. For more information, see the transparency keyword.
Syntax:
translucent = true translucent = false
Example:
! ! Plot elements on level 10 with heavily weighted ! red lines and allow elements underneath to ! show through. ! if (level == 10) then color = "red" weight = 10 translucent = true endif
translucent_fill
If set to true, the translucent_fill keyword specifies that the fill color for area-filled and pattern-filled elements is translucent. Both the foreground and background colors for pattern_filled elements are translucent. Elements beneath a translucent_filled element are still visible. The default value for this keyword is false. The translucent_fill keyword is not valid with vector devices or devices driven with Microsoft printer drivers.
Note: The translucent_fill keyword performs like the new transparency keyword with a value of 50. The translucent_fill keyword affects non-filled, area-filled, and pattern-filled elements and boundaries of filled elements if the boundaries are on. For more information, see the transparency keyword.
Syntax:
translucent_fill = true translucent_fill = false
Example:
! ! Set fill color to be translucent. ! area_fill = true translucent_fill = true fill_color = (255,0,0)
transparency
The transparency assignment keyword enables you to set transparency for the current element. You can set the value for transparency from 1 to 100. The higher the value the more transparent the element.
Syntax:
transparency = value
(where value is 1–100)
Example:
! ! Set transparency for lines on level 2. ! if ((level eq 2) and (type eq line)) then transparency = 50 endif
units
The units keyword is used to specify the dimension for keywords such as thickness and line styles. Always set the units keyword at the beginning of the design script and only set it once within a design script. The default value for the keyword is the units value from the print definition.
Syntax:
units = units_constant
(where units_constant is one of the following:
Example:
! ! Set line thickness to 0.5 millimeters. ! units = mm thickness = 0.5
weight
The weight keyword modifies the line weight of the current element. For filled elements, boundary_display must be enabled for this keyword to affect the element boundary.
Syntax:
weight = integer
(where integer is in the range from 0 to 31)
Example:
! ! Set line weight based on element's color. ! switch (color) case 1-10 ? weight = 2 case 11-20 ? weight = 1 default ? weight = 0 endswitch
weight_base/weight_delta
The weight_base and weight_delta keywords map line weights to physical thicknesses on the plot. Using these keywords, you can get consistent line thicknesses across various plotters. The weight_base keyword specifies the line thickness for an element of weight 0. The weight_delta keyword specifies an additional line thickness increment to add for each line weight above 0. Use the following formula to calculate line thickness using the weight_base and weight_delta keywords:
plot thickness = weight_base + (element weight * weight_delta)
For example, if the weight_base is 0.1 cm and weight_delta is 0.05 cm, the following values are used.
Note: You must define the weight_base and weight_delta keywords at the beginning of the design script.
Syntax:
weight_base = positive_real weight_delta = positive_real
Example:
! ! Map element's line weight to a thickness on ! the plot. ! weight 0 = 0.10 mm ! weight 1 = 0.15 mm ! weight 2 = 0.20 mm ! weight 3 = 0.25 mm ! . ! . ! . ! weight 31 = 1.65 mm units = mm weight_base = 0.1 weight_delta = 0.05