Skip to content
AlphaToolBox3D is in early alpha: features are incomplete and things can break. Use it at your own risk and keep copies of your files. Report a problem
ToolBox3D

Docs · Python API

tb.ops.measurement

7 operations. Without targets=, an operation works on the current selection, like its button in the editor.

Measure Angle

tb.ops.measurement.create_angle(*, first: Any, second: Any) -> Result

A live angle between two directions: face normals ({"node", "face"}: the face's stable id) and / or curve tangents ({"node", "spline"?, "parameter"}). It follows the objects as they move or are edited. One undo step.

  • Operation measurement.create_angle
  • In Model
ArgumentTypeDefaultDescription
firstAnyrequiredThe first face or curve point.
secondAnyrequiredThe second face or curve point.

Measure Arc Length

tb.ops.measurement.create_arc_length(
    *,
    parameter: float,
    spline: int = ...,
    node: ObjectRef,
) -> Result

A live dimension showing the length along a curve from its start to a draggable point. One undo step.

  • Operation measurement.create_arc_length
  • In Model
ArgumentTypeDefaultDescription
parameterfloatrequiredNormalized curve parameter of the point (0 = start, 1 = end). (factor; 0…1).
splineint—Stable spline id within the curve (default: its first spline). (1…4294967295).
nodeObjectRefrequiredThe curve object.

Measure Distance

tb.ops.measurement.create_distance(
    *,
    start: Vec3Like = ...,
    start_locator: ObjectRef = ...,
    end: Vec3Like = ...,
    end_locator: ObjectRef = ...,
) -> Result

Bind a live distance dimension to two locators, creating a locator at each clicked point unless an existing locator is given. Moving either locator updates the value. The locators and the dimension are one undo step.

  • Operation measurement.create_distance
  • In Model
ArgumentTypeDefaultDescription
startVec3Like—World point (metres) for a new start locator. (scene units).
start_locatorObjectRef—Existing locator to bind as the start (instead of start).
endVec3Like—World point (metres) for a new end locator. (scene units).
end_locatorObjectRef—Existing locator to bind as the end (instead of end).

Measure Curve Parameter

tb.ops.measurement.create_parameter(
    *,
    parameter: float,
    spline: int = ...,
    node: ObjectRef,
) -> Result

A live dimension showing the normalized parameter of a draggable point on a curve. One undo step.

  • Operation measurement.create_parameter
  • In Model
ArgumentTypeDefaultDescription
parameterfloatrequiredNormalized curve parameter of the point (0 = start, 1 = end). (factor; 0…1).
splineint—Stable spline id within the curve (default: its first spline). (1…4294967295).
nodeObjectRefrequiredThe curve object.

Delete Measurement

tb.ops.measurement.delete(*, annotation: str) -> Result

Delete a measurement annotation. Locators bound to a distance dimension stay in the scene.

  • Operation measurement.delete
  • In Model
ArgumentTypeDefaultDescription
annotationstrrequiredAnnotation.

Rebind Distance

tb.ops.measurement.rebind_locators(
    *,
    annotation: str,
    expected_version: str,
    start: Vec3Like = ...,
    start_locator: ObjectRef = ...,
    end: Vec3Like = ...,
    end_locator: ObjectRef = ...,
) -> Result

Rebind a distance dimension's start and/or end to another locator or to a new locator at a point; an end not given keeps its binding. The new locators and the rebinding are one undo step.

  • Operation measurement.rebind_locators
  • In Model
ArgumentTypeDefaultDescription
annotationstrrequiredAnnotation.
expected_versionstrrequiredThe annotation version this edit starts from; a superseded version refuses.
startVec3Like—World point (metres) for a new start locator. (scene units).
start_locatorObjectRef—Existing locator to bind as the start (instead of start).
endVec3Like—World point (metres) for a new end locator. (scene units).
end_locatorObjectRef—Existing locator to bind as the end (instead of end).

Move Curve Dimension Point

tb.ops.measurement.set_curve_point(
    *,
    annotation: str,
    expected_version: str,
    parameter: float = ...,
    spline: int = ...,
    node: ObjectRef = ...,
) -> Result

Move the point of an arc length or parameter dimension along its curve, or bind it to another curve (node) — the Rebind of a dimension whose curve was deleted. Drags preview and accept as one undo step.

  • Operation measurement.set_curve_point
  • In Model
ArgumentTypeDefaultDescription
annotationstrrequiredAnnotation.
expected_versionstrrequiredThe annotation version this edit starts from; a superseded version refuses.
parameterfloat—Normalized curve parameter of the point (0 = start, 1 = end). (factor; 0…1).
splineint—Stable spline id within the curve (default: its first spline). (1…4294967295).
nodeObjectRef—Bind to this curve object instead (Rebind).