ParamML Functions Reference

Overview

ParamML provides a comprehensive set of built-in functions that can be used within expressions to perform calculations, manipulate geometry, convert units, and query parametric models. This guide documents all available functions for AI agents creating ParamML expressions.

Key Concepts:

  • Functions are called within ParamML expressions using standard syntax: functionName(arg1, arg2, ... )

  • Functions are implemented in the ExprProvFunctionCall method (Param.ts:655arrow-up-right)

  • Some functions are context-dependent (require specific modules like FEA, SEC, or OpenBrIM to be loaded)

  • All functions are case-sensitive

ParamML Operators: ParamML uses standard JavaScript-like operators for expressions:

  • Comparison Operators: <, >, <=, >=, ==, !=

  • Logical Operators: && (AND), || (OR), ! (NOT)

  • Arithmetic Operators: +, -, *, /, %, ^ (power)

  • Ternary Operator: condition ? value1 : value2

  • Unary Operators: - (negation), ! (logical NOT), + (positive)

Example:

<P N="IsValid" V="Width > 0 && Height > 0 ? 1 : 0"/>
<P N="NeedsReinforcement" V="Stress >= AllowableStress || Depth < MinDepth"/>
<P N="Power" V="Base ^ Exponent"/>

Function Categories:


Array/List Operations

length(list)

Returns the number of elements in an array or list.

Parameters:

  • list (Array): The array to measure

Returns: Number - The count of elements

Example:

Related: first(), last()


parent(obj)

Returns the parent object of the given object in the hierarchical tree.

Parameters:

  • obj (Object): The object whose parent to retrieve

Returns: Object - The parent object

Example:


project()

Returns the root project object (top of the object hierarchy).

Parameters: None

Returns: Object - The root project object

Example:


getlistitem(list, index) / listitem(list, index)

Accesses an element at a specific index in a list. Supports multi-dimensional indexing.

Parameters:

  • list (Array): The array to access

  • index (Number or multiple Numbers): The index/indices to retrieve

Returns: Any - The element at the specified index

Example:

Related: first(), last()


last(list)

Returns the last element of an array.

Parameters:

  • list (Array): The array to query

Returns: Any - The last element

Example:

Related: first(), length()


first(list)

Returns the first element of an array.

Parameters:

  • list (Array): The array to query

Returns: Any - The first element

Example:

Related: last(), length()


list(args...)

Creates a new list from the provided arguments.

Parameters:

  • args... (Any): Variable number of arguments to combine into a list

Returns: Array - A new list containing all arguments

Example:


sum(list, startIndex?, endIndex?)

Calculates the sum of numeric elements in an array.

Parameters:

  • list (Array): The array of numbers to sum

  • startIndex (Number, optional): Starting index (default: 0)

  • endIndex (Number, optional): Ending index (default: array length)

Returns: Number - The sum of elements

Example:

Related: length()


mergel(listOfLists)

Merges nested lists into a single flat list.

Parameters:

  • listOfLists (Array of Arrays): Nested array structure

Returns: Array - Flattened array

Example:

Related: concat()


concat(list1, list2, ...)

Concatenates multiple arrays into a single array. Can accept any number of arrays (not limited to two).

Parameters:

  • list1, list2, ... (Arrays): Arrays to concatenate

Returns: Array - Combined array containing all elements in order

Example:

Notes:

  • Accepts unlimited number of array arguments

  • Elements appear in order of arrays provided

  • Duplicate values are preserved (not removed)

Related: mergel()


refine(list, refinement)

Refines a list by interpolating additional points between existing elements. Works only on simple number lists, not on point/coordinate lists.

Parameters:

  • list (Array of Numbers): The list to refine (must be simple number array, not point array)

  • refinement (Number): Maximum spacing between refined values

Returns: Array - Refined list with interpolated values

Example:

Notes:

  • Important: refine() only works on simple number arrays, not point/coordinate arrays

  • For point lists, extract coordinates, refine them, then reconstruct points using onlinex() or similar

  • Refinement value represents maximum spacing between output values

Related: onlinex(), map()


slice(list, start, end)

Extracts a portion of an array from start to end index.

Parameters:

  • list (Array): The source array

  • start (Number): Starting index (inclusive)

  • end (Number): Ending index (exclusive)

Returns: Array - Sliced portion of the array

Example:


Geometric Transformations

translate(point, tx, ty, tz)

Translates a point by the specified offset values.

Parameters:

  • point (Point or Array): The point to translate

  • tx (Number): Translation in X direction

  • ty (Number): Translation in Y direction

  • tz (Number): Translation in Z direction

Returns: Point - The translated point

Example:

Related: rotate()


rotate(point, rx, ry, rz, origin?)

Rotates a point (or array of points [x,y,z]) around specified axes.

Parameters:

  • point (Point or Array): The point(s) to rotate

  • rx (Number): Rotation around X axis (degrees)

  • ry (Number): Rotation around Y axis (degrees)

  • rz (Number): Rotation around Z axis (degrees)

  • origin (Point, optional): Origin point for rotation (default: [0,0,0])

Returns: Point or Array - The rotated point(s)

Example:

Related: translate()


Line/Curve Operations

online(line, x, y)

Returns a point on a line at specified local coordinates.

Parameters:

  • line (Line3D): The line object

  • x (Number): Local X coordinate along the line

  • y (Number): Local Y coordinate (offset perpendicular to line)

Returns: Point - Point on the line

Example:

Related: onlineg(), onliner(), onlinea()


onlineg(line, x, y)

Returns a point on a line in global coordinates.

Parameters:

  • line (Line3D): The line object

  • x (Number): Global X coordinate

  • y (Number): Global Y coordinate

Returns: Point - Point on the line

Example:

Related: online(), toglobal()


onliner(line, n)

Returns a point on a line at a relative position (0 to 1).

Parameters:

  • line (Line3D): The line object

  • n (Number): Relative position (0 = start, 1 = end, 0.5 = midpoint)

Returns: Point - Point on the line

Example:

Related: onlinea(), online()


onlinea(line, n)

Returns a point on a line at an absolute distance from the start.

Parameters:

  • line (Line3D): The line object

  • n (Number): Absolute distance from start

Returns: Point - Point on the line

Example:

Related: onliner(), linel()


onlinerel(line, n)

Returns a point on a line at a relative distance in the line's local direction.

Parameters:

  • line (Line3D): The line object

  • n (Number): Relative distance

Returns: Point - Point on the line

Example:

Related: onliner(), onlinea()


onlinex(line, n)

Returns a point on a line at a specific X coordinate.

Parameters:

  • line (Line3D): The line object

  • n (Number): X coordinate value

Returns: Point - Point on the line at the specified X

Example:

Related: onliney(), onlinez()


onliney(line, n)

Returns a point on a line at a specific Y coordinate.

Parameters:

  • line (Line3D): The line object

  • n (Number): Y coordinate value

Returns: Point - Point on the line at the specified Y

Example:

Related: onlinex(), onlinez()


onlinez(line, n)

Returns a point on a line at a specific Z coordinate (elevation).

Parameters:

  • line (Line3D): The line object

  • n (Number): Z coordinate value

Returns: Point - Point on the line at the specified Z

Example:

Related: onlinex(), onliney()


oncircle(radius, x, y?, direction?)

Returns a point on a circle at specified parameters.

Parameters:

  • radius (Number): Circle radius

  • x (Number): Angle in degrees or arc length

  • y (Number, optional): Offset from circle (default: 0)

  • direction (Number, optional): Direction modifier (default: 1)

Returns: Point - Point on the circle

Example:


linel(line)

Returns the length of a line.

Parameters:

  • line (Line3D): The line object

Returns: Number - Length of the line

Example:

Related: perimeter(), surfarea()


closestPointOnLine(line, point)

Finds the closest point on a line to a given point (projection).

Parameters:

  • line (Line3D): The line object

  • point (Point): The reference point

Returns: Point - Closest point on the line

Example:

Related: intersect()


closestLineIndex(lines, line)

Finds the index of the closest line in a collection to a given line.

Parameters:

  • lines (Array of Line3D): Collection of lines

  • line (Line3D): Reference line

Returns: Number - Index of the closest line

Example:


toglobal(line)

Converts a line from local to global coordinates.

Parameters:

  • line (Line3D): The line in local coordinates

Returns: Line3D - Line in global coordinates

Example:

Related: onlineg()


nonlinearpoints(points)

Removes collinear points from a point list, keeping only points that create non-linear segments.

Parameters:

  • points (Array of Point): List of points

Returns: Array of Point - Filtered list with collinear points removed

Example:


linesplit(line, breakIndex)

Splits a line at a specified index into two lines.

Parameters:

  • line (Line3D): The line to split

  • breakIndex (Number): Index at which to split

Returns: Array - Two lines [line1, line2]

Example:


intersect(line1, line2, plane?, rayMode?)

Finds the intersection point between two lines.

Parameters:

  • line1 (Line3D): First line

  • line2 (Line3D): Second line

  • plane (String, optional): Plane for 2D intersection ("XY", "XZ", "YZ")

  • rayMode (Boolean, optional): If true, extends lines as rays

Returns: Point - Intersection point, or null if no intersection

Example:

Related: intersectalong(), polygonLineIntersect()


intersectalong(line1, line2, extLen?, plane?)

Finds intersection between two lines with optional extension length.

Parameters:

  • line1 (Line3D): First line

  • line2 (Line3D): Second line

  • extLen (Number, optional): Extension length for lines

  • plane (String, optional): Intersection plane

Returns: Point - Intersection point

Example:

Related: intersect()


polygonLineIntersect(polygon, line, mode?)

Finds intersection points between a polygon and a line.

Parameters:

  • polygon (Surface3D): The polygon

  • line (Line3D): The line

  • mode (Number, optional): Intersection mode

Returns: Array of Point - Intersection points

Example:

Related: intersect()


Surface/Volume Operations

surfarea(surface)

Calculates the area of a surface.

Parameters:

  • surface (Surface3D): The surface object

Returns: Number - Surface area

Example:

Related: volume(), perimeter()


volumesurfareas(volume)

Returns an array of areas for all surfaces of a volume.

Parameters:

  • volume (Volume): The volume object

Returns: Array of Numbers - Areas of each surface

Example:

Related: volumesurfperimeters(), volume()


volumesurfperimeters(volume)

Returns an array of perimeters for all surfaces of a volume.

Parameters:

  • volume (Volume): The volume object

Returns: Array of Numbers - Perimeters of each surface

Example:

Related: volumesurfareas(), perimeter()


volumesideareas(volume, side)

Returns the area of a specific side of a volume.

Parameters:

  • volume (Volume): The volume object

  • side (Number or String): Side identifier

Returns: Number - Area of the specified side

Example:

Related: volumesurfareas()


volumesurfdims(volume, algorithm?, side?)

Returns dimensions of volume surfaces (width, height, etc.).

Parameters:

  • volume (Volume): The volume object

  • algorithm (Number, optional): Algorithm type for dimension calculation

  • side (Number, optional): Specific side index

Returns: Object or Array - Surface dimensions

Example:

Related: volumesurfareas()


volume(volume)

Calculates the volume of a 3D solid.

Parameters:

  • volume (Volume): The volume object

Returns: Number - Volume value

Example:

Related: surfarea()


volumeextvectorlength(volume, mode?)

Returns the length of the extrusion vector for an extruded volume.

Parameters:

  • volume (Volume): The extruded volume object

  • mode (Number, optional): Calculation mode

Returns: Number - Extrusion vector length

Example:


perimeter(surface, isOpen?)

Calculates the perimeter of a surface or boundary.

Parameters:

  • surface (Surface3D): The surface object

  • isOpen (Boolean, optional): Whether the surface is open

Returns: Number - Perimeter length

Example:

Related: surfarea(), linel()


punchingperimeter(surface, distance, boundary)

Calculates the punching shear perimeter at a distance from a boundary.

Parameters:

  • surface (Surface3D): The surface (usually a slab)

  • distance (Number): Distance from the boundary

  • boundary (Boundary): The loaded area boundary

Returns: Number - Punching perimeter length

Example:

Related: punchingperimeterlines()


punchingperimeterlines(surface, distance, boundary)

Returns the line segments forming the punching shear perimeter.

Parameters:

  • surface (Surface3D): The surface

  • distance (Number): Distance from the boundary

  • boundary (Boundary): The loaded area boundary

Returns: Array of Line3D - Perimeter lines

Example:

Related: punchingperimeter()


Unit Conversion

withunits(num, primaryUnit, secondaryUnit?, unitType?, decimals?)

Formats a number with unit labels.

Parameters:

  • num (Number): The numeric value

  • primaryUnit (String): Primary unit system ("ft", "m", etc.)

  • secondaryUnit (String, optional): Secondary unit for dual display

  • unitType (String, optional): Unit category ("Length", "Force", etc.)

  • decimals (Number, optional): Decimal places

Returns: String - Formatted string with units

Example:

Related: convert(), unitlabel()


unitlabel(unitCategory, unitType)

Returns the unit label for a given category and type.

Parameters:

  • unitCategory (String): Unit category ("Default", "Metric", "Imperial")

  • unitType (String): Unit type ("Length", "Force", "Stress", etc.)

Returns: String - Unit label (e.g., "ft", "kN", "MPa")

Example:

Related: withunits(), convert()


convert(num, unitType, fromUnit, toUnit)

Converts a value from one unit to another.

Parameters:

  • num (Number): The value to convert

  • unitType (String): Type of unit ("Length", "Force", "Stress", etc.)

  • fromUnit (String): Source unit ("ft", "m", "kip", "kN", etc.)

  • toUnit (String): Target unit

Returns: Number - Converted value

Example:

Related: withunits(), unitlabel()


stationlabel(station, format?, decimals?)

Formats a station value according to standard station notation.

Parameters:

  • station (Number): Station value

  • format (String, optional): Format string

  • decimals (Number, optional): Decimal places

Returns: String - Formatted station label

Example:

Related: withunits()


Advanced Geometry

crange(value, min, max)

Maps a value to a color range (for visualization).

Parameters:

  • value (Number): The value to map

  • min (Number): Minimum value of range

  • max (Number): Maximum value of range

Returns: Color - Color value based on range

Example:


voronoi(surface, sitePoints, cutoutPoints?)

Generates a Voronoi diagram on a surface.

Parameters:

  • surface (Surface3D): The base surface

  • sitePoints (Array of Point): Site points for Voronoi cells

  • cutoutPoints (Array of Point, optional): Points to exclude

Returns: Array of Surface3D - Voronoi cells

Example:

Related: voronoipts()


voronoipts(surface, sitePoints, cutoutPoints?)

Returns the vertices of Voronoi cells.

Parameters:

  • surface (Surface3D): The base surface

  • sitePoints (Array of Point): Site points

  • cutoutPoints (Array of Point, optional): Points to exclude

Returns: Array of Point - Voronoi vertices

Example:

Related: voronoi()


hittest(surface, point, local?)

Tests if a point hits (is inside) a surface.

Parameters:

  • surface (Surface3D): The surface to test

  • point (Point): The point to test

  • local (Boolean, optional): Use local coordinates

Returns: Boolean - True if point is inside surface

Example:


Mesh Generation

stripmesh(line1, x1, line2, x2)

Generates a strip mesh between two lines.

Parameters:

  • line1 (Line3D): First boundary line

  • x1 (Number): Parameter on first line

  • line2 (Line3D): Second boundary line

  • x2 (Number): Parameter on second line

Returns: Mesh - Strip mesh object

Example:

Related: gridmesh()


gridmesh(arg0, arg1, arg2?, arg3?)

Generates a grid mesh from parameters.

Parameters:

  • arg0, arg1, arg2, arg3: Grid definition parameters (varies by use case)

Returns: Mesh - Grid mesh object

Example:

Related: stripmesh()


Object/Point Functions

point(obj, index?)

Retrieves a point from an object.

Parameters:

  • obj (Object): The object containing points

  • index (Number, optional): Point index

Returns: Point - The requested point

Example:


cog(obj)

Calculates the center of gravity (centroid) of an object.

Parameters:

  • obj (Object): The object (surface, volume, or line)

Returns: Point - Center of gravity

Example:

Related: surfarea(), volume()


Value/Expression Functions

value(targetParam, sourceParam?, sourceValue?)

Evaluates the value of a parameter in a different context.

Parameters:

  • targetParam (String): Name of parameter to evaluate

  • sourceParam (String, optional): Source parameter for context

  • sourceValue (Any, optional): Value for source parameter

Returns: Any - Evaluated parameter value

Example:

Note: This is useful for evaluating station-dependent parameters at specific locations.


String Manipulation

startswith(str, prefix)

Tests if a string starts with a specified prefix.

Parameters:

  • str (String): The string to test

  • prefix (String): The prefix to check

Returns: Boolean - True if string starts with prefix

Example:

Related: endswith()


endswith(str, suffix)

Tests if a string ends with a specified suffix.

Parameters:

  • str (String): The string to test

  • suffix (String): The suffix to check

Returns: Boolean - True if string ends with suffix

Example:

Related: startswith()


substringcount(str, substring)

Counts occurrences of a substring within a string.

Parameters:

  • str (String): The string to search

  • substring (String): The substring to count

Returns: Number - Count of occurrences

Example:


replaceall(str, find, replace)

Replaces all occurrences of a substring with another string.

Parameters:

  • str (String): The source string

  • find (String): The substring to find

  • replace (String): The replacement string

Returns: String - Modified string

Example:

Related: removewhitespaces()


removewhitespaces(str)

Removes all whitespace characters from a string.

Parameters:

  • str (String): The string to process

Returns: String - String without whitespace

Example:

Related: replaceall()


mergeLinePoints(targetLines, constraints?, tolerance?)

Merges nearby points in a collection of lines based on tolerance.

Parameters:

  • targetLines (Array of Line3D): Lines to process

  • constraints (Object, optional): Merge constraints

  • tolerance (Number, optional): Distance tolerance for merging

Returns: Array of Line3D - Lines with merged points

Example:


Functional Programming & Advanced Operations

These advanced functions provide functional programming capabilities, station-dependent expressions, and conditional logic.

map(list, lambda)

Applies a lambda function to each element of a list and returns a new list with the results.

Parameters:

  • list (Array): The array to map over

  • lambda (Lambda Expression): Function to apply to each element (uses x for element, i for index)

Returns: Array - New array with transformed elements

Example:

⚠️ CRITICAL PERFORMANCE NOTE:

ALWAYS use map() for parameter loops—NEVER use Repeat for data transformations!

Using Repeat to calculate parameter values creates unnecessary objects in the project tree, causing severe performance degradation (10-100x slower). Use map() for all data transformations.

❌ WRONG - Using Repeat for calculations:

✅ CORRECT - Using map():

Common Use Cases for map():

When to Use Repeat vs map():

  • Use Repeat: Creating objects (Points, FENodes, Volumes, Beams, etc.)

  • Use map(): Transforming data, extracting properties, calculating values

See the Parametric Engine Guide section 4.1 for detailed explanation.

Related: filter(), reduce()


filter(list, lambda)

Filters a list based on a condition, returning only elements that match.

Parameters:

  • list (Array): The array to filter

  • lambda (Lambda Expression): Condition to test each element (uses x for element, i for index)

Returns: Array - Filtered array containing only matching elements

Example:

Related: map(), index()


reduce(list, lambda)

Reduces a list to a single value by applying a function cumulatively.

Parameters:

  • list (Array): The array to reduce

  • lambda (Lambda Expression): Reduction function (uses x for accumulator, y for current element)

Returns: Any - Single accumulated value

Example:

Related: suml(), avg()


maxl(list, lambda?)

Finds the maximum value in a list based on an optional lambda function.

Parameters:

  • list (Array): The array to search

  • lambda (Lambda Expression, optional): Function to extract comparison value from each element. If omitted, compares the values directly.

Returns: Any - Maximum value

Example:

Related: minl(), max()


minl(list, lambda?)

Finds the minimum value in a list based on an optional lambda function.

Parameters:

  • list (Array): The array to search

  • lambda (Lambda Expression, optional): Function to extract comparison value from each element. If omitted, compares the values directly.

Returns: Any - Minimum value

Example:

Related: maxl(), min()


suml(list, lambda?)

Calculates the sum of values extracted from a list using an optional lambda function.

Parameters:

  • list (Array): The array to sum

  • lambda (Lambda Expression, optional): Function to extract value from each element. If omitted, sums the values directly.

Returns: Number - Sum of extracted values

Example:

Related: avg(), reduce(), sum()


avg(list, lambda?)

Calculates the average of values extracted from a list using an optional lambda function.

Parameters:

  • list (Array): The array to average

  • lambda (Lambda Expression, optional): Function to extract value from each element. If omitted, averages the values directly.

Returns: Number - Average of extracted values

Example:

Related: suml()


sort(list, lambda?, ascending?)

Sorts a list based on a comparison function.

Parameters:

  • list (Array): The array to sort

  • lambda (Lambda Expression, optional): Function to extract sort key from each element

  • ascending (Number, optional): 1 for ascending (default), 0 for descending

Returns: Array - Sorted array

Example:

Related: reverse()


reverse(list)

Reverses the order of elements in a list.

Parameters:

  • list (Array): The array to reverse

Returns: Array - Reversed array

Example:

Related: sort()


unique(list, lambda) / removedup(list, lambda)

Removes duplicate elements from a list based on a lambda function.

Parameters:

  • list (Array): The array to filter

  • lambda (Lambda Expression): Function to extract comparison value from each element

Returns: Array - Array with duplicates removed

Example:

Related: filter()


index(list, lambda)

Finds the index of the first element that matches a condition.

Parameters:

  • list (Array): The array to search

  • lambda (Lambda Expression): Condition to test each element

Returns: Number - Index of first matching element, or -1 if not found

Example:

Related: filter()


iif(condition1, value1, condition2, value2, ..., elseValue?)

Inline if-elseif-else function for conditional expressions.

Parameters:

  • condition1, condition2, ... (Boolean): Conditions to test

  • value1, value2, ... (Any): Values to return when conditions are true

  • elseValue (Any, optional): Default value if no conditions match

Returns: Any - First matching value, or elseValue, or 0

Example:

Note: More flexible than ternary operator for multiple conditions


atstation(station, expression)

Evaluates an expression at a specific station value, temporarily overriding the current station context.

Parameters:

  • station (Number): Station value to evaluate at

  • expression (Expression): Expression to evaluate

Returns: Any - Result of expression evaluated at the given station

Example:

Note: Useful for evaluating station-dependent parameters at specific locations


makestadep(stations, values, variations?)

Creates a station-dependent expression from discrete station/value pairs. The function returns a station-dependent parameter that can be evaluated at any station using atstation().

Parameters:

  • stations (Array of Numbers): Station values

  • values (Array of Numbers or Arrays): Values at each station. Note: The values array should have one less element than stations (i.e., values.length = stations.length - 1), as shown in examples. Each element can be a single number or an array of numbers (for multiple values per station).

  • variations (Array of Strings, optional): Variation types between stations ('linear', 'parabola', 'circle', 'polynomial'). Should match the number of gaps (stations.length - 1).

Returns: Number - Interpolated value at current station

Example:

Additional Example for Array Values (Multiple Values per Station):

Another Example (3 Stations, 2 Gaps):

Related: variation(), makestadepexpr() Example:

Related: atstation(), variation(), makestadepexpr()


makestadepexpr(stations, values, variations?)

Creates a station-dependent expression string (not evaluated).

Parameters:

  • stations (Array of Numbers): Station values

  • values (Array of Numbers): Values at each station

  • variations (Array of Strings, optional): Variation types

Returns: String - Station-dependent expression as text

Example:

Related: makestadep()


variation(type, fromValue, toValue, ...)

Creates a variation between two values based on relative position (0 to 1).

Parameters:

  • type (String): Variation type - 'linear', 'parabola', 'circle', 'polynomial', 'custom'

  • fromValue (Number): Starting value

  • toValue (Number): Ending value

  • Additional parameters depend on type:

    • parabola: parabolaType ('concavedown' or 'concaveup')

    • circle: radius, circleType

    • polynomial: startGrade, endGrade

    • custom: lambda function

Returns: Number - Interpolated value

Example:

Note: Requires context with station or relative position (x) set


variations(params...)

Returns the list of variation types used in the given parameters.

Parameters:

  • params... (Parameters): Parameters to check for variations

Returns: Array of Strings - List of variation types found

Example:


makelist(params...) / rangelist(params...)

Creates a list from station-dependent range values.

Parameters:

  • params... (Parameters): Parameters with range values

Returns: Array - Unique values from all ranges

Example:

Note: Automatically extracts values from station-dependent ranges


exportval(paramName, object?, defaultReturn?)

Exports a parameter value from an object, with optional default.

Parameters:

  • paramName (String): Name of parameter to export

  • object (Object, optional): Object to export from

  • defaultReturn (Any, optional): Default value if parameter not found (default: 0)

Returns: Any - Parameter value or default

Example:


paramlabel(param)

Returns the display label of a parameter or object name.

Parameters:

  • param (Parameter or Object): Parameter or object to get label from

Returns: String - Parameter label or object name

Example:

Note: Returns the user-facing label, not the internal parameter name


External Module Functions

These functions are available when specific modules are loaded in the context.

Section Analysis Functions (SEC.Functions)

Available when section analysis module is loaded. Defined in Functions.tsarrow-up-right.

momentCapacity(section, orientation, strain, axial, ...)

Calculates moment capacity of a cross-section.

Parameters:

  • section (Section): The section object

  • orientation (Number): Load orientation angle

  • strain (Number): Maximum strain

  • axial (Number): Axial force

  • Additional parameters for analysis settings

Returns: Number - Moment capacity value

Example:

Related: momentCapacityNA(), interactionDiagram()


momentCapacityNA(section, orientation, strain, axial, ...)

Returns neutral axis distance from section centroid for moment capacity calculation.

Parameters: Same as momentCapacity()

  • section: Section object to analyze

  • orientation: Rotation angle in radians (clockwise positive)

  • strain: Concrete strain limit (typically 0.003)

  • axial: Corresponding axial force (compression positive)

Returns: Number - Neutral axis distance from centroid (positive upward from origin)

How It Works:

  1. Rotates the section (including all rebars and tendons) clockwise by the specified orientation angle about the $(0, 0)$ coordinate point.

  2. Applies compression from top (positive Y direction) relative to origin (0,0)

  3. Returns NA distance from centroid, positive upward:

    • Positive value: NA is above centroid (compression zone above)

    • Negative value: NA is below centroid (rare, large tension forces)

Key Points:

  • Coordinate system origin at (0,0)

  • Compression side is upward (positive Y)

  • Result measured in the rotated coordinate system

  • Section rotates with all reinforcement (rebars and tendons)

Example Usage:

Important: When filtering rebars or calculating distances in the original coordinate system, you may need to adjust the sign of the returned NA value depending on the rotation angle and which side of the section you're working with.

Related: momentCapacity(), interactionDiagram()


momentCapacityTension(section, orientation, strain, axial, ...)

Returns tension force at moment capacity.

Returns: Number - Tension force


momentCapacityCompression(section, orientation, strain, axial, ...)

Returns compression force at moment capacity.

Returns: Number - Compression force


momentCapacityCurvature(section, orientation, strain, axial, ...)

Returns curvature at moment capacity.

Returns: Number - Curvature value


sectionDepth(section, station?)

Returns the depth of a section at a given station.

Parameters:

  • section (Section): The section object

  • station (Number, optional): Station location

Returns: Number - Section depth

Example:

Related: sectionWidth(), sectionExt()


sectionWidth(section, station?)

Returns the width of a section.

Parameters:

  • section (Section): The section object

  • station (Number, optional): Station location

Returns: Number - Section width


sectionExt(section, station?)

Returns the extents (bounding box) of a section.

Returns: Object - {minX, maxX, minY, maxY}


sectionShapeCoords(section)

Returns coordinates defining the section shape.

Returns: Array of Point2D - Shape coordinates


sectionHasTendon(section)

Checks if section has post-tensioning tendons.

Returns: Boolean


sectionHasRebar(section)

Checks if section has reinforcing bars.

Returns: Boolean


sectionIsComposite(section)

Checks if section is composite.

Returns: Boolean


interactionDiagram(section, ...)

Generates interaction diagram data (P-M diagram).

Returns: Array - Interaction curve points

Example:


crackedInertia(section, ...)

Calculates cracked moment of inertia.

Returns: Number - Cracked inertia value


maxRebarTensileStress(section, ...)

Calculates maximum tensile stress in reinforcement.

Returns: Number - Maximum stress


Alignment/Bridge Functions (OpenBrIM.Functions)

Available for bridge alignment operations. Defined in Functions.tsarrow-up-right.

alignHX(alignment, station, offset)

Returns the global X coordinate on an alignment.

Parameters:

  • alignment (Alignment): The alignment object

  • station (Number): Station value

  • offset (Number): Transverse offset from centerline

Returns: Number - X coordinate

Example:

Related: alignHY(), alignHZ(), alignH()


alignHY(alignment, station, offset)

Returns the global Y coordinate on an alignment.

Parameters: Same as alignHX()

Returns: Number - Y coordinate


alignHZ(alignment, station, offset)

Returns the global Z coordinate (elevation) on an alignment.

Parameters: Same as alignHX()

Returns: Number - Z coordinate

Note: This returns horizontal plane Z, use alignV() for vertical profile elevation.


alignHA(alignment, station, offset)

Returns the horizontal angle (bearing) of alignment at a station.

Parameters:

  • alignment (Alignment): The alignment object

  • station (Number): Station value

  • offset (Number): Transverse offset

Returns: Number - Angle in degrees

Example:


alignH(alignment, station, offset)

Returns all horizontal alignment data (X, Y, angle) at once.

Parameters: Same as alignHX()

Returns: Object - {X, Y, Angle}

Example:


alignLocal(alignment, x, y, z)

Converts global coordinates to local alignment coordinates (station, offset).

Parameters:

  • alignment (Alignment): The alignment object

  • x, y, z (Numbers): Global coordinates

Returns: Object - {Station, Offset}

Example:

Related: alignH(), alignProjection()


alignProjection(sourceAlign, targetAlign, station, offset, ...)

Projects a point from one alignment to another.

Parameters:

  • sourceAlign (Alignment): Source alignment

  • targetAlign (Alignment): Target alignment

  • station (Number): Station on source

  • offset (Number): Offset on source

  • Additional parameters for projection method

Returns: Object - {Station, Offset} on target alignment


alignT(alignment, station, offset)

Returns transverse elevation at a station and offset.

Parameters:

  • alignment (Alignment): The alignment object

  • station (Number): Station value

  • offset (Number): Transverse offset

Returns: Number - Elevation


alignTA(alignment, station, offset)

Returns transverse slope angle at a station and offset.

Returns: Number - Slope angle in degrees


alignV(alignment, station)

Returns vertical profile elevation at a station.

Parameters:

  • alignment (Alignment): The alignment object

  • station (Number): Station value

Returns: Number - Elevation from vertical profile

Example:


alignA(alignment, station)

Returns alignment angle (bearing) at a station.

Parameters:

  • alignment (Alignment): The alignment object

  • station (Number): Station value

Returns: Number - Bearing angle


alignLength(alignment, ...)

Returns the total length of an alignment.

Returns: Number - Alignment length


alignRad(alignment, station, ...)

Returns the horizontal radius at a station.

Returns: Number - Radius (positive for curves, very large for tangents)


stationDifference(alignment, station1, station2, ...)

Calculates the difference between two stations accounting for equations.

Returns: Number - Station difference


verticalClearance(alignment, ...)

Calculates vertical clearance at a location.

Returns: Number - Clearance value


CutFillPolygon(surface1, surface2, ...)

Generates cut/fill polygons between two surfaces.

Returns: Array - Cut and fill regions


SplitPolygonByLine(polygon, line, ...)

Splits a polygon by a line.

Returns: Array - Split polygon pieces


mto(objects, ...)

Performs material take-off calculations.

Returns: Object - Material quantities


alignLine(alignment, startStation, endStation, ...)

Extracts a line segment from an alignment between stations.

Returns: Line3D


stressStrainCurvePoints(material, ...)

Returns points on a material stress-strain curve.

Returns: Array - Curve points


lineProjection(line, targetAlignment, ...)

Projects a line onto an alignment.

Returns: Object - Projection data


pointProjection(point, targetAlignment, ...)

Projects a point onto an alignment.

Returns: Object - {Station, Offset}


controlLocations(alignment, ...)

Returns control point locations on an alignment.

Returns: Array - Control points


alignHCenter(alignment, station, ...)

Returns horizontal center point at a station.

Returns: Point


convertToLocal(alignment, point, ...)

Converts a point to local alignment coordinates.

Returns: Object - {Station, Offset, Elevation}


Finite Element Analysis Functions (FEA.Functions)

Available when FEA analysis is performed. Defined in Functions.tsarrow-up-right.

feobj(objectName, paramName?, repeat?, index?)

Retrieves a finite element object or its parameter value.

Parameters:

  • objectName (String): Name of FEA object

  • paramName (String, optional): Parameter name to retrieve

  • repeat (Number, optional): Repeat index

  • index (Number, optional): Sub-index

Returns: Object or Value - FEA object or parameter value

Example:


Dynamic Output Functions

FEA provides dynamic functions based on analysis results. Common patterns:

Force Functions:

  • force(element, loadCase, component) - Element forces

  • forceN(element, loadCase) - Axial force

  • forceV(element, loadCase) - Shear force

  • forceM(element, loadCase) - Moment

Displacement Functions:

  • disp(node, loadCase, component) - Node displacements

  • dispX(node, loadCase) - X displacement

  • dispY(node, loadCase) - Y displacement

  • dispZ(node, loadCase) - Z displacement

Stress Functions:

  • stress(element, loadCase, component) - Element stresses

  • stressXX(element, loadCase) - Normal stress XX

  • stressVM(element, loadCase) - Von Mises stress

Example:


forceNeg(component, elementPath, loadCase, station?)

Retrieves the negative (minimum) force/moment value from analysis results.

Parameters:

  • component (String): Force component ('N', 'V', 'M', 'Mx', 'My', 'Mz', etc.)

  • elementPath (String): Full path to the element (use fullname() for dynamic paths)

  • loadCase (String): Load case or combination name

  • station (Number, optional): Station location along element

Returns: Number - Negative (minimum) force value

Example:

Use Cases:

  • Finding maximum negative moments for bottom flange design

  • Determining compression forces for member design

  • Envelope analysis across multiple load cases

Related: forcePos(), forceM(), fullname()


forcePos(component, elementPath, loadCase, station?)

Retrieves the positive (maximum) force/moment value from analysis results.

Parameters:

  • component (String): Force component ('N', 'V', 'M', 'Mx', 'My', 'Mz', etc.)

  • elementPath (String): Full path to the element

  • loadCase (String): Load case or combination name

  • station (Number, optional): Station location along element

Returns: Number - Positive (maximum) force value

Example:

Use Cases:

  • Finding maximum positive moments for top flange design

  • Determining tension forces for member design

  • Strength envelope calculations

Related: forceNeg(), forceM(), fullname()


fullname(object)

Returns the full hierarchical path name of an object, including all parent object names.

Parameters:

  • object (Object or Parameter): The object to get the full path for

Returns: String - Full dot-notation path (e.g., "Project.Bridge.Girder1")

Example:

Use Cases:

  • Dynamically constructing element paths for analysis queries

  • Building unique identifiers for objects in repeats

  • Debugging parameter resolution issues

  • Creating reports with full object references

Common Pattern - Force Queries in Repeats:

Related: forceNeg(), forcePos(), feobj()


tshortTermLoss(tendon, point)

Calculates short-term prestress losses in a tendon.

Parameters:

  • tendon (Tendon): The tendon object

  • point (Number or Point): Evaluation point

Returns: Number - Stress loss


getPushoverSubStageNames(analysisCase, ...)

Returns substage names from a pushover analysis.

Returns: Array of Strings - Substage names


getPushoverControlNode(analysisCase, ...)

Returns the control node for pushover analysis.

Returns: String - Node name


Best Practices

1. Use Functions Directly

All ParamML functions can be called directly in expressions. The execution context is handled automatically by the evaluation engine, so you never need to provide it manually.

2. Check Array Lengths

Before accessing array elements, verify the array has sufficient length:

3. Use Appropriate Units

Always specify unit types for physical quantities:

4. Handle Null Returns

Some functions may return null (e.g., intersect() if lines don't intersect). Use guards:

5. Leverage Object Hierarchy

Use the parametric tree structure with parent() and project():

6. Optimize Performance

  • Cache expensive calculations in parameters

  • Use value() for station-dependent parameters instead of recalculating

  • Prefer built-in functions over custom implementations

7. Document Complex Expressions

Use parameter descriptions to explain complex function usage:


Common Usage Patterns

Creating Points Along a Line

Alignment-Based Geometry

Conditional Geometry Based on Analysis

Section Property Queries


Function Implementation Reference

For AI agents developing or debugging ParamML:

Primary Dispatcher:

Implementation Files:

Error Handling: All functions use ParamML.Param.ThrowError(message) for error reporting. Always validate:

  • Parameter types (arrays, numbers, objects)

  • Parameter count

  • Null/undefined values

  • Context requirements


Summary

ParamML provides 90+ functions organized into categories:

  • Array/List: Manipulation and queries of collections

  • Geometric: Transformations and geometric calculations

  • Line/Curve: Operations on linear geometry

  • Surface/Volume: Area, volume, and perimeter calculations

  • Unit Conversion: Formatting and converting physical units

  • Advanced Geometry: Voronoi, intersection, mesh operations

  • String: Text manipulation utilities

  • External Modules: Context-specific functions for FEA, sections, and alignments

Key Principles:

  1. Functions are case-sensitive

  2. Most geometric functions require execution context

  3. External module functions are only available in appropriate contexts

  4. Functions can be nested and combined in expressions

  5. Always handle potential null returns from geometric operations

  6. Use appropriate unit types for engineering calculations

This comprehensive function library enables AI agents to create sophisticated parametric bridge models with complex geometric relationships, engineering calculations, and analysis integrations.

Last updated