List of all text variables available in nightly builds

Some time ago there was a topic listing text variables: New string replacement options for kicad assets

Would it be possible to have an updated list based on the current nightly codebase?
Or perhaps there is an easy way to search for built-in text variables in the code?

See updated list below…

3 Likes

Perfect, thank you, Jeff!

This may be off topic. Is there a way to expand these values on the command line? for example, run “kicad -E ${schematic_version}” get the schematic_version. by this you will be able to define a variable in kicad and use it both in and out of kicad. Thanks.

System variables for symbol text:
REFERENCE
VALUE
FOOTPRINT
FOOTPRINT_LIBRARY
FOOTPRINT_NAME
DATASHEET
SYMBOL_LIBRARY
SYMBOL_NAME
SYMBOL_DESCRIPTION
SYMBOL_KEYWORDS
UNIT
user-defined fields by name

System variables for label text:
CONNECTION_TYPE (global labels, hierarchical labels and sheet pins only)
SHORT_NET_NAME
NET_NAME
NET_CLASS
INTERSHEET_REFS (global labels only)
user-defined fields by name

System variables for sheet text:
# (sheet number)
## (sheet count)
SHEETPATH
SHEETNAME
SHEETFILENAME
user-defined fields by name

System variables for schematic text:
# (sheet number)
## (sheet count)
SHEETPATH
SHEETNAME
FILENAME
PROJECTNAME

System variables for footprint text:
REFERENCE
VALUE
LAYER
FOOTPRINT_LIBRARY
FOOTPRINT_NAME
associated symbol’s fields by name

System variables for PCB text:
LAYER

System variables for worksheet text:
KICAD_VERSION
# (sheet number)
## (sheet count)
SHEETNAME
FILENAME
PAPER
LAYER
ISSUE_DATE
REVISION
TITLE
COMPANY
COMMENT0, COMMENT1COMMENT9

You can also search the code for ::ResolveTextVar.

7 Likes

System variables for symbol text:
REFERENCE
VALUE
FOOTPRINT
FOOTPRINT_LIBRARY
FOOTPRINT_NAME
DATASHEET
SYMBOL_LIBRARY
SYMBOL_NAME
SYMBOL_DESCRIPTION
SYMBOL_KEYWORDS
UNIT
EXCLUDED_FROM_BOM
EXCLUDED_FROM_BOARD
user-defined fields by name

System variables for label text:
CONNECTION_TYPE (global labels, hierarchical labels and sheet pins only)
SHORT_NET_NAME
NET_NAME
NET_CLASS
INTERSHEET_REFS (global labels only)
user-defined fields by name

System variables for sheet text:
# (sheet number)
## (sheet count)
SHEETPATH
SHEETNAME
SHEETFILENAME
user-defined fields by name

System variables for schematic text:
# (sheet number)
## (sheet count)
SHEETPATH
SHEETNAME
FILENAME
PROJECTNAME

System variables for footprint text:
REFERENCE
VALUE
LAYER
FOOTPRINT_LIBRARY
FOOTPRINT_NAME
NET_NAME(<pad number>)
NET_CLASS(<pad number>)
PIN_NAME(<pad number>)
associated symbol’s fields by name

System variables for PCB text:
LAYER

System variables for worksheet text:
KICAD_VERSION
# (sheet number)
## (sheet count)
SHEETNAME
FILENAME
PAPER
LAYER
ISSUE_DATE
REVISION
TITLE
COMPANY
COMMENT0, COMMENT1COMMENT9

You can also search the code for ::ResolveTextVar.

4 Likes