JavaScript®
Electronic
Notebooks
Documentation of "lib_s.js" Schematic Drawing Library

The following information documents a schematic drawing function library. The library contains functions that use jsDraw2D 2D JavaScript drawing library. The jsDraw2D library provides all of the necessary function for two dimensional drawing, like lines, circles, squares, etc..

jsDraw2D is a JavaScript library to draw 2D graphics on web pages inside web browser. The library is entirely written in JavaScript and does not need any plug-in or additional software to run/execute. The JavaScript source code of the library is open and free under "Creative Commons 3.0 Unported" license. The jsDraw2D documentation describes the various JavaScript classes along with their methods (APIs) available in the jsDraw2D library.


Drawing Creation: The list below describes the steps needed to add a drawing to a web page. This is mostly for my own purposes, so that I don't forget something, when I create a new document. The descriptions may not be very detailed, but it's all I need. I can cut/paste directly from this document to drawings started on my web pages.

  • Source the JavaScript Code - Before you can draw anything, you need to source the JavaScript functions. Add following code inside <head>...</head> structure of your HTML document. The first instance is the jsDraw2D JavaScript code (jsDraw2D.js). The other instances are my various JavaScript drawing libraries. They are the Schematic Library (lib_s.js), the Physical Library (lib_p.js), and the Logic Library (lib_l.js), respectively.

    The last file, my_drawing.js is your drawing file that contains your JavaScript commands.

    <script type="text/JavaScript" language="JavaScript" src="js/jsDraw2D.js"></script>
    <script type="text/JavaScript" language="JavaScript" src="js/lib_s.js" ></script>
    <script type="text/JavaScript" language="JavaScript" src="js/lib_p.js" ></script>
    <script type="text/JavaScript" language="JavaScript" src="js/lib_l.js" ></script>
    <script type="text/JavaScript" language="JavaScript" src="js/my_drawing.js" ></script>
  • Instantiate the drawing "<div>" - My drawings mostly consist of shapes, lines, and text that can be created using the jsDraw2D.js. That library uses a <canvas> structure because that is what they use in the jsDraw2D.js example. Plus, I don't require the interactive capabilities of a canvas or svg structure.

    The HTML code below is how the drawing <div> is instantiated in a HTML document. The "id" must be unique to all other structures that use a "id". The "class" defines the style setting to associate with the drawing.

    <div id="Sample_Schematic" class="B-Size"></div>
    • Engineering Drawing Sizes
      ANSI
      Size
      DimensionsDimensionsL/W Ratio
      A8.5" × 11"215.9mm x 279.4mm1.3:1
      B11" × 17"279.4mm x 431.82mm1.5:1
      C17" × 22"431.8mm x 558.8mm1.3:1
      D22" × 34"558.8mm x 863.6mm1.5:1
      E34" × 44"863.6mm x 1117.6mm1.3:1

      Drawing CSS - The CSS code below is an example of the style settings that can be used with the drawing <div> above. The A-Size and B-Size designation are really arbitrary. But they are the same Length/Width ratios as the standard A-Size and B-Size drawings. A-Size, C-Size, and E-Size drawings had 1.3:1 Length/Width ratios. B-Size and D-Size drawings had 1.5:1 Length/Width ratios. A-Size drawings often came in portrait and landscape orientations. A-Size Portrait was 8-1/2" Wide x 11" High and A-Size Landscape was 11" Wide x 8-1/2" High. Either one fit easily into a binder.

      There is no requirement to stick to standard sizes for your drawings. Drawings can be any size you like. The last two styles below show style settings for smaller drawings than the first there. Generally, I start with a small drawing and start working from the bottom left, and then up and across the drawing. If I need more space I can increase the drawing size without moving everything on the drawing.

      Note: The B-Size style, defined below, is probably the biggest drawing you may want on your web page. That size can fit on a single screen, without browser and OS headers/footers getting in the way. Anything bigger may cause the screen to generate scroll bars.

      <style type="text/css">
      <!-- /* 1:1.3 Ratio - portrait A */
      .A-Size_Port { overflow:hidden; position:relative; width:600px; height:780px;
        border:1px solid #3f7f00; margin-left:auto; margin-right:auto; margin-bottom:10px; }
      /* 1.3:1 Ratio - landscape A, C, E */
      .A-Size_Land { overflow:hidden; position:relative; width:780px; height:600px;;
        border:1px solid #3f7f00; margin-left:auto; margin-right:auto; margin-bottom:10px; }
      /* 1.5:1 Ratio - landscape B, D */
      .B-Size { overflow:hidden; position:relative; width:900px; height:600px;
        border:1px solid #3f7f00; margin-left:auto; margin-right:auto; margin-bottom:10px; }
      /* 350 x 250 drawing */
      .DWG_350x250 { overflow:hidden; position:relative; width:350px; height:250px;
        background-color:#C6F7BD; border:1px solid #3f7f00; box-shadow: 5px 5px 5px #888888;}
      /* 450 x 250 drawing */
      .DWG_450x250 { overflow:hidden; position:relative; width:450px; height:250px;
        background-color:#C6F7BD; border:1px solid #3f7f00; box-shadow: 5px 5px 5px #888888;}
      --> </style>
  • Create a JavaScript Function - I keep all of my JavaScript file in a folder named "js". That is why all of the JavaScript references have "js/" as a prefix. A Javascript file, much like a HTML file, is nothing more than a text file with a ".js" extension. So you can easily create a empty text file and then change the extension to ".js". The OS will complain a bit, but just tell it to do it anyway.

    The JavaScript file will contain all of your drawing commands grouped as a function. The function contains the initialization of the object followed by a series of function references to draw the diagram. In the code below, the red text is the id of the drawing <div>. This is then used to create the drawing object pointer, Drawing_Obj.

    Note: the line numbers in the example are there for reference purposes only. Do not include them in your JavaScript functions.

    1   function Draw_Sch() {
    2   var Drawing_Obj = new jsGraphics(document.getElementById(""Sample_Schematic"));
    3   var Height = document.getElementById("Sample_Schematic").clientHeight;
    4   var Width = document.getElementById("Sample_Schematic").clientWidth;
    5   var Drawing_Obj_X_Origin = 0, Drawing_Obj_Y_Origin = Height;
    6   Drawing_Obj.setOrigin(new jsPoint(Drawing_Obj_X_Origin,Drawing_Obj_Y_Origin));
    7   Drawing_Obj.setCoordinateSystem("cartecian");
    8   Drawing_Obj.setScale(1);
    9   //Drawing_Obj.showGrid(20);
    10  Drawing_Obj.fillRectangle(new jsColor("#C6F7BD"),new jsPoint(0,Height),Width,Height);
    11
    12  { Drawing function references }
    13
    14  }

    Below is a line-by-line description of the code snippet above.

    Line Description
    1 This is just the standard function declaration. Each drawing should have a separate function.
    2 Creates a drawing object pointer to your object window. Each drawing object should have a different id.
    3 Extracts the Height of the object window.
    4 Extracts the Width of the object window.
    5 Defines the origin variables (Drawing_Obj_X_Origin and Drawing_Obj_Y_Origin) and allow for an offset that can be used to move the whole drawing. Negative values, added to the Y Origin, will move the entire drawing up. Positive values, added to the X Origin, will move the entire drawing to the right. By default, the drawing origin is set to the upper left of the drawing window. This then forces you to use negative values for Y. However, setting the Y Origin to Height changes the drawing origin to the lower left and allows the use of positive Y values.
    6 Sets the origin for jsDraw2D, based on the defined origins.
    7 Sets the coordinate System for jsDraw2D to "Cartesian".
    8 Sets the scaling for jsDraw2D to 1. By default the scale value 1. Scale is the factor by which all the metric drawing parameters are converted before drawing the actual pixels.
    9 Displays the grid as per the 2D coordinate system. The setting of "20" display a 20 pixel grid on the drawing window. I use this line in conjunction with line 10, when I am initially creating a drawing. I enable this line and disable line 10 (with comment marks), so that I can see the reference grid. When I am mostly done, I disable line 9 and reenable line 10.
    10 This line fills the drawing window with a background color. This serves to clear the drawing window before the drawing is created. This is useful when items on the drawing window are changed dynamically.
    11... This is the main body of the drawing.
  • Initialize the drawing - Because the drawings on my pages are created as functions, they need to be run before the drawing will appear. To accomplish this I use the "onload" capabilities of the <body> tag. The <body> tag delineates the body structure of your HTML document from the <head> structure.
    • Onload - If you only have a single drawing on your page, you can simply include the function reference in the <body> tag. The example below shows a call to the drawing.
      <body onload="Sample_Schematic();">
    • Multiple Drawings - However, if you have multiple drawings on a web page it is often easier to create a initialization function at the top of your JavaScript that calls each drawing. Then the <body> tag only needs a single reference to initialize all of the drawings.
      HTML Document
      <body onload="Init_Drawings();">
      JavaScript Document
      function Init_Drawings() {
      Sample_Schematic_1();
      Sample_Schematic_2();
      Sample_Schematic_3();
      }
  • Add draw commands to the Javascript Code

    • Color Settings (Javascript) - The following global variables are defined in the function library. It they are not changed, the entire drawing will be done with black symbols, wires, dots, and text.

      // Set the default drawing, fill, and text colors.
      var Symbol_Pen = new jsPen(new jsColor("black"),1);
      var Label_Color = new jsColor("black");
      var Value_Color = new jsColor("black");
      var Wire_Pen = new jsPen(new jsColor("black"),1);
      var Dot_Fill = new jsColor("green");
    • If you wish to change the coloring the same global variables can be declared in your schematic drawing code. Below is and example that is used in this document. It changes the Symbol_Pen to "red", the Wire_Pen to "green", the Dot_Fill color to "green", and the Value_Color to "blue".

      // Set the default drawing, fill, and text colors.
      var Symbol_Pen = new jsPen(new jsColor("red"),1);
      var Label_Color = new jsColor("black");
      var Value_Color = new jsColor("blue");
      var Wire_Pen = new jsPen(new jsColor("green"),1);
      var Dot_Fill = new jsColor("green");
    • Engineering Drawing Sizes
      ANSI
      Size
      DimensionsDimensionsL/W Ratio
      A8.5" × 11"215.9mm x 279.4mm1.3:1
      B11" × 17"279.4mm x 431.82mm1.5:1
      C17" × 22"431.8mm x 558.8mm1.3:1
      D22" × 34"558.8mm x 863.6mm1.5:1
      E34" × 44"863.6mm x 1117.6mm1.3:1

      Drawing Boarder and Label: Unlike the other entries on this page, this entry describes two draw functions: Drawing_Boarder(...) and Drawing_Label(...). If you are creating a drawing and need a border and label, these functions should be called first, followed by the rest of the drawing operations. The chart on the right shows typical drawing sizes. But these were sheets of vellum or drawing paper and were spread out on large drafting tables. Some of these sizes are still in use, but even 20 years ago, we were taking D-Size drawings and shrinking them to B-Size. That size was easier to handle and could be printed easily.

      The B-Size designation, on the sample drawing, is really arbitrary. But it is the same Length/Width ratio (1.5:1) of the B-Size and D-Size, landscape, drawings. It was common to use the A-Size, portrait, drawings for small schematics because they fit right into a 8-1/2" x 11" binder. The A-Size has a 1.3:1 Length/Width ratio.

      The Sample Schematic, shown at the bottom of this section, is 900 pixels wide by 600 pixels high (1.5:1 Ratio). This is about as big as you want to get, and still fit the whole drawing on one screen. My monitor is 1366 pixels wide x 768 pixels high. The browser's header and the operating system's task bar take up some vertical space, so 600 pixels high is about all you can do. On some systems, this may need to be reuced. If you do reduce it, also reduce the width keeping the 1.5:1 width/height ratio.




Drawing_Border

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.

Drawing_Border( Lib_S_Dwg_Obj, Border_Zones, Width, Height );
Parameter Description
Lib_S_Dwg_Obj jsGraphics Object that points to the drawing.
Lib_S_Zone Show/Hide drawing Zones indicate by dashed lines("Show Zones" || "").
See the results of "Show Zones" by looking at the Sample Schematic, below.

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.

Usage: The sample function call is shown below. The Width and Height values are extracted from the drawing instance. 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.

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



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.

Lib_S_Label_Info = [ Lib_S_Mfgr, Lib_S_Title, Lib_S_Size, Lib_S_Doc_Num, Lib_S_Rev, Lib_S_Date, Lib_S_Sheet, Lib_S_Pages ];
Drawing_Label( Sch, Lib_S_Label_Info, 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.

Lib_S_Label_Info = [ "Electronic Rainbow Ind., Inc.", "INDUCTANCE METER", "B", "IA-1", "", "March 11, 1992", "1", "1" ];

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

Usage: The sample subroutine call is shown below. 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 draawing instance.

var Label_XY = [Lib_S_Label_X, Lib_S_Label_Y] = Drawing_Border( Sch, "", Width, Height );
Lib_S_Label_Info = [ "", "", "", "", "", "", "", "" ];
Drawing_Label( Sch, Lib_S_Label_Info, Lib_S_Label_X, Lib_S_Label_Y );




Wire

Description: Draws a line starting at point Lib_S_Start_X, Lib_S_Start_Y to Lib_S_End_X, Lib_S_End_Y.

Wire( Lib_S_Dwg_Obj, Lib_S_Start_X, Lib_S_Start_Y, Lib_S_End_X, Lib_S_End_Y );
Parameter Description
Lib_S_Dwg_Obj Graphics Object that points to the drawing.
Lib_S_Start_X Wire Start X Position
Lib_S_Start_Y Wire Start Y Position
Lib_S_End_X Wire End X Position
Lib_S_End_Y Wire End Y Position

Return: None

Usage: Should only be used after all of the symbols are placed on the drawing so that the symbol end points can be used as end point references.

// Draw a wire from L2 to J1 Center.
Wire( Lib_S_Dwg_Obj, L2_End_X, L2_End_Y, J1_CTEnd_X, J1_CTEnd_Y );



Route

Description: Draws a line starting at point Lib_S_Start_X, Lib_S_Start_Y routed according to the routing array. This function can only be use if there are two, or more, routing points.

Route( Lib_S_Dwg_Obj, Lib_S_Route_Array, Lib_S_Start_X, Lib_S_Start_Y );
Parameter Description
Lib_S_Dwg_Obj Graphics Object that points to the drawing.
Lib_S_Route_Array Routing array.
Num Routes, direction (X || Y), length (+/-), direction (X || Y), length (+/-), ...
Lib_S_Start_X Wire Start X Position
Lib_S_Start_Y Wire Start Y Position

Return: Returns the X,Y of the ending point.

Usage: Generally used after all of the symbols are placed on the drawing. Use to connect a symbol pin on one part to a symbol pin on another part, when the route is not a simple vertical or horizontal line.

S1B_Com_U1B_Route = [ 4, "X", +20, "Y", -110, "X", -250, "Y", -70 ];
XY_Return = [ End_X, End_Y ] = Route( Sch, S1B_Com_U1B_Route, S1B_Com_X,S1B_Com_Y );



Dot

Description: Draws a 3 pixel wide dot at the point Lib_S_Start_X, Lib_S_Start_Y.

Dot( Lib_S_Dwg_Obj, Lib_S_Start_X, Lib_S_Start_Y );
Parameter Description
Lib_S_Dwg_Obj Graphics Object that points to the drawing.
Lib_S_Start_X Dot X Position
Lib_S_Start_Y Dot Y Position

Return: None

Usage: Should only be used after all of the symbols are placed on the drawing and wires are drawn, so that the symbol end points can be used for dot placement.

Dot( Lib_S_Dwg_Obj, R4_Start_X, R4_Start_Y+20 );



Off_Page

Description: Draws a Off Page arrow at point Lib_S_Start_X. Lib_S_Sig is the associated signal name and Lib_S_Zone is the signal source or destination, depending on whether you instantiate a signal that is going off the page or being received from a off page source.

Off_Page( Lib_S_Dwg_Obj, Lib_S_IO, Lib_S_Sig, Lib_S_Zone, Lib_S_Start_X, Lib_S_Start_Y );
Parameter Description Example
Lib_S_Dwg_Obj Graphics Object that points to the drawing.
Lib_S_IO Specify as Input or Output, in quotes ("In" || "Out").
Lib_S_Sig Signal Name, in quotes ("Osc Out", "RF In", etc.).
Lib_S_Zone Drawing Zone reference, in quotes ("2-A5", "1-C3", etc.).
The ordering is the "Page_Number-Zone_Reference".
Lib_S_Start_X Power Symbol Center X Position
Lib_S_Center_Y Power Symbol Start Y Position

Return: Returns the X/Y coordinates of the input pin.

Usage: .

V1_Start_X = 70; V1_Start_Y = 40;
Off_Page( Lib_S_Dwg_Obj, "Out". "Osc Out", "2-A5", OP_Start_Y, OP_Start_Y );



VPlus

Description: Draws a power definition point at point Lib_S_Start_X. The value, Lib_S_Value, is attached to the top of the symbol.

VPlus( Lib_S_Dwg_Obj, Lib_S_Value, Lib_S_Start_X, Lib_S_Start_Y );
Parameter Description Example
Lib_S_Dwg_Obj Graphics Object that points to the drawing.
Lib_S_Value Power Value. Can be positive or negative.
Lib_S_Start_X Power Symbol Start X Position
Lib_S_Start_Y Power Symbol Start Y Position

Return: None

Usage: .

V1_Start_X = 200; V1_Start_Y = 280;
VPlus( Lib_S_Dwg_Obj, "+12V", V1_Start_X, V1_Start_Y );



Ground

Description: Draws a ground definition point at point Lib_S_Start_X, Lib_S_Start_Y.

Ground( Lib_S_Dwg_Obj, Lib_S_Type, Lib_S_Start_X, Lib_S_Start_Y );
Parameter Description Example
Lib_S_Dwg_Obj Graphics Object that points to the drawing.
Lib_S_Type Ground Type ("Chassis" || "Earch" || "Common") in quotes.
Lib_S_Start_X Ground Symbol Start X Position
Lib_S_Start_Y Ground Symbol Start Y Position

Return: None

Usage: .

G1_Start_X = 70; G1_Start_Y = 40;
Ground( Lib_S_Dwg_Obj, G1_Type, G1_Start_X, G1_Start_Y );



Chassis Ground

Description: Draws a ground definition point at point Lib_S_Start_X, Lib_S_Start_Y.

Draw_Chassis_Gnd( Lib_S_Dwg_Obj, Lib_S_Start_X, Lib_S_Start_Y );
Parameter Description Example
Lib_S_Dwg_Obj Graphics Object that points to the drawing.
Lib_S_Start_X Ground Symbol Start X Position
Lib_S_Start_Y Ground Symbol Start Y Position

Return: None

Usage: .

G1_Start_X = 70; G1_Start_Y = 40;
Draw_Chassis_Gnd( Lib_S_Dwg_Obj, G1_Start_X, G1_Start_Y );



Small Ground

Description: Draws a small ground definition point at point Lib_S_Start_X, Lib_S_Start_Y. For use when drawing space is a premium.

SM_Chassis_Gnd( Lib_S_Dwg_Obj, Lib_S_Start_X, Lib_S_Start_Y );
Parameter Description Example
Lib_S_Dwg_Obj Graphics Object that points to the drawing.
Lib_S_Start_X Ground Symbol Start X Position
Lib_S_Start_Y Ground Symbol Start Y Position

Return: None

Usage: .

G1_Start_X = 70; G1_Start_Y = 40;
SM_Chassis_Gnd( Lib_S_Dwg_Obj, G1_Start_X, G1_Start_Y );



Out

Description: Draws a output pin at Lib_S_Start_X, Lib_S_Start_Y.

Output( Lib_S_Dwg_Obj, Lib_S_Value, Lib_S_Start_X, Lib_S_Start_Y );
Parameter Description Example
Lib_S_Dwg_Obj Graphics Object that points to the drawing.
Lib_S_Label_Pos Label Position ("top" or "bottom" or "front") in quotes. Default is "top".
Lib_S_Start_X Output Symbol Start X Position
Lib_S_Start_Y Output Symbol Start Y Position

Return: None

Usage: Used to indicate a signal going off the circuit. The example below draws a horizontal capacitor, a 10 pixel long wire, and then attaches an output symbol.

Out1_Start_X = 40; Out1_Start_Y = 70;
Output( Output_Sample, "RF Out", "top", Out1_Start_X, Out1_Start_Y );



Tie_Point

Description: Draws a tie point at Lib_S_Start_X, Lib_S_Start_Y.

Tie_Point( Lib_S_Dwg_Obj, Lib_S_Value, Lib_S_Label_Pos, Lib_S_Rotate, Lib_S_Start_X, Lib_S_Start_Y );
Parameter Description Example
Lib_S_Dwg_Obj Graphics Object that points to the drawing.
Lib_S_Label_Pos Label Position ("top" or "bottom" or "front") in quotes for the "left" and "right" Tie Point. Default is "top". If "up" or "down" is selected in the Lib_S_Rotate, the Label Position is ignored and the label is placed either above, for "up" or below for "down" the Tie Point
Lib_S_Rotate Rotational Position ("right" or "up" or "left" or "down") in quotes. Defines the direction for the Tie Point. Default is "right".
Lib_S_Start_X Output Symbol Start X Position
Lib_S_Start_Y Output Symbol Start Y Position

Return: None

Usage: Used to indicate a signal tie point. The example below draws a horizontal capacitor, a 10 pixel long wire, and then attaches an output symbol.

TP_Start_X = 40; TP_Start_Y = 70;
Tie_Point( Output_Sample, "RF Out", "top", "right", TP_Start_X, TP_Start_Y );



Connector Pin

Description: Draws a connector pin at Lib_S_Start_X, Lib_S_Start_Y.

ConnPin( Lib_S_Dwg_Obj, Lib_S_Value, Lib_S_Label_Pos, Lib_S_Rotate, Lib_S_Start_X, Lib_S_Start_Y );
Parameter Description Example
Lib_S_Dwg_Obj Graphics Object that points to the drawing.
Lib_S_SigName Connector Pin Signal name. Can be placed on the left, right, top, or bottom of the symbol based on Lib_S_Lt_Rt.
Lib_S_PinNum
Lib_S_Lt_Rt Connector pin position, "Left" or "Right".
Lib_S_Start_X Output Symbol Start X Position
Lib_S_Start_Y Output Symbol Start Y Position

Return: None

Usage: Used to indicate a connector pin.

CP_Start_X = 40; CP_Start_Y = 70;
Conn_Pin( Lib_S_Dwg_Obj, "RF Out", "25", "Right", CP_Start_X, CP_Start_Y );



Coax_Conn

Description: Draws a Coax Connector at Lib_S_Start_X, Lib_S_Start_Y.

Coax_Conn( Lib_S_Dwg_Obj, Lib_S_Des, Lib_S_Label, Lib_S_Pos, Lib_S_Start_X, Lib_S_Start_Y );
Parameter Description Example
Lib_S_Dwg_Obj Graphics Object that points to the drawing.
Lib_S_Des Part Designator ("J1", "J2", "J3", etc..) in quotes. Positions the designator on the top of the connector.
Lib_S_Label Connector Label ("Input","Output", etc.) in quotes. Positions the designator on the left or right of the connector, based on "Lib_S_Rotate".
Lib_S_Pos Defines the direction of the connector's center pin ("right" or "left") in quotes.
Lib_S_Start_X Output Symbol Start X Position
Lib_S_Start_Y Output Symbol Start Y Position

Return: Returns the position of the center conductor tie point and the ground tie point (Lib_S_CTEnd_X, Lib_S_CTEnd_Y, Lib_S_GEnd_X, Lib_S_GEnd_Y) in a array.

Usage:

J1_Start_X = 40; J1_Start_Y = 70;
var J1_XY_Return = [J1_CTEnd_X, J1_CTEnd_Y, J1_GEnd_X, J1_GEnd_Y] = Coax_Conn( Lib_S_Dwg_Obj, "J1", "Input", "right", J1_Start_X, J1_Start_Y );



LM78_Reg
LM78_Reg( Lib_S_Dwg_Obj, Lib_S_Des, Lib_S_Voltage, Lib_S_Start_X, Lib_S_Start_Y );

Description: Draws a Voltage Regulator at Lib_S_Start_X, Lib_S_Start_Y.

Parameter Description Example
Lib_S_Dwg_Obj Graphics Object that points to the drawing.
Lib_S_Des Part Designator ("U1", "U2", "U3", etc..) in quotes. Positions the designator on the top of the connector.
Lib_S_Voltage Regulator Output Voltage ("05", "L05", "06", "08", "09", "L09", "10", "12", "L12", "15", "L15", "18", "24") in quotes. Not all voltages have a "L" equivalent.
Lib_S_Start_X Output Symbol Start X Position Show/Hide Pins - Mark the I/O pins
with a green dot.   
Lib_S_Start_Y Output Symbol Start Y Position

Return:

Usage:

U1_Start_X = 40; U1_Start_Y = 70;
var U1_XY_Return = [U1_VI_X, U1_VI_Y, U1_VO_X, U1_VO_Y, U1_GND_X, U1_GND_Y] = LM78_Reg( Lib_S_Dwg_Obj, Lib_S_Des, Lib_S_Voltage, Lib_S_Start_X, Lib_S_Start_Y );



Op Amp

Description: Draws a Op Amp centered at Lib_S_Start_X, Lib_S_Start_Y.

Op_Amp( Lib_S_Dwg_Obj, Lib_S_Dwg_Obj, Lib_S_Des, Lib_S_Type, Lib_S_PWR, Lib_S_Inputs, Lib_S_Start_X, Lib_S_Start_Y );
Parameter Description Example
Lib_S_Dwg_Obj Graphics Object that points to the drawing.
Lib_S_Des Part Designator ("U1", "U2", "U3", etc..) in quotes. Positions the designator on the top of the connector.
Lib_S_Type Op Amp Type ("LM741", "UA741", etc) in quotes.
Lib_S_PWR Show Op Amp Power and Ground ( "Show", "") in quotes.
Lib_S_Inputs Show Op Inputs with "+" above the "-" (Normal) or with the "-" above the "+" (Reverse).
Use "Normal" ("-" on top), "Reverse" ("+" on top) in quotes.
Lib_S_Start_X Output Symbol Start X Position
Lib_S_Start_Y Output Symbol Start Y Position

Return:

Usage:

U1_Start_X = 40; U1_Start_Y = 70;
var U1_XY_Return = [U1_Neg_End_X, U1_Neg_End_Y, U1_Pos_end_X, U1_Pos_End_Y, U1_Out_End_X, U1_Out_End_Y] = Op_Amp( Lib_S_Dwg_Obj, Lib_S_Des, Lib_S_Type, Lib_S_PWR, Lib_S_Inputs, Lib_S_Start_X, Lib_S_Start_Y );



Logic

Description: This function draws the specified logic device centered at point Lib_L_Center_X, Lib_L_Center_Y. Most logic devices contain multiple instances of a particular logic function, so the Device Section selector below will change dynamically based on which device is selected. Power and Ground connections are considered a separate Device Section.
Note: This is not a comprehensive library of logic devices. Devices are only added as I find a need for them.

U1A_XY_Return = Logic( Lib_L_Dwg_Obj, Lib_L_Label, Lib_L_Dev, Lib_L_Tech, Lib_L_Sect, Lib_L_Center_X, Lib_L_Center_Y );
Parameter Description Example
Lib_S_Dwg_Obj jsGraphics Object that points to the drawing.
Lib_L_Label Device Section ("U1", "U2", etc.) in quotes.
Lib_L_Dev Device Name ("7400", "7402", etc.) in quotes. OC = Open Collector.
Lib_L_Tech Device Technology ("S", "LS", "F", etc.) in quotes.
Lib_L_Sect Device Section ("A", "B", "C", "D", "PWR", etc.) in quotes.
Lib_S_Start_X Symbol Start X Position Show/Hide Pins - Mark the I/O pins
with a green dot.   
Lib_S_Start_Y Symbol Start Y Position

Return: The draw function will return, in an array, the X and Y points for each of the displayed pins. This can be different depending on which logic device is specified. For example, the "7400" would return the X,Y points for the two input pins (In1 and In2) and one output pin (Out). The "7474" would return the X,Y points for D, Clk, Set, Clr, Q, and Q-Bar.

Return points are always orderd the same. Starting at the Top-Left of the symbol and working from Top to Bottom, Left to Right. For example, the return points for the "7476" would be ordered:

[ J_X, J_Y, Clk_X, Clk_Y, K_X, K_Y, Set_X, Set_Y, Clr_X, Clr_Y, Q_X, Q_Y, Q-Not_X, Q-Not_Y ]

Usage: The following sample code shows the command line needed to create the object in the sample box. You can cut/paste it to your code page and then adjust the specifics to suite your page. Set the start X and Y values for the symbol. Change all of the variable prefixes, e.g. U1A to U1B, for each instance of the symbol. This keeps the variables unique for later use.

U1A_Center_X = 70; U1A_Center_Y = 70;
var U1A_XY_Return = Logic_Gate( Lib_L_Dwg_Obj, "", "", "", "", U1A_Center_X, U1A_Center_Y );



Resistor

Description: Draws a Resistor Horizontally (R0), left to right, starting at point Lib_S_Start_X, Lib_S_Start_Y. Lib_S_Label is placed above the symbol and Lib_S_Value below the symbol. A Vertical resistor (R90), is drawn top to bottom. Lib_S_Label and Lib_S_Value are placed on the right of the symbol. Symbol placement can be changes with Lib_S_Label_Pos.

Resistor( Lib_S_Dwg_Obj, Lib_S_Label, Lib_S_Value, Lib_S_Label_Pos, Lib_S_Rot, Lib_S_Start_X, Lib_S_Start_Y );
Parameter Description Example
Lib_S_Dwg_Obj Graphics Object that points to the drawing.
Lib_S_Label Text Label ("R1", "R2", etc.) in quotes.
Lib_S_Value Text Value ("10K", "100 Ohms", "10 Ω", etc.) in quotes.
Lib_S_Label_Pos Label/Value Position ("Norm" or "Flip") in quotes. Default is "Norm".
Lib_S_Rot Position ("R0" = Horizontal or "R90" = Vertical) in quotes.
Lib_S_Start_X Symbol Start X Position
Lib_S_Start_Y Symbol Start Y Position

Return: The draw function will return the end X and Y values for the symbol, in a array.

Usage: Set the Start_X and Start_Y values for the symbol. The draw function will return the End_X and End_Y values as a array. Change all of the variable prefixes, e.g. R1 to R2, for each instance of the symbol. This keeps the variables unique for later use. The example below draws a horizontal resistor starting at R1_Start_X, R1_Start_Y, with the Part ID ("R1") above the resistor and the value ("220K") below the resistor. The values returned are for the resistor end point.

R1_Start_X = 100; R1_Start_Y = 240;
var R1_XY_Return = [R1_End_X, R1_End_Y] = Resistor( Lib_S_Dwg_Obj, "R1", "220K", "Norm", "R0", R1_Start_X, R1_Start_Y );



Var_Resistor

Description: Draws a Resistor Horizontally (R0), left to right, starting at point Lib_S_Start_X, Lib_S_Start_Y. Lib_S_Label is placed above the symbol and Lib_S_Value below the symbol. A Vertical resistor (R90), is drawn top to bottom. Lib_S_Label and Lib_S_Value are placed on the right of the symbol. Symbol placement can be changes with Lib_S_Label_Pos.

Var_Resistor( Lib_S_Dwg_Obj, Lib_S_Label, Lib_S_Value, Lib_S_Label_Pos, Lib_S_Rot, Lib_S_Start_X, Lib_S_Start_Y );
Parameter Description Example
Lib_S_Dwg_Obj Graphics Object that points to the drawing.
Lib_S_Label Text Label ("R1", "R2", etc.) in quotes.
Lib_S_Value Text Value ("10K", "100 Ohms", "10 Ω", etc.) in quotes.
Lib_S_Rot Position ("R0" = Left, "R90" = Up, "R180" = Right, "R270" = Down) in quotes.
Lib_S_Start_X Symbol Start X Position Show/Hide Pins - Mark the I/O pins
with a green dot.   
Lib_S_Start_Y Symbol Start Y Position

Return: The draw function will return the end X and Y values for the symbol, in a array.

Usage: Set the Start_X and Start_Y values for the center of the symbol. The draw function will return the X and Y values for the end points and the wiper. Change all of the variable prefixes, e.g. R1 to R2, for each instance of the symbol. This keeps the variables unique for later use. The example below draws a horizontal resistor starting at R1_Start_X, R1_Start_Y, with the Part ID ("R1") above the resistor and the value ("220K") below the resistor. The values returned are for the resistor end point.

R1_Start_X = 100; R1_Start_Y = 240;
var R1_XY_Return = [R1_Top_X, R1_Top_Y, R1_Bottom_X, R1_Bottom_Y, R1_Wiper_X, R1_Wiper_Y] = Var_Resistor( Lib_S_Dwg_Obj, "R1", "220K", "R0", R1_Start_X, R1_Start_Y );



Capacitor

Description: Draws a Capacitor of Type Basic, Electrolytic, or Variable based on Lib_S_Type ("Basic" || "Elect" || "Var" ). Lib_S_Orient specifies the symbol orientation ("R0" = Vertical || "R90" = Right || "R180" = Bottom || "R270" = Left ). Lib_S_Label specifies the Part Designator ("C1" || "C2") and Lib_S_Value specifies the Part Value ("100 uF" || "10 uF" || "0.1 uF" || "" ).

Capacitor( Lib_S_Dwg_Obj, Lib_S_Type, Lib_S_Orient, Lib_S_Label, Lib_S_Value, Lib_S_Start_X, Lib_S_Start_Y );
Parameter Description Example
Lib_S_Dwg_Obj Graphics Object that points to the drawing.
Lib_S_Type Text Value ("Basic" || "Elect" || "Var" ) in quotes.
Lib_S_Orient Text Value ("R0" = Vertical || "R90" = 90 Degrees Right
|| "R180" = Bottom || "R270" = Left ) in quotes.
Lib_S_Label Text Label ("C1", "C2", etc.) in quotes.
Lib_S_Value Text Value ("100 uF" || "10 uF" || "0.1 uF" || "" ) in quotes.
Lib_S_Start_X Symbol Start X Position
Lib_S_Start_Y Symbol Start Y Position

Return: The draw function will return the end X and Y values for the symbol, in a array.

Usage: Set the start X and Y values for the symbol. The draw function will return the end X and Y values as a array. Change all of the variable prefixes, e.g. C1 to C2, for each instance of the symbol. This keeps the variables unique for later use.

C1_Start_X = 100; C1_Start_Y = 240;
var C1_XY_Return = [C1_End_X, C1_End_Y] = Capacitor( Lib_S_Dwg_Obj, "Basic", "R0", "C1", "0.1 uF", C1_Start_X, C1_Start_Y );



Inductor

Description: Draws a Basic Inductor with 1, 2, 3, or 4 180° arcs (Lib_S_Type = "Basic1" || "Basic2" || "Basic3" || "Basic4" ).
Lib_S_Orient specifies the symbol orientation ( "R0" = top to bottom || "R90" = left to right || "R180" = bottom to top || "R270" = right to left ).
Lib_S_Core specifies whether the inductor should be marked with a core.
Lib_S_Label specifies the Part Designator ("L1" || "L2").
Lib_S_Value specifies the Part Value ("100 uH" || "10 uH" || "0.1 uH" || etc. ).

Inductor( Lib_S_Dwg_Obj, Lib_S_Type, Lib_S_Orient, Lib_S_Label, Lib_S_Value, Lib_S_Start_X, Lib_S_Start_Y );
Parameter Description Example
Lib_S_Dwg_Obj Graphics Object that points to the drawing.
Lib_S_Type Text Value ("Basic1" || "Basic2" || "Basic3" || "Basic4" ) in quotes.
Lib_S_Orient Text Value ("R0" = Vertical - top to bottom || "R90" = Horizontal - left to right ||
"R180" = Vertical - bottom to top || "R270" = Horizontal - right to left) in quotes.
Lib_S_Core Text Value ("No Core" || "Core").
Lib_S_Label Text Label ("L1", "L2", etc.) in quotes.
Lib_S_Value Text Value ("100 uH" || "10 uH" || "0.1 uH" || "" ) in quotes.
Lib_S_Label_Pos Label/Value Position ("Norm" or "Flip") in quotes. (Not implemented)
Lib_S_Start_X Symbol Start X Position
Lib_S_Start_Y Symbol Start Y Position

Return: The draw function will return the end X and Y values for the symbol, in a array.

Usage: Set the start X and Y values for the symbol. The draw function will return the end X and Y values as a array. Change all of the variable prefixes, e.g. L1 to L2, for each instance of the symbol. This keeps the variables unique for later use.

L1_Start_X = 100; L1_Start_Y = 240;
var L1_XY_Return = [L1_End_X, L1_End_Y] = Inductor( Lib_S_Dwg_Obj, "Basic3", "R90", "Core", "L1", "", "unused", L1_Start_X, L1_Start_Y );



Diode

Description: Draws a Diode starting at point Lib_S_Start_X, Lib_S_Start_Y with the cathode direction based on Lib_S_Rot. Default for vertical diodes places the Lib_S_Label and Lib_S_Value on the right of the symbol. Default for horizontal diodes places the Lib_S_Label above and the Lib_S_Value below the symbol.

Diode( Lib_S_Dwg_Obj, Lib_S_Label, Lib_S_Value, Lib_S_Type, Lib_S_Label_Pos, Lib_S_Rot, Lib_S_Start_X, Lib_S_Start_Y );
Parameter Description Example
Lib_S_Dwg_Obj jsGraphics Object that points to the drawing.
Lib_S_Label Text Label ("D1", "D2", etc.) in quotes.
Lib_S_Type Text Value ("Diode", "Zener", "LED", etc.) in quotes.
Lib_S_Value Text Value ("1N4148", "1N34", "12VZ", etc.) in quotes.
Lib_S_Label_Pos Label/Value Position ("Norm" or "Flip") in quotes.
Lib_S_Rot Rotate Diode "R(N)" degrees) right ("R0", "R90", "R180", or "R270") in quotes.
Lib_S_Start_X Symbol Start X Position Show/Hide Pins - Mark the I/O pins with a green dot.   
Lib_S_Start_Y Symbol Start Y Position

Return: The draw function will return the Anode (X,Y) coordinates and Cathode (X,Y) coordinates, in a array.

Usage: Set the start X and Y values for the symbol. Change all of the variable prefixes, e.g. D1 to D2, for each instance of the symbol. This keeps the variables unique for later use.

D1_Start_X = 100; D1_Start_Y = 240;
var D1_XY_Return = [D1_End_X,D1_End_Y] = Diode( Lib_S_Dwg_Obj, "D1", "Diode", "1N4148", "Flip", "R0", D1_Start_X, D1_Start_Y );



Transistor

Description: Draws a Transistor starting at point Lib_S_Start_X, Lib_S_Start_Y with the cathode direction based on Lib_S_Cath_Pos. Default for vertical diodes places the Lib_S_Label and Lib_S_Value on the right of the symbol. Default for horizontal diodes places the Lib_S_Label above and the Lib_S_Value below the symbol.

Transistor( Lib_S_Dwg_Obj, Lib_S_Label, Lib_S_Type, Lib_S_TX_Pos, Lib_S_TX_Label, Lib_S_TX_Value, Lab_Lab_Val_Pos, Lib_S_Start_X, Lib_S_Start_Y );
Parameter Description Example
Lib_S_Dwg_Obj jsGraphics Object that points to the drawing.
Lib_S_Type Transistor Type ("NPN" or "PNP") in quotes.
Lib_S_Rot Rotate Right - ("R0", "R90", "R180", or "R270") in quotes.
Lib_S_Mir Mirror in "Y" ("Mir" or "None") in quotes.
Lib_S_TX_Label Transistor Label ("Q1", "Q2", etc.) in quotes.
Lib_S_TX_Value Transistor Value ("2N3866", "BC547", etc.) in quotes.
Lib_S_Lab_Val_Pos Transistor Label/Value Position ("default" or "flip") in quotes.
Lib_S_Start_X Transistor Base Start X Position
Lib_S_Start_Y Transistor Base Start Y Position

Return: The draw function will return the end X and Y values for the transistor's Base, Emitter, and Collector symbol, in a array.

Usage: Set the start X and Y values for the symbol. Change all of the variable prefixes, e.g. Q1 to Q2, for each instance of the symbol. This keeps the variables unique for later use.
Q1_Start_X = 100; Q1_Start_Y = 240;
var Q1_XY_Return = [Q1B_X,Q1B_Y,Q1E_X,Q1E_Y,Q1C_X,Q1C_Y] = Transistor( Lib_S_Dwg_Obj, "NPN", "R0", "None", "Q1", "1N3866", "default", Q1_Start_X, Q1_Start_Y );




Crystal

Description: Draws a Crystal, from left to right, starting at point Lib_S_Start_X, Lib_S_Start_Y. Default operation is to place Lib_S_Label above the symbol and Lib_S_Value below the symbol.

Crystal( Lib_S_Dwg_Obj, Lib_S_Label, Lib_S_Value, Lib_S_Label_Pos, Lib_S_Label_Rot, Lib_S_Start_X, Lib_S_Start_Y );
Parameter Description Example
Lib_S_Dwg_Obj Graphics Object that points to the drawing.
Lib_S_Label Text Label ("X1", "X2", etc.) in quotes.
Lib_S_Value Text Value ("1 MHz", "100 MHz", "7.035 KHz", etc.) in quotes.
Lib_S_Label_Pos Label/Value Position ("Norm" or "Flip") in quotes. Default is "".
Lib_S_Rot Rotate Right - ("R0", "R90") in quotes.
Lib_S_Start_X Symbol Start X Position
Lib_S_Start_Y Symbol Start Y Position

Return: The draw function will return the end X and Y values for the symbol, in a array.

Usage: Set the start X and Y values for the symbol. The draw function will return the end X and Y values as a array. Change all of the variable prefixes, e.g. C1 to C2, for each instance of the symbol. This keeps the variables unique for later use.

X1_Start_X = 100; X1_Start_Y = 240;
var X1_XY_Return = [X1_End_X, X1_End_Y] = Crystal( Lib_S_Dwg_Obj, "X1", "7.035 KHz", "Norm", "R0", X1_Start_X, X1_Start_Y );



Transformer

Description: Draws a Transformer starting at point Lib_S_Start_X, Lib_S_Start_Y. This point is the upper left winding of the transformer. Lib_S_Label passes the part designator (T1, T2, etc.). Lib_S_In_Value and Lib_S_Out_Value are used to pass the input and output voltages, respectively.

Transformer( Lib_S_Dwg_Obj, Lib_S_Label, Lib_S_In_Value, Lib_S_Out_Value, Lib_S_Start_X, Lib_S_Start_Y );
Parameter Description Example
Lib_S_Dwg_Obj jsGraphics Object that points to the drawing.
Lib_S_Label Text Label ("T1", "T2", etc.) in quotes.
Lib_S_In_Value Text Value ("120VAC", "220VAC", etc.) in quotes.
Lib_S_Out_Value Text Value ("12", "6.3", etc.) in quotes.
Lib_S_Start_X Symbol Start X Position
Lib_S_Start_Y Symbol Start Y Position

Return: The draw function will return the X and Y end points of each terminal (A, B, C, and D).

Usage: Set the start X and Y values for the symbol. Change all of the variable prefixes, e.g. T1 to T2, for each instance of the symbol. This keeps the variables unique for later use.

T1_Start_X = 100; T1_Start_Y = 240;
var T1_XY_Return = [T1_A_X,T1_A_Y,T1_B_X,T1_B_Y,T1_C_X,T1_C_Y,T1_D_X,T1_D_Y] = Transformer( TX_Sample, "T1", Lib_S_In_Value, Lib_S_Out_Value, T1_Start_X, T1_Start_Y );



SW SPST

Description: Draws a SPST Switch starting at point Lib_S_Start_X, Lib_S_Start_Y. Drawing is "up" or "right" based on Lib_S_Rot. End point lables, Lib_S_In_Label and Lib_S_Out_Label, can be blanked by passing "".

SW_SPST( Lib_S_Dwg_Obj, Lib_S_Label, Lib_S_In_Label, Lib_S_Out_Label, Lib_S_Rot, Lib_S_Start_X, Lib_S_Start_Y );
Parameter Description Example
Lib_S_Dwg_Obj jsGraphics Object that points to the drawing.
Lib_S_Label Text Label ("S1", "S2", etc.) in quotes.
Lib_S_In_Label Text Value ("A", etc.) in quotes.
Lib_S_Out_Label Text Value ("B", etc.) in quotes.
Lib_S_Rot Text Value ("R0" = Horizontal, "R90" = Vertical) in quotes.
Lib_S_Start_X Symbol Start X Position
Lib_S_Start_Y Symbol Start Y Position

Return: The draw function will return the X and Y end point.

Usage: Set the start X and Y values for the symbol. Change all of the variable prefixes, e.g. T1 to T2, for each instance of the symbol. This keeps the variables unique for later use.

S1_Start_X = 100; S1_Start_Y = 240;
var S1_XY_Return = [S1_End_X, S1_End_Y] = SW_SPST( Lib_S_Dwg_Obj, "S1", "A", "B", "0", S1_Start_X, S1_Start_Y );



SW DPDT

Description: Draws a DPDT Switch starting at point Lib_S_Start_X, Lib_S_Start_Y. Drawing is "up" or "right" based on Lib_S_Rot. End point lables, Lib_S_In_Label and Lib_S_Out_Label, can be blanked by passing "".

SW_DPDT( Lib_S_Dwg_Obj, Lib_S_Label, Lib_S_In_Label, Lib_S_Out_Label, Lib_S_Rot, Lib_S_Start_X, Lib_S_Start_Y );
Parameter Description Example
Lib_S_Dwg_Obj jsGraphics Object that points to the drawing.
Lib_S_Label Text Value ("S1", "S2", etc.) in quotes.
Lib_S_Section Text Value ("A" or "B") in quotes.
Lib_S_Rot Text Value ("R0" = Horizontal, "R90" = Vertical) in quotes.
Lib_S_Start_X Symbol Start X Position Show/Hide Pins - Mark the I/O pins
with a green dot.   
Lib_S_Start_Y Symbol Start Y Position

Return: The draw function will return the X and Y end point.

Usage: Set the start X and Y values for the symbol. Change all of the variable prefixes, e.g. S1 to S2, for each instance of the symbol. This keeps the variables unique for later use.

S1A_Start_X = 100; S1A_Start_Y = 240;
var S1A_XY_Return = SW_DPDT( Lib_S_Dwg_Obj, "S1", "A", "R0", S1_Start_X, S1_Start_Y );



Fuse

Description: Draws a Fuse starting at point Lib_S_Start_X, Lib_S_Start_Y. Drawing is "R0" or "R90" based on Lib_S_Rot.

Fuse( Lib_S_Dwg_Obj, Lib_S_Label, Lib_S_Value,Lib_S_Rot, Lib_S_Start_X, Lib_S_Start_Y );
Parameter Description Example
Lib_S_Dwg_Obj jsGraphics Object that points to the drawing.
Lib_S_Label Text Label ("F1", "F2", etc.) in quotes.
Lib_S_In_Label Text Value ("1 Amp", 0.5 A, etc.) in quotes.
Lib_S_Rot Text Value ("R0" = Horizontal, "R90" = Vertical) in quotes.
Lib_S_Start_X Symbol Start X Position
Lib_S_Start_Y Symbol Start Y Position

Return: The draw function will return the X and Y end point.

Usage: Set the start X and Y values for the symbol. Change all of the variable prefixes, e.g. F1 to F2, for each instance of the symbol. This keeps the variables unique for later use.

F1_Start_X = 100; F1_Start_Y = 240;
var F1_XY_Return = [F1_End_X, F1_End_Y] = Fuse( Lib_S_Dwg_Obj, "F1", "1 Amp", "R0", F1_Start_X, F1_Start_Y );