Skip to main content

Multi-unit components

For components that have a larger number of pins, it might be easier to split up the component into different units.

Defining multi-unit components

To split a component into different units, use the unit property within the create component command.

Multiple unit properties can be defined to create additional symbols in the circuit.

my_large_component = create component:
unit:
pins:
1: "A"
2: "B"
3: "C"
unit:
pins:
4: "D"
5: "E"
6: "F"

at my_large_component pin "A"

at my_large_component pin "D"
A1C3B2J1AD4F6E5J1B

Selecting component unit

There is not need to specifically select a unit, when the component's pin is referenced, the corresponding unit will be automatically selected.

In this example below, when pin "E" is referenced, the correct unit (J1B) is used.

from std import *

gnd = dgnd()

my_large_component = create component:
unit:
pins:
1: "A"
2: "B"
3: "C"
unit:
pins:
4: "D"
5: "E"
6: "F"

at my_large_component pin "A"
wire right 200 to pin "D"

at my_large_component pin "E"
wire right 100 down 100
to gnd
A1C3B2J1AD4F6E5J1BGND

This automatic selection of component units makes it easier to think it terms of the component itself rather than specific units.

Unit reference designator suffix

Each unit will have a alphabetical suffix that corresponds to the order that it is defined in the create component command.

In this example below, the first unit is assigned "J1A", the second defined unit is assigned "J1B" and the third defined unit is assigned "J1C".

my_large_component = create component:
unit:
pins:
1: "A"
2: "B"
3: "C"
unit:
pins:
7: "G"
8: "H"
9: "I"
unit:
pins:
4: "D"
5: "E"
6: "F"

at my_large_component pin "A"
at my_large_component pin "E"
at my_large_component pin "I"
A1C3B2J1AD4F6E5J1CG7I9H8J1B

Custom suffix

It is possible to overwrite the unit suffix by using the suffix property within the unit property.

my_large_component = create component:
unit:
suffix: "Z"
pins:
1: "A"
2: "B"
3: "C"
unit:
pins:
4: "D"
5: "E"
6: "F"

at my_large_component pin "A"
at my_large_component pin "D"
A1C3B2J1ZD4F6E5J1B

Unit properties

These properties determine the pins within the unit symbol and also how the unit pins are arranged.

NameDescription
pinsIf a single number is specified, the number of pins will be automatically created. Otherwise, pins with the given ID and names will be generated.
displaySpecify the graphic to display as the symbol of the component. If unspecified, a default rectangular symbol is generated.
arrangeIf display is not specified, then the arrangement of pins must be specified.
angleSets the default angle of the component's graphical symbol. Please refer to this page on how angles are specified.
suffixSets a given refdes suffix to the given unit.