CalcTree Help Pages
  • What is CalcTree?
  • Getting started
    • CalcTree Pages
    • Create a CalcTree Page
    • Add a calculation
    • Collaborate with a colleague
  • Calculations
    • Parameters
      • Math formulas
        • Parameter Data Types
        • Native Functions
          • Arithmetic Functions
          • Trigonometric Functions
          • Logical & Comparison Functions
          • Matrix & Vector Functions
          • Probability & Combinatorics Functions
          • Statistical Functions
          • String Functions
          • Utility Functions
          • Other Native Functions
        • Valid Expression Syntax
      • Supported Units
      • Dropdown List Parameters
        • Linking CSV Data to Dependent Dropdowns in CalcTree
      • Parameter Settings
    • Integrations
      • Python in CalcTree
        • Adding a Python Source
        • Defining Parameters in Python
        • Referencing Other Parameters in Python
        • Working with Units in Python
        • Creating Tables and Visuals in Python
        • Consuming Files in Python
        • Using Pre-installed Python Libraries
      • Spreadsheets [Coming Soon!]
      • File Upload
        • CSV files
      • 3rd Party Software Plugins
        • Excel
        • Grasshopper
        • ETABS [v20 & v21]
        • ETABS [v22]
        • SAP 2000
        • CSI Bridge [v26]
    • Templates [Coming Soon!]
    • Optimising your calculations
  • Pages & Reports
    • CalcTree Documents
    • Static content
    • Parametric content
      • Parametric equation
      • Inputs
      • Outputs
  • Export to PDF
  • API
    • GraphQL API
      • Generating an API key
      • Queries
        • GetCalculation
        • Calculate
      • Examples
        • Bulk calculations with Python
  • Collaborate
    • Add members
    • Review and approval
    • Add stakeholders
  • Administrate
    • CalcTree Workspace
    • Versioning and Audit trail
  • CalcTree for System Administrators
Powered by GitBook
On this page
  • How It Works
  • Example
  • Notes
  1. Calculations
  2. Integrations
  3. Python in CalcTree

Referencing Other Parameters in Python

Use parameters defined on the page directly in your Python script by referencing them by name.

PreviousDefining Parameters in PythonNextWorking with Units in Python

Last updated 1 day ago

How It Works

Any parameter created on your CalcTree page is automatically available in Python. To use it, simply start typing the parameter name in your script—it will appear in the editor’s autocomplete suggestions.

This is how you pass data from the rest of the page into Python.

Example

Assume you have two parameters defined elsewhere:

  • width = 100 mm

  • height = 2.5 m

In Python:

area = width * height

The result is a unit-aware calculation, and the area variable will be added as a new Python output parameter.

Notes

  • You do not need to re-declare or wrap input parameters with ct.quantity()—they are already unit-aware.

  • If the parameter name is misspelled or undefined, you’ll receive an error at runtime.

  • This linking works across all source types: MathJS, spreadsheet tables, dropdowns, and other Python blocks.