Skip to main content

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

line 7:15VComponent C1: line 5:1C1100nline 11:4GNDline 16:55VComponent C2: line 18:5C2100nline 21:8GND

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
Component C1: line 6:5C1100nComponent C2: line 13:5C2100nSetting parameter with variable nameSetting parameter with double dot operator

Supported component parameters​

Parameter nameParameter typeDescription
placebooleanWhen true, the component will be shown as placed in the schematic. If set to false, a cross will be displayed on the schematic.
footprintstringPath or name of the footprint file/data.
mpnstringManufacturer part number for the component
valuestring/numeric valueFor typical passive components (resistors, capacitors and inductors), you may use numeric values like: 10k, 20n, etc.
refdesstringSet the reference designator for the component manually.
refdes_prefixstringSet 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
line 6:15vComponent R1: line 9:1R130kline 14:4GND

refdes_prefix parameter​

The refdes_prefix 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)
..refdes_prefix = "RX"

wire down 100
to gnd
line 6:15vComponent RX1: line 10:1RX120kline 14:4GND

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
line 6:15vComponent R1: line 9:1R120kline 13:4GND