Skip to content

MV Cable Parts ​

An MV cable is a chain of parts, each with its own length and cable type. This example builds a cable between two substations out of an aluminium part and a copper XLPE part.

Full Example

View the complete code: 17_mv_cable_parts.py

The Cable ​

A new CableMV starts with no parts, types or presentations, so it needs only its general data and a drawing:

python
cable = CableMV(
    CableMV.General(name="Kerkplein - Molenweg", node1=kerkplein.general.guid, node2=molenweg.general.guid),
    presentations=[BranchPresentation.between(kerkplein, molenweg, sheet)],
)

Adding the Parts ​

add_part() looks the cable type up in the type library by name or alias and adds a part of the given length in metres:

python
# The original aluminium run, with the stretch under the Molenweg renewed in copper XLPE
cable.add_part(types, "3*150 AL Kudi 6/10", length=340)
cable.add_part(types, "3*150 CU XLPE   6/10", length=120)
network.add(cable)

Each call appends the part to cable_parts and its type data to cable_types, so cable_parts[i] belongs to cable_types[i]. An unknown name raises UnknownTypeError.

python
for part in cable.cable_parts:
    logger.info("%s m of %s", part.length, part.cable_type)
340 m of 3*150 AL Kudi 6/10
120 m of 3*150 CU XLPE   6/10

Next Steps ​