cmd_is_enabled()

Determines whether a specified command is enabled. The function retrieves the command using its ID.

If the command is not found, it returns None; otherwise, it returns a Boolean indicating whether the command is enabled.

Syntax

planetcnc.cmd_is_enabled(cmd_id)

Parameters

Parameter Type Description
cmd_id int The unique identifier for the command to check.

Return Value

Examples

#! /usr/bin/env python 
 
import planetcnc
 
# Check if command with ID 42 is enabled.
enabled = planetcnc.cmd_is_enabled(42)
if enabled is None:
    print("Command not found.")
elif enabled:
    print("Command is enabled.")
else:
    print("Command is disabled.")

See also

cmd_list
cmd_count
cmd_get_id
cmd_get_name
cmd_get_displayname
cmd_is_enabled
cmd_is_checked
cmd_exec