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

5VC1100nGND5VC2100nGND

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
C1100nC2100nSetting 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.
refdesPrefixstringSet 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
5vR130kGND

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
5vRX120kGND

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
5vR120kGND