Component parameters
These parameters may determine the value of the component, whether the component is shown as placed or not placed, etc.
place parameter
Example:
from "std" import *
v5v = supply("5V")
gnd = dgnd()
C1 = cap(100n)
at v5v
wire down 100
add C1
wire down 100
to gnd
C1.place = false
frame:
at v5v
wire down 100
add cap(100n)
..place = false
wire down 100
to gnd
Double dot operator
The double dot operator (..) can be used to modify parameters at the current cursor point. In the example below, pin 1 of C1 is the cursor point before the double dot. This operator can be used to reference components without assigning specific variable names to them.
Example
from "std" import *
frame:
..title = "Setting parameter with variable name"
my_cap = cap(100n)
at my_cap
my_cap.place = false
frame:
..title = "Setting parameter with double dot operator"
at cap(100n)
..place = false
Supported component parameters
| Parameter name | Parameter type | Description |
|---|---|---|
place | boolean | When true, the component will be shown as placed in the schematic. If set to false, a cross will be displayed on the schematic. |
footprint | string | Path or name of the footprint file/data. |
mpn | string | Manufacturer part number for the component |
value | string/numeric value | For typical passive components (resistors, capacitors and inductors), you may use numeric values like: 10k, 20n, etc. |
refdes | string | Set the reference designator for the component manually. |
refdesPrefix | string | Set a custom reference designator prefix for the component. Overrides the default prefix based on component type. |
Example:
from "std" import *
v5v = supply("5v")
gnd = dgnd()
at v5v
wire down 100
add res(20k)
..value = 30k # Change the value of resistor
..mpn = "res-123456"
wire down 100
to gnd
refdesPrefix parameter
The refdesPrefix parameter allows you to set a custom prefix for the reference designator. By default, components use standard prefixes based on their type (R for resistors, C for capacitors, U for ICs, etc.). This parameter lets you override the default prefix.
Example:
from "std" import *
v5v = supply("5v")
gnd = dgnd()
at v5v
wire down 100
# This resistor will use "RX" as prefix (e.g., RX1, RX2)
add res(20k)
..refdesPrefix = "RX"
wire down 100
to gnd
This is useful when you want to group components differently or follow a specific naming convention in your design.
KiCad footprints
If KiCad footprints are assigned to the component footprint parameter, these will be set accordingly when the netlist is generated.
KiCad footprints are specified in the format <Library>:<FootprintName>. For example, the common 0402 size resistor has the KiCad footprint path of Resistor_SMD:R_0402_1005Metric.
from "std" import *
v5v = supply("5v")
gnd = dgnd()
at v5v
wire down 100
add res(20k)
..footprint = "Resistor_SMD:R_0402_1005Metric"
wire down 100
to gnd