Sheets
The sheet
keyword can be used to group circuits into different sheets based on standard paper sizes.
At the start of the script, specify the type of sheet with the following code: document.sheet_type = <sheet_type_function>()
.
The standard library supports the following sheet_type_functions: sheet_A1()
, sheet_A2()
.. until sheet_A6()
Example:
import lib
# Set default sheet type to A6
document.sheet_type = sheet_A6()
vcc = supply("VCC")
gnd = dgnd()
# Sheet created with sheet A6 graphic
sheet:
..title = "Pull down resistor"
at vcc
wire down 100
add res(10k)
wire down 100
to gnd
# Another sheet with sheet A6 graphic
sheet:
..title = "Decoupling capacitor"
at vcc
wire down 100
add cap(100n)
wire down 100
to gnd
Sheet properties
Supports the title
and direction
property, similar to the frame
command.
Additionally, the revision
property is also available. This appears in the sheet title block and can be used to indicate the version of the schematic design.
import lib
# Set default sheet type to A6
document.sheet_type = sheet_A6()
vcc = supply("VCC")
gnd = dgnd()
# Sheet created with sheet A6 graphic
sheet:
..title = "My schematic"
..direction = "column"
..revision = "V1.2"
at vcc
wire down 100
add res(10k)
wire down 100
to gnd
at vcc
wire down 100
add res(10k)
wire down 100
to gnd
at vcc
wire down 100
add res(10k)
wire down 100
to gnd
Sheet layout
Circuits placed within a sheet will try to stay within the sheet area and will avoid being placed over the title block.
import lib
# Set default sheet type to A6
document.sheet_type = sheet_A6()
vcc = supply("VCC")
gnd = dgnd()
def led_circuit():
at vcc
wire right 200
add led("green")
wire right 100
add res(1k)
wire right 100
to gnd
# Sheet created with sheet A6 graphic
sheet:
..title = "Lots of LEDs"
..revision = "V1.2"
for i in range(0, 16):
led_circuit()