lynx.Diagram.update_block_parameter

Diagram.update_block_parameter(block_or_id: Block | str, param_name: str, value: Any, expression: str | None = None) bool[source]

Update block parameter (with undo support).

Accepts either a Block object or a string block ID, enabling both traditional ID-based updates and natural block object updates:

# Via block object (Feature 017 - US3) diagram.update_block_parameter(diagram[“plant”], “K”, 5.0)

# Via string ID (backward compatible) diagram.update_block_parameter(“plant_id”, “K”, 5.0)

Parameters:
  • block_or_id – Block object OR block identifier string

  • param_name – Parameter name (e.g., “K”, “numerator”, “A”)

  • value – New parameter value

  • expression – Optional expression string (for hybrid storage)

Returns:

True if block and parameter were found and updated, False otherwise