Skip to main content

Var

Kind: Class
Domain: Expressions, units, and tolerances
Canonical import: from cadflow import Var

Signature

class Var(name: 'str', default: 'float', comment: 'str | None' = None, expr_id: 'str' = <factory>, tolerance: 'DimensionTolerance | None' = None, unit: 'Unit | None' = None, tolerance_unit: 'Unit | None' = None) -> None

Description

Named scalar parameter with optional physical-unit and tolerance intent.

Named scalar parameter with optional physical-unit and tolerance intent.

default and tolerance remain in their declared units. Evaluation, geometry parameters, and tolerance propagation convert them to CadFlow's canonical CAD units: millimeters for length and degrees for angle.

Parameters

NameTypeRequiredDefaultSource description
name'str'yes-Not explicitly described in the source docstring.
default'float'yes-Not explicitly described in the source docstring.
comment'str | None'noNoneNot explicitly described in the source docstring.
expr_id'str'no&lt;factory&gt;Not explicitly described in the source docstring.
tolerance'DimensionTolerance | None'noNoneNot explicitly described in the source docstring.
unit'Unit | None'noNoneNot explicitly described in the source docstring.
tolerance_unit'Unit | None'noNoneNot explicitly described in the source docstring.

Returns

Type: None

The source docstring does not declare additional return semantics.

Errors

The source docstring does not declare a narrower exception contract. Invalid types, values, ownership, paths, or backend state may still raise the corresponding public error.

Data fields

NameTypeDefault
name'str'required
default'float'required
comment'str | None'None
expr_id'str'factory
tolerance'DimensionTolerance | None'None
unit'Unit | None'None
tolerance_unit'Unit | None'None

Public members

MemberKindSignatureDescription
canonical_defaultproperty-See the member signature.
canonical_toleranceproperty-See the member signature.
dimensionproperty-See the member signature.
evaluatemethod(self, bindings: 'Mapping[str, float] | None' = None) -&gt; 'float'See the member signature.

Behavior and constraints

  • Instances are immutable dataclass values; update workflows return a replacement value.

Import check

from cadflow import Var

See also