backend-substitution

backend-substitution(backend) = my-symbol with backend in {"Kicad, "Altium"} allows symbols to be substituted by other symbols when exported to a particular CAD tool, namely Kicad or Altium that has a restricted set of power symbols. Altium ground and supply symbols are in the ocdb/utils/symbols package of the open-components-database repository.

Syntax

public pcb-symbol ground-sym :
  pin p[0] at unit-point(0.0, 0.0)
  
  unit-line([[0.0, 0.0], [0.0, -0.5]])
  unit-line(0.1, [[-0.5, -0.5], [0.5, -0.5]])
  unit-line(0.1, [[-0.3, -0.7], [0.3, -0.7]])
  unit-line(0.1, [[-0.1, -0.9], [0.1, -0.9]])

  unit-val([-1.0, -1.5])
  preferred-orientation = PreferRotation([0])
  backend-substitution("Altium") = altium-ground-sym

Description

The standard ground symbol ground-sym defined in the ocdb/utils/symbols package of the open-components-database is automatically replaced by the altium-ground-sym symbol everywhere it is used when exporting the schematics to Altium using set-export-backend("Altium") before export-cad() command.