Generic Drawing Functions

These are functions that can be used within other drawing functions or stand alone in the higher level drawings. These functions don't necessarily return values.

Some of the symbol drawing operations do not have a sample drawing. This is because the operation of the drawing operation is obvious. Those that do have sample drawings, have a 140px × 140px drawing area. The dropdown menus are then reflected directly in the sample drawing area. This is so you can see the various drawing possibilities. The dropdown menu selections are also entered in an example at the bottom of each symbol, under "Usage:". Some of the symbols may seem very small. However, in order to work with other symbols, they need to be small in size.

Use the buttons that are displayed across each symbol header, to navigate to other symbols. To navigate between other symbol libraries, use the menu.


Drawing_Border
8
7
6
5
4
3
2
1
8
7
6
5
4
3
2
1
A
B
C
D
A
B
C
D
Sample schematic page with Border but no Zone Marks

Description: This function draws a border around the edges of the drawing. The boarder line is indented from the edges by 15 pixels. Within that border are zone markers. The horizontal markers are, from left to right, "8" to "1". The vertical markers are, from bottom to top, "A" to "D". The zone are generally used on multi-page drawings to designate the source and destination for signals common to each page.For example, if a signal input is annotated with "3B2" the signals source is located on Page 3, in Zone B2.

If you use the "Show Zones" option in the instantiation of the border, dashed lines will be drawn that delimits the vertical and horizontal zone markers. Try this simple dropdown menu to see how it appears on the sample drawing page.

Return: Returns the X and Y coordinates (Lib_S_Label_X, Lib_S_Label_Y) of the lower right corner of the boarder. You can call those variables anything you want but their intent is for positioning the Label. If you are not using a label, the return values can be ignored.

var Lib_S_Label_X, Lib_S_Label_Y; var Label_XY = new Array();
Label_XY = Drawing_Border( Lib_S_Dwg_Obj, "", Width, Height );
Lib_S_Label_X = Label_XY[0]; Lib_S_Label_Y = Label_XY[1];

Drawing_Label

Description: In this function, Lib_S_Label_X, Lib_S_Label_Y describe the bottom-right position for the drawing label. Those values can also be returned by the Drawing_Border function. If you are not using the Drawing_Border function, you will need to specify the Lib_S_Label_X, Lib_S_Label_Y.

The information for the Drawing_Label is an array of data (Lib_S_Label_Info) in a specific order. The order is: Manufacturer (Lib_S_Mfgr), Drawing Title (Lib_S_Title), Drawing Size (Lib_S_Size), Drawing Number (Lib_S_Doc_Num), Drawing Revision (Lib_S_Rev), Drawing Date (Lib_S_Date), Drawing Sheet Number (Lib_S_Sheet), and Total Number of Sheets (Lib_S_Pages). Below is an example of the array and the information.

Parameter Description
Lib_S_Dwg_Obj jsGraphics Object that points to the drawing.
Lib_S_Mfgr Manufacturer Name ("Electronic Rainbow Ind., Inc.", etc.) in quotes.
Use "" for no manufacturer.
Lib_S_Title Text label ("INDUCTANCE METER", etc.) in quotes. Use "" for no title.
Lib_S_Size Document Size ("A", "B", etc.) in quotes. Use "" for no size.
Lib_S_Doc_Num Document Number ("123-456-789", etc.) in quotes. Use "" for no number.
Lib_S_Rev Document Revision ("A", "B", etc.) in quotes. Use "" for no revision.
Lib_S_Date Document Date ("Aug 28, 2016", etc.) in quotes. Use "" for no date.
Lib_S_Sheet Document Sheet Number ("1", "2", etc.) in quotes. Use "" for no sheet number.
Lib_S_Pages Document Total Pages ("1", "2", etc.) in quotes. Use "" for no sheet reference.
Lib_S_Width Drawing Width, in Pixels.
Lib_S_Height Drawing Height, in Pixels
8
7
6
5
4
3
2
1
8
7
6
5
4
3
2
1
A
B
C
D
A
B
C
D
Electronic Rainbow Ind., Inc.
Title
INDUCTANCE METER
Size
B
Document Number
IA-1
Rev
Date:
March 11, 1992
Sheet 1 of 1
8
7
6
5
4
3
2
1
8
7
6
5
4
3
2
1
A
B
C
D
A
B
C
D
Drawing with Border and Label

Usage: The sample subroutine call is shown below. The sample first draws a Border and then uses the return values from the Border to position the Label. The values from the select boxes above modify the sample subroutine call directly to show how a call might be constructed. When placed in the proper drawing function, as shown at the top of this document, the Width and Height are extracted from the drawing instance (see the section on JavaScript Drawing Function). The name of the jsGraphics Object also comes from the JavaScript Drawing Function function.

var Lib_S_Label_X, Lib_S_Label_Y; var Label_XY = new Array();
Label_XY = Drawing_Border( Sch, "", Width, Height );
Lib_S_Label_X = Label_XY[0]; Lib_S_Label_Y = Label_XY[1];
Lib_S_Label_Info = [ "Electronic Rainbow Ind., Inc.", "INDUCTANCE METER", "B", "IA-1", "A", "March 11, 1992", "1", "1" ];
Drawing_Label( Sch, Lib_S_Label_Info, Lib_S_Label_X, Lib_S_Label_Y );

Short_Drawing_Label

Description: In this function, Lib_S_Label_X, Lib_S_Label_Y describe the bottom-right position for the drawing label. Those values can also be returned by the Drawing_Border function. If you are not using the Drawing_Border function, you will need to specify the Lib_S_Label_X, Lib_S_Label_Y.

The information for the Drawing_Label is an array of data (Lib_S_Label_Info) in a specific order. The order is: Manufacturer (Lib_S_Mfgr), Drawing Title (Lib_S_Title), Drawing Size (Lib_S_Size), Drawing Number (Lib_S_Doc_Num), Drawing Revision (Lib_S_Rev), Drawing Date (Lib_S_Date), Drawing Sheet Number (Lib_S_Sheet), and Total Number of Sheets (Lib_S_Pages). Below is an example of the array and the information.

Parameter Description
Lib_S_Dwg_Obj jsGraphics Object that points to the drawing.
Lib_S_Title Text label ("INDUCTANCE METER", etc.) in quotes. Use "" for no title.
Lib_S_Rev Document Revision ("A", "B", etc.) in quotes. Use "" for no revision.
Lib_S_Date Document Date ("Aug 28, 2016", etc.) in quotes. Use "" for no date.
Lib_S_Sheet Document Sheet Number ("1", "2", etc.) in quotes. Use "" for no sheet number.
Lib_S_Pages Document Total Pages ("1", "2", etc.) in quotes. Use "" for no sheet reference.
Lib_S_Width Drawing Width, in Pixels.
Lib_S_Height Drawing Height, in Pixels
8
7
6
5
4
3
2
1
8
7
6
5
4
3
2
1
A
B
C
D
A
B
C
D
Title
INDUCTANCE METER
Rev
A
Date:
March 11, 1992
Sheet 1 of 1
8
7
6
5
4
3
2
1
8
7
6
5
4
3
2
1
A
B
C
D
A
B
C
D
Drawing with Border and Short Label

Usage: The sample subroutine call is shown below. The sample first draws a Border and then uses the return values from the Border to position the Label. The values from the select boxes above modify the sample subroutine call directly to show how a call might be constructed. When placed in the proper drawing function, as shown at the top of this document, the Width and Height are extracted from the drawing instance (see the section on JavaScript Drawing Function). The name of the jsGraphics Object also comes from the JavaScript Drawing Function function.

var Lib_S_Label_X, Lib_S_Label_Y; var Label_XY = new Array();
Label_XY = Short_Drawing_Border( Sch, "", Width, Height );
Lib_S_Label_X = Label_XY[0]; Lib_S_Label_Y = Label_XY[1];
Lib_S_Label_Info = [ "", "", "", "", "", "", "", "" ];
Drawing_Label( Sch, Lib_S_Label_Info, Lib_S_Label_X, Lib_S_Label_Y );
Rotate_Arrow

Description: Draws a "Arrow" with the point starting at Lib_S_Center_X, Lib_S_Center_Y. The "arrow" is 10 px wide and 10 px deep. A rotation of 0 degrees produces a arrow pointing right.
Rotate_Arrow( Lib_S_Dwg_Obj, Lib_S_Rot, Lib_S_Fill, Lib_S_Color, Lib_S_Center_X, Lib_S_Center_Y ).

Parameter Description Example
Lib_S_Dwg_Obj Graphics Object that points to the drawing.
Lib_S_Rot Rotate arrow Lib_S_Rot degrees, counter clockwise. Select Rotation Angle:
0 | 45 | 90 | 135 | 180 | 225 | 270 | 315 ⇒
Lib_S_Fill Used with color Lib_S_Color. "Fill" || "NoFill" || NoBase ⇒
Lib_S_Color Color of drawn arrow or filled arrow. Select a color ⇒
Lib_S_Start_X Output Symbol Start X Position Show/Hide Grid (10x10) and Center Mark
Grid
On
Off
Center
On
Off
Lib_S_Start_Y Output Symbol Start Y Position
// Draw a arrow
Rotate_Arrow( Dwg_Obj, 0, "NoBase", "red", Start_X, Start_Y );

Dashed_Line

Description: Draws a "Dashed Line" with the point starting at Lib_S_Start_X, Lib_S_Start_Y.
Dashed_Line( Lib_S_Dwg_Obj, Lib_S_Ori, Lib_S_Dir, Lib_S_Len, Lib_S_Start_X, Lib_S_Start_Y );.

Parameter Description Example
Lib_S_Dwg_Obj Graphics Object that points to the drawing.
Lib_S_Ori Orientation "Vertical" || "Vert" || "Horizontal" || "Horiz"
Lib_S_Dir Direction of the line. "Vert": "Up" || "Dn", "Horiz": "Left" || "Right"
Lib_S_Len Length. No length limit exists. Define the length, in pixels ⇒
Lib_S_Start_X Output Symbol Start X Position Show/Hide Grid (10x10) and Center Mark
Grid
On
Off
Center
On
Off
Lib_S_Start_Y Output Symbol Start Y Position
// Draw a dashed line
Dashed_Line( Dwg_Obj, "Vertical", "Up", "20", Start_X, Start_Y );

Dashed_Box

Description: Draws a "Dashed Box" with the point starting at Lib_S_Start_X, Lib_S_Start_Y.
Dashed_Line( Lib_S_Dwg_Obj, Lib_S_Ori, Lib_S_Dir, Lib_S_Len, Lib_S_Start_X, Lib_S_Start_Y );.

Parameter Description Example
Lib_S_Dwg_Obj Graphics Object that points to the drawing.
Lib_S_Color Color of the dashed line. "Black" || "Green" || "Red" || "Blue"
Lib_S_Width Width Define the Width, in pixels ⇒
Lib_S_Height Height Define the Height, in pixels ⇒
Lib_S_Start_X Output Symbol Start X Position Show/Hide Grid (10x10) and Center Mark
Grid
On
Off
Center
On
Off
Lib_S_Start_Y Output Symbol Start Y Position
// Draw a dashed box
Dashed_Box( Dwg_Obj, new jsColor("black"), "60", "60", Start_X, Start_Y );

Parenthesis

Description:

Parameter Description Example
Lib_S_Dwg_Obj Graphics Object that points to the drawing.
Output
Lib_S_Orientation "Vert" || "Horiz": Select from the dropdown menu
Lib_S_Direction "Left" || "Right" || "Up" || "Down". Select from the dropdown menu
Lib_S_Length Length of the parenthesis, in pixels. Select from the dropdown menu
Lib_S_Label Text label for the parenthesis. Label Text:
Lib_S_Center_X Symbol Center X Position Show/Hide Grid (10x10), Center Mark, Pins (green dot).
Grid
On
Off
Center
On
Off
Pins
On
Off
Lib_S_Center_Y Symbol Center Y Position
// Draw Parenthesis
Paren( Dwg_Obj, "Vert", "Left", 30, "Output", Start_X, Start_Y );

Chassis Mount Symbol

Description: This symbol is intended to be used as a marker for parts that are shown on the PC board but are mounted on the chassis. These might be things like volume controls or switches.

Parameter Description Example
Lib_S_Dwg_Obj Graphics Object that points to the drawing.
R101
Lib_S_Label Text label for the parenthesis. Label Text:
Lib_S_Center_X Symbol Center X Position Show/Hide Grid (10x10), Center Mark, Pins (green dot).
Grid
On
Off
Center
On
Off
Lib_S_Center_Y Symbol Center Y Position
// Draw Chassis Mount Symbol
Chassis_Sym( Dwg_Obj, "R101", Start_X, Start_Y );

Physical Dimension Symbol

Description: This function is for drawing a dimension indicator. The indicator consists of a two sided arrow that marks distance from one marker to another. An annotated value can be added. The length of the indicator is specified in pixels. The indicator length does not have to be related to the labeled value. This allows the user to use scaled distances, like 10 pixels per inch.

  • Lib_S_Dir - String that specifies the type of dimension to draw.
    • "Horiz_Wide" - Draws a horizontal dimension with the two arrows inside the end markers.
    • "Horiz_Narrow" - Draws a horizontal dimension with the two arrows outside the end markers.
    • "Vert_Wide" - Draws a vertical dimension with the two arrows inside the end markers.
    • "Vert_Narrow" - Draws a vertical dimension with the two arrows outside the end markers.
  • Lib_S_Len - Number that specifies the physical screen length, in pixels, for the dimension.
  • Lib_S_Dim_Val - Number that specifies the value of the input dimension.
  • Lib_S_Dim_Type - String that specifies the type of the input value ("Ft", "In", "m", "cm", "mm")
  • Lib_S_Dim_Display - String that specifies the format of the output string:
    • "US_Ft" - Display US/Imperal Feet only. 3' 11-1/2"
    • "US_In" - Display US/Imperal Inches only. 47-1/2"
    • "Metric_m" - Display US/Imperal meters only. e.g. 1.207m
    • "Metric_cm" - Display US/Imperal centimeters only. e.g. 120.7cm
    • "Metric_mm" - Display US/Imperal millimeters only. e.g. 1206.5mm
    • "US_In_Metric_m" - Display US/Imperal Inches and Metric meters. e.g. 47-1/2" (1.207m)
    • "US_In_Metric_cm" - Display US/Imperal Inches and Metric centimeters. e.g. 47-1/2" (120.7cm)
    • "US_In_Metric_mm" - Display US/Imperal Inches and Metric millimeters. e.g. 47-1/2" (1206.5mm)
    • "US_Ft_Metric m" - Display US/Imperal Feet and Metric meters. e.g. 3' 11-1/2" (1.207m)
    • "US_Ft_Metric_cm" - Display US/Imperal Feet and Metric centimeters. e.g. 3' 11-1/2" (120.7cm)
    • "US_Ft_Metric mm" - Display US/Imperal Feet and Metric millimeters. e.g. 3' 11-1/2" (1206.5mm)
    • "None" - Display nothing.
  • Lib_S_Position - String that specifies the location/position of the dimension value:
    • "Over -
    • "Under" -
    • "Left" -
    • "Right" -
  • Lib_S_Center_X - Number that specifies the physical screen X position
  • Lib_S_Center_Y - Number that specifies the physical screen Y position.

Parameter Description Example
Lib_S_Dwg_Obj Graphics Object that points to the drawing.
126' 0" (38.405m)
Lib_S_Dir "Horiz_Wide" || "Horiz_Narrow" || "Vert_Wide" || "Vert_Narrow". Select from the dropdown menu
Lib_S_Len Length of the dimension, in pixels.
Pixels*10 for 10 pixels/inch
Select from the dropdown menu
Lib_S_Dim_Val
Lib_S_Dim_Type
Label for the Dimension.
Insert value and select the value type.
Lib_S_Dim_Display Display Format for Dimension. Select from the dropdown menu
Lib_S_Position Label Position. If Horiz...: "Over" | "Under",
if Vert...: "Left" | "Right":
Select
Lib_S_Center_X Symbol Center X Position Show/Hide Grid (10x10), Center Mark, Pins (green dot).
Grid
On
Off
Center
On
Off
Lib_S_Center_Y Symbol Center Y Position

Note: The sample code, listed below, will only show a dimension length (Lib_S_Len) from 5 to 140 pixels. If you need a line that longer than 140 Pixenls (like 200 pixels) or a specific that is not in the dropdown (like 57 pixels), adjust the "Lib_S_Len" parameter to your specific needs. Only the Test Bench is limited due to the small test window.

// Draw Dimension
Dimension( Dwg_Obj, "Horiz_Wide", 100, 126, "Ft", "US_Ft_Metric_m", "Over", Start_X, Start_Y );