Skip to main content

Clamp

Clamp a number between two values

Written by Holly Conrad Smith

Use this when you want to constrain a value within a flow so it never falls outside a minimum or maximum, for example capping floor count or setback distance.

Inputs

Name

Abbreviation

Type

Access

Description

Value

V

Number

Item

The value to clamp (optional, default 0)

Min

M

Number

Item

The minimum value (optional, default 0)

Max

M

Number

Item

The maximum value (optional, default 1)

Outputs

Name

Abbreviation

Type

Access

Description

Clamped

C

Number

Item

The clamped value

How to

  1. Feed in a number to the value

  2. Feed in a number to the Min, or type one into the text box.

  3. Feed in a number to the Max, or type one into the text box.

  4. The result is the clamped value.

    If the value is between the min and max, the result is the original value.

    If the value is below the min, then the value is changed to the min

    If the value is above the max, then the value is changed to the max.

Did this answer your question?