param_get()

Retrieves a global or local parameter from the PlanetCNC application's parameter storage.

The function takes a parameter name as a string, looks up its value and returns it.

Value can be float or string.

Syntax

planetcnc.param_get(name)
planetcnc.param_get(name, index)

Parameters

Parameter Type Description
name str The name of the parameter whose value should be retrieved.
index int Parameter index (Optional).

Return Value

Examples

#! /usr/bin/env python 
 
import planetcnc
 
# List slots and assigned tools
slot_count = planetcnc.param_get("_slot_count")
for slot_idx in range(slot_count):
    slot_num = planetcnc.param_get("_slot_get", slot_idx)
    tool_num = planetcnc.param_get("_slot_tool", slot_num)
    print(f"Slot {slot_num} has number{slot_num} and assigned tool {tool_num}.")

See also

param_get
param_set
param_remove
param_persistent