Autodesk Creative Platform Core Version 1.19.0
A broad and deep collection of 2D and 3D capabilities.

LengthParameterJSON Overview

Inherits Classes: ParameterJSON

A parameter that represents the length. Based on user preferences, it will be displayed as inches or millimeters. The value returned to processing function will always be in millimeters.

1 Example:

var params = [
  {
    "id": "radius",
    "displayName": "Radius",
    "type": "length",
    "rangeMin": 1,
    "rangeMax": 50,
    "default": 20
  };
];

JSON Field Summary

  • property
      default | Required
  • property
      displayUnit | Optional , Default: undefined
  • property
      displayValue | Optional , Default: true
  • property
      rangeMax | Optional , Default: 1
  • property
      rangeMin | Optional , Default: 0
  • property
      steps | Optional , Default: 1
  • property
      ticks | Optional
  • property
      displayIcon | Optional
  • property
      displayName | Required
  • property
      id | Required
  • property
      invalid | Optional , Default: "" , Coming Soon!
  • property
      type | Required
  • property
      validate | Optional , Default: false , Coming Soon!
  • property
      visible | Optional , Default: true , Coming Soon!

JSON Field Details

Number default | Required

The default value for the parameter expressed in millimeters. The value of this parameter when accessed through IShapeGenerator.preview, IShapeGenerator.evaluate or IShapeGenerator.validate will be the same type.

String displayUnit | Optional , Default: undefined

Allows the developer to force a particular unit of length to be displayed, regardless of user unit preferences. This is often necessary when designs for things like Metric or English parts require a certain value such as bolt lengths or diameters. The actual value of the parameter is always internally provided in millimeters, however the value presented to the user would be automatically converted to the appropriate value based on the unit. The acceptable values for this property are:

  • ft (Foot)
  • in (Inch)
  • m (Meter)
  • cm (Centimeter)
  • mm (Millimeter)

Boolean displayValue | Optional , Default: true

Indicates whether the underlying parameter value should be displayed to the user.

Number rangeMax | Optional , Default: 1

The maximum value for the parameter slider expressed in millimeters (inclusive). Users can still enter larger values however, so the processing code needs to safeguard against that scenario.

Number rangeMin | Optional , Default: 0

The minimum value for the parameter slider expressed in millimeters (inclusive). Users can still enter smaller values however, so the processing code needs to safeguard against that scenario.

Number or Array [ Number ] steps | Optional , Default: 1

When an array is supplied, it explicitly defines the allowable values for the input. When a number is supplied, it identifies allowable values based on integer multiples of the number supplied, starting with rangeMin.

Array [ Number ] ticks | Optional

This property allows the developer to specify where visual indicators appear for numberline tick marks. This does not prevent a user from manually entering a value that does not coorespond with one of the predefined tick marks.