Skip to main content

Descriptions

Each attribute and constraint object has a defined value. For attributes, this includes the unit, the type of value, and any associated equations. For constraints, the value is simply a boolean statement. These values can either be simple scalar values, supported arrays, or complex mathematical relations involving values from other objects.
Special handling is applied when resolving values containing strings of TBD (To Be Determined). This can be useful during the early stages of model formation to not resolve errors when the value is still being defined.

Named State Values

Use [attribute-uuid].state([state-uuid]) to read an attribute’s effective value for one explicit state:
The receiver must be an Attribute and the argument must be a State. State equations are resolved before lookup. Davinci then applies the normal effective-state behavior: triggered states roll up, parent-state values are inherited, and the attribute’s default value is used when no state override applies. An errored state dependency produces an equation error instead of a partial value. Valid named States include direct and recursively nested State/Action branches owned by the Attribute’s host. Traversal remains inside those branches, so it does not include States owned by nested Parts or unrelated model objects. This accessor selects the named state even when the surrounding equation is being evaluated in a different ambient state. It is value access, not code execution. [attribute].state(...) reads state data; [code].method(...) executes a Code object. Arrays remain arrays, so select a 1-based index or use a reduction such as min(), max(), or mean() when a scalar is required.

Math Syntax

Equations are powered by Math.js, providing a comprehensive set of mathematical operations and functions. The syntax follows standard mathematical conventions:

Basic Operations

Comparison Operators

Mathematical Functions

Trigonometric Functions

Statistical Functions

Logical Functions

or(a, b) above is a Math.js logical function used inside an equation. It is different from the whitespace-delimited clause or clause syntax used only by numeric Test evaluation-criteria targets. For example, a Test target of < -20 or > 60 matches either numeric region; it is not a Math.js expression or a general equation operator.

Constants

Value Types

Attributes can have the following kind associated to a value, which handles how it is displayed or computed:
Value TypeScalar1D array2D array3D arrayDescription
Boolean✅✅✅✅Represents true or false values. Does not use a unit and clears any existing unit.
Date✅❌❌❌Used for date values. Does not use a unit and clears any existing unit.
Number✅✅✅✅Represents standard numeric values. Optionally includes a unit.
String✅❌❌❌Represents string values. Does not use a unit and clears any existing unit.

Array Values

Equations can produce scalar values or supported array values. Arrays use bracket syntax:
Supported array shapes include:
  • 1D arrays, such as vectors.
  • 2D arrays, such as matrices.
  • 3D arrays, such as grouped matrices or tensor-like values.
Array values are supported for numbers and booleans. Strings and dates are scalar-only, so arrays of strings and arrays of dates are not supported. Numeric arrays use one shared unit for the entire array value. Individual elements do not have separate units.

Callable Code Functions

Attribute equations can call functions defined in Code objects. This lets an equation delegate calculation logic to Python or JavaScript while still using model attributes as inputs. Use the direct call syntax:
The function receives the resolved attribute values as positional arguments and returns one value. Return values can be:
  • Number
  • Boolean
  • String
  • Date
  • Numeric array
  • Boolean array
For numeric results with units, return an object with value and unit:
If a Code object used by an attribute equation changes, Davinci may mark dependent attribute values as stale until they are recomputed. The previous resolved value remains visible so downstream model content does not disappear unexpectedly.

CAD Mate Distance

Use .distance(...) on a compiled Geometry or Assembly object to measure the straight-line distance between two of its named mates:
  • Pass exactly two mate names in quotes.
  • The result is the distance between the origins of the two mates, in metres. It carries its unit, so you can compare or combine it with other lengths, such as mm, without conversion factors.
  • A part’s mates use their declared names. An assembly lists each child’s mates as instance_mate, such as bolt_headMate.
  • Compile the Geometry or Assembly before using it. If the object needs to be recompiled, or a mate name does not exist, the equation shows an error. The error for an unknown mate lists the mate names that are available.
Like .state(...), .distance(...) reads a value and does not execute code. Recompiling the object updates every equation and Test that uses the distance.

Simulation Quantities of Interest

Equations can read a Quantity of Interest (QoI) declared by a compiled simulation. Call the simulation with an argument list, then name the QoI:
  • QoI name: Write the declared QoI name with each run of spaces and punctuation replaced by _. For example, a QoI named peak trunnion torque is read as .peak_trunnion_torque.
  • Parameters: Optional name=value arguments read the QoI at a different parameter point. A value can be a number, a number with a unit, an expression, or an attribute reference. A number without a unit is read in the parameter’s declared unit. A value outside the parameter’s allowed range shows an error.
  • Field simulations: Use () with no arguments to read the QoI at the compiled default parameters. Field simulations accept 3-element vector parameters, such as [0, 0, -40], and do not take scenario=.
  • System simulations: Name the scenario with scenario=. You can omit it only when the system has a single compiled scenario.
  • Units: The result carries the QoI’s declared unit.
A simulation reference always needs the argument list and a QoI name. A bare [simulation] or [simulation].qoi_name has no value. A field simulation must be compiled and up to date. If it is stale, recompile it before its QoIs can be read. A system simulation QoI comes from a completed run at the requested point, or from a study whose surrogate covers that point. A run that ends at the scenario’s own stop condition counts as completed. If no run or study covers the point, the equation reports that the scenario must be run at that point or covered by a study. QoI references work in attribute values, risk metrics, Test Results Value equations, and constraints. In a constraint, place the QoI on the left side and a concrete limit on the right, such as [bracket-sim](F_load=500 N).max_displacement <= 2 mm. Dependent values update when the simulation is recompiled or rerun, or when a referenced parameter attribute changes.

Unit Referencing

Values can reference units inline, such as 10 kg, where the number is associated with the unit.

Object Referencing

To reference other objects within an equation, use the @ symbol followed by the object’s name. This will automatically resolve the object’s value and unit.