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
ExprProvFunctionCallmethod (Param.ts:655)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 : value2Unary 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)
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)
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()
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)
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 accessindex(Number or multiple Numbers): The index/indices to retrieve
Returns: Any - The element at the specified index
Example:
Related: first(), last()
last(list)
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)
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...)
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?)
sum(list, startIndex?, endIndex?)Calculates the sum of numeric elements in an array.
Parameters:
list(Array): The array of numbers to sumstartIndex(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)
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, ...)
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)
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 arraysFor point lists, extract coordinates, refine them, then reconstruct points using
onlinex()or similarRefinement value represents maximum spacing between output values
Related: onlinex(), map()
slice(list, start, end)
slice(list, start, end)Extracts a portion of an array from start to end index.
Parameters:
list(Array): The source arraystart(Number): Starting index (inclusive)end(Number): Ending index (exclusive)
Returns: Array - Sliced portion of the array
Example:
Geometric Transformations
translate(point, tx, ty, tz)
translate(point, tx, ty, tz)Translates a point by the specified offset values.
Parameters:
point(Point or Array): The point to translatetx(Number): Translation in X directionty(Number): Translation in Y directiontz(Number): Translation in Z direction
Returns: Point - The translated point
Example:
Related: rotate()
rotate(point, rx, ry, rz, origin?)
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 rotaterx(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)
online(line, x, y)Returns a point on a line at specified local coordinates.
Parameters:
line(Line3D): The line objectx(Number): Local X coordinate along the liney(Number): Local Y coordinate (offset perpendicular to line)
Returns: Point - Point on the line
Example:
Related: onlineg(), onliner(), onlinea()
onlineg(line, x, y)
onlineg(line, x, y)Returns a point on a line in global coordinates.
Parameters:
line(Line3D): The line objectx(Number): Global X coordinatey(Number): Global Y coordinate
Returns: Point - Point on the line
Example:
Related: online(), toglobal()
onliner(line, n)
onliner(line, n)Returns a point on a line at a relative position (0 to 1).
Parameters:
line(Line3D): The line objectn(Number): Relative position (0 = start, 1 = end, 0.5 = midpoint)
Returns: Point - Point on the line
Example:
Related: onlinea(), online()
onlinea(line, n)
onlinea(line, n)Returns a point on a line at an absolute distance from the start.
Parameters:
line(Line3D): The line objectn(Number): Absolute distance from start
Returns: Point - Point on the line
Example:
Related: onliner(), linel()
onlinerel(line, n)
onlinerel(line, n)Returns a point on a line at a relative distance in the line's local direction.
Parameters:
line(Line3D): The line objectn(Number): Relative distance
Returns: Point - Point on the line
Example:
Related: onliner(), onlinea()
onlinex(line, n)
onlinex(line, n)Returns a point on a line at a specific X coordinate.
Parameters:
line(Line3D): The line objectn(Number): X coordinate value
Returns: Point - Point on the line at the specified X
Example:
Related: onliney(), onlinez()
onliney(line, n)
onliney(line, n)Returns a point on a line at a specific Y coordinate.
Parameters:
line(Line3D): The line objectn(Number): Y coordinate value
Returns: Point - Point on the line at the specified Y
Example:
Related: onlinex(), onlinez()
onlinez(line, n)
onlinez(line, n)Returns a point on a line at a specific Z coordinate (elevation).
Parameters:
line(Line3D): The line objectn(Number): Z coordinate value
Returns: Point - Point on the line at the specified Z
Example:
Related: onlinex(), onliney()
oncircle(radius, x, y?, direction?)
oncircle(radius, x, y?, direction?)Returns a point on a circle at specified parameters.
Parameters:
radius(Number): Circle radiusx(Number): Angle in degrees or arc lengthy(Number, optional): Offset from circle (default: 0)direction(Number, optional): Direction modifier (default: 1)
Returns: Point - Point on the circle
Example:
linel(line)
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)
closestPointOnLine(line, point)Finds the closest point on a line to a given point (projection).
Parameters:
line(Line3D): The line objectpoint(Point): The reference point
Returns: Point - Closest point on the line
Example:
Related: intersect()
closestLineIndex(lines, line)
closestLineIndex(lines, line)Finds the index of the closest line in a collection to a given line.
Parameters:
lines(Array of Line3D): Collection of linesline(Line3D): Reference line
Returns: Number - Index of the closest line
Example:
toglobal(line)
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)
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)
linesplit(line, breakIndex)Splits a line at a specified index into two lines.
Parameters:
line(Line3D): The line to splitbreakIndex(Number): Index at which to split
Returns: Array - Two lines [line1, line2]
Example:
intersect(line1, line2, plane?, rayMode?)
intersect(line1, line2, plane?, rayMode?)Finds the intersection point between two lines.
Parameters:
line1(Line3D): First lineline2(Line3D): Second lineplane(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?)
intersectalong(line1, line2, extLen?, plane?)Finds intersection between two lines with optional extension length.
Parameters:
line1(Line3D): First lineline2(Line3D): Second lineextLen(Number, optional): Extension length for linesplane(String, optional): Intersection plane
Returns: Point - Intersection point
Example:
Related: intersect()
polygonLineIntersect(polygon, line, mode?)
polygonLineIntersect(polygon, line, mode?)Finds intersection points between a polygon and a line.
Parameters:
polygon(Surface3D): The polygonline(Line3D): The linemode(Number, optional): Intersection mode
Returns: Array of Point - Intersection points
Example:
Related: intersect()
Surface/Volume Operations
surfarea(surface)
surfarea(surface)Calculates the area of a surface.
Parameters:
surface(Surface3D): The surface object
Returns: Number - Surface area
Example:
Related: volume(), perimeter()
volumesurfareas(volume)
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)
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)
volumesideareas(volume, side)Returns the area of a specific side of a volume.
Parameters:
volume(Volume): The volume objectside(Number or String): Side identifier
Returns: Number - Area of the specified side
Example:
Related: volumesurfareas()
volumesurfdims(volume, algorithm?, side?)
volumesurfdims(volume, algorithm?, side?)Returns dimensions of volume surfaces (width, height, etc.).
Parameters:
volume(Volume): The volume objectalgorithm(Number, optional): Algorithm type for dimension calculationside(Number, optional): Specific side index
Returns: Object or Array - Surface dimensions
Example:
Related: volumesurfareas()
volume(volume)
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?)
volumeextvectorlength(volume, mode?)Returns the length of the extrusion vector for an extruded volume.
Parameters:
volume(Volume): The extruded volume objectmode(Number, optional): Calculation mode
Returns: Number - Extrusion vector length
Example:
perimeter(surface, isOpen?)
perimeter(surface, isOpen?)Calculates the perimeter of a surface or boundary.
Parameters:
surface(Surface3D): The surface objectisOpen(Boolean, optional): Whether the surface is open
Returns: Number - Perimeter length
Example:
Related: surfarea(), linel()
punchingperimeter(surface, distance, boundary)
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 boundaryboundary(Boundary): The loaded area boundary
Returns: Number - Punching perimeter length
Example:
Related: punchingperimeterlines()
punchingperimeterlines(surface, distance, boundary)
punchingperimeterlines(surface, distance, boundary)Returns the line segments forming the punching shear perimeter.
Parameters:
surface(Surface3D): The surfacedistance(Number): Distance from the boundaryboundary(Boundary): The loaded area boundary
Returns: Array of Line3D - Perimeter lines
Example:
Related: punchingperimeter()
Unit Conversion
withunits(num, primaryUnit, secondaryUnit?, unitType?, decimals?)
withunits(num, primaryUnit, secondaryUnit?, unitType?, decimals?)Formats a number with unit labels.
Parameters:
num(Number): The numeric valueprimaryUnit(String): Primary unit system ("ft", "m", etc.)secondaryUnit(String, optional): Secondary unit for dual displayunitType(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)
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)
convert(num, unitType, fromUnit, toUnit)Converts a value from one unit to another.
Parameters:
num(Number): The value to convertunitType(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?)
stationlabel(station, format?, decimals?)Formats a station value according to standard station notation.
Parameters:
station(Number): Station valueformat(String, optional): Format stringdecimals(Number, optional): Decimal places
Returns: String - Formatted station label
Example:
Related: withunits()
Advanced Geometry
crange(value, min, max)
crange(value, min, max)Maps a value to a color range (for visualization).
Parameters:
value(Number): The value to mapmin(Number): Minimum value of rangemax(Number): Maximum value of range
Returns: Color - Color value based on range
Example:
voronoi(surface, sitePoints, cutoutPoints?)
voronoi(surface, sitePoints, cutoutPoints?)Generates a Voronoi diagram on a surface.
Parameters:
surface(Surface3D): The base surfacesitePoints(Array of Point): Site points for Voronoi cellscutoutPoints(Array of Point, optional): Points to exclude
Returns: Array of Surface3D - Voronoi cells
Example:
Related: voronoipts()
voronoipts(surface, sitePoints, cutoutPoints?)
voronoipts(surface, sitePoints, cutoutPoints?)Returns the vertices of Voronoi cells.
Parameters:
surface(Surface3D): The base surfacesitePoints(Array of Point): Site pointscutoutPoints(Array of Point, optional): Points to exclude
Returns: Array of Point - Voronoi vertices
Example:
Related: voronoi()
hittest(surface, point, local?)
hittest(surface, point, local?)Tests if a point hits (is inside) a surface.
Parameters:
surface(Surface3D): The surface to testpoint(Point): The point to testlocal(Boolean, optional): Use local coordinates
Returns: Boolean - True if point is inside surface
Example:
Mesh Generation
stripmesh(line1, x1, line2, x2)
stripmesh(line1, x1, line2, x2)Generates a strip mesh between two lines.
Parameters:
line1(Line3D): First boundary linex1(Number): Parameter on first lineline2(Line3D): Second boundary linex2(Number): Parameter on second line
Returns: Mesh - Strip mesh object
Example:
Related: gridmesh()
gridmesh(arg0, arg1, arg2?, arg3?)
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?)
point(obj, index?)Retrieves a point from an object.
Parameters:
obj(Object): The object containing pointsindex(Number, optional): Point index
Returns: Point - The requested point
Example:
cog(obj)
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?)
value(targetParam, sourceParam?, sourceValue?)Evaluates the value of a parameter in a different context.
Parameters:
targetParam(String): Name of parameter to evaluatesourceParam(String, optional): Source parameter for contextsourceValue(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)
startswith(str, prefix)Tests if a string starts with a specified prefix.
Parameters:
str(String): The string to testprefix(String): The prefix to check
Returns: Boolean - True if string starts with prefix
Example:
Related: endswith()
endswith(str, suffix)
endswith(str, suffix)Tests if a string ends with a specified suffix.
Parameters:
str(String): The string to testsuffix(String): The suffix to check
Returns: Boolean - True if string ends with suffix
Example:
Related: startswith()
substringcount(str, substring)
substringcount(str, substring)Counts occurrences of a substring within a string.
Parameters:
str(String): The string to searchsubstring(String): The substring to count
Returns: Number - Count of occurrences
Example:
replaceall(str, find, replace)
replaceall(str, find, replace)Replaces all occurrences of a substring with another string.
Parameters:
str(String): The source stringfind(String): The substring to findreplace(String): The replacement string
Returns: String - Modified string
Example:
Related: removewhitespaces()
removewhitespaces(str)
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?)
mergeLinePoints(targetLines, constraints?, tolerance?)Merges nearby points in a collection of lines based on tolerance.
Parameters:
targetLines(Array of Line3D): Lines to processconstraints(Object, optional): Merge constraintstolerance(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)
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 overlambda(Lambda Expression): Function to apply to each element (usesxfor element,ifor 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)
filter(list, lambda)Filters a list based on a condition, returning only elements that match.
Parameters:
list(Array): The array to filterlambda(Lambda Expression): Condition to test each element (usesxfor element,ifor index)
Returns: Array - Filtered array containing only matching elements
Example:
Related: map(), index()
reduce(list, lambda)
reduce(list, lambda)Reduces a list to a single value by applying a function cumulatively.
Parameters:
list(Array): The array to reducelambda(Lambda Expression): Reduction function (usesxfor accumulator,yfor current element)
Returns: Any - Single accumulated value
Example:
Related: suml(), avg()
maxl(list, lambda?)
maxl(list, lambda?)Finds the maximum value in a list based on an optional lambda function.
Parameters:
list(Array): The array to searchlambda(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?)
minl(list, lambda?)Finds the minimum value in a list based on an optional lambda function.
Parameters:
list(Array): The array to searchlambda(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?)
suml(list, lambda?)Calculates the sum of values extracted from a list using an optional lambda function.
Parameters:
list(Array): The array to sumlambda(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?)
avg(list, lambda?)Calculates the average of values extracted from a list using an optional lambda function.
Parameters:
list(Array): The array to averagelambda(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?)
sort(list, lambda?, ascending?)Sorts a list based on a comparison function.
Parameters:
list(Array): The array to sortlambda(Lambda Expression, optional): Function to extract sort key from each elementascending(Number, optional): 1 for ascending (default), 0 for descending
Returns: Array - Sorted array
Example:
Related: reverse()
reverse(list)
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)
unique(list, lambda) / removedup(list, lambda)Removes duplicate elements from a list based on a lambda function.
Parameters:
list(Array): The array to filterlambda(Lambda Expression): Function to extract comparison value from each element
Returns: Array - Array with duplicates removed
Example:
Related: filter()
index(list, lambda)
index(list, lambda)Finds the index of the first element that matches a condition.
Parameters:
list(Array): The array to searchlambda(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?)
iif(condition1, value1, condition2, value2, ..., elseValue?)Inline if-elseif-else function for conditional expressions.
Parameters:
condition1, condition2, ...(Boolean): Conditions to testvalue1, value2, ...(Any): Values to return when conditions are trueelseValue(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)
atstation(station, expression)Evaluates an expression at a specific station value, temporarily overriding the current station context.
Parameters:
station(Number): Station value to evaluate atexpression(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?)
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 valuesvalues(Array of Numbers or Arrays): Values at each station. Note: Thevaluesarray should have one less element thanstations(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?)
makestadepexpr(stations, values, variations?)Creates a station-dependent expression string (not evaluated).
Parameters:
stations(Array of Numbers): Station valuesvalues(Array of Numbers): Values at each stationvariations(Array of Strings, optional): Variation types
Returns: String - Station-dependent expression as text
Example:
Related: makestadep()
variation(type, fromValue, toValue, ...)
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 valuetoValue(Number): Ending valueAdditional parameters depend on type:
parabola:
parabolaType('concavedown' or 'concaveup')circle:
radius,circleTypepolynomial:
startGrade,endGradecustom:
lambdafunction
Returns: Number - Interpolated value
Example:
Note: Requires context with station or relative position (x) set
variations(params...)
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...)
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?)
exportval(paramName, object?, defaultReturn?)Exports a parameter value from an object, with optional default.
Parameters:
paramName(String): Name of parameter to exportobject(Object, optional): Object to export fromdefaultReturn(Any, optional): Default value if parameter not found (default: 0)
Returns: Any - Parameter value or default
Example:
paramlabel(param)
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.ts.
momentCapacity(section, orientation, strain, axial, ...)
momentCapacity(section, orientation, strain, axial, ...)Calculates moment capacity of a cross-section.
Parameters:
section(Section): The section objectorientation(Number): Load orientation anglestrain(Number): Maximum strainaxial(Number): Axial forceAdditional parameters for analysis settings
Returns: Number - Moment capacity value
Example:
Related: momentCapacityNA(), interactionDiagram()
momentCapacityNA(section, orientation, strain, axial, ...)
momentCapacityNA(section, orientation, strain, axial, ...)Returns neutral axis distance from section centroid for moment capacity calculation.
Parameters: Same as momentCapacity()
section: Section object to analyzeorientation: 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:
Rotates the section (including all rebars and tendons) clockwise by the specified
orientationangle about the $(0, 0)$ coordinate point.Applies compression from top (positive Y direction) relative to origin (0,0)
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, ...)
momentCapacityTension(section, orientation, strain, axial, ...)Returns tension force at moment capacity.
Returns: Number - Tension force
momentCapacityCompression(section, orientation, strain, axial, ...)
momentCapacityCompression(section, orientation, strain, axial, ...)Returns compression force at moment capacity.
Returns: Number - Compression force
momentCapacityCurvature(section, orientation, strain, axial, ...)
momentCapacityCurvature(section, orientation, strain, axial, ...)Returns curvature at moment capacity.
Returns: Number - Curvature value
sectionDepth(section, station?)
sectionDepth(section, station?)Returns the depth of a section at a given station.
Parameters:
section(Section): The section objectstation(Number, optional): Station location
Returns: Number - Section depth
Example:
Related: sectionWidth(), sectionExt()
sectionWidth(section, station?)
sectionWidth(section, station?)Returns the width of a section.
Parameters:
section(Section): The section objectstation(Number, optional): Station location
Returns: Number - Section width
sectionExt(section, station?)
sectionExt(section, station?)Returns the extents (bounding box) of a section.
Returns: Object - {minX, maxX, minY, maxY}
sectionShapeCoords(section)
sectionShapeCoords(section)Returns coordinates defining the section shape.
Returns: Array of Point2D - Shape coordinates
sectionHasTendon(section)
sectionHasTendon(section)Checks if section has post-tensioning tendons.
Returns: Boolean
sectionHasRebar(section)
sectionHasRebar(section)Checks if section has reinforcing bars.
Returns: Boolean
sectionIsComposite(section)
sectionIsComposite(section)Checks if section is composite.
Returns: Boolean
interactionDiagram(section, ...)
interactionDiagram(section, ...)Generates interaction diagram data (P-M diagram).
Returns: Array - Interaction curve points
Example:
crackedInertia(section, ...)
crackedInertia(section, ...)Calculates cracked moment of inertia.
Returns: Number - Cracked inertia value
maxRebarTensileStress(section, ...)
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.ts.
alignHX(alignment, station, offset)
alignHX(alignment, station, offset)Returns the global X coordinate on an alignment.
Parameters:
alignment(Alignment): The alignment objectstation(Number): Station valueoffset(Number): Transverse offset from centerline
Returns: Number - X coordinate
Example:
Related: alignHY(), alignHZ(), alignH()
alignHY(alignment, station, offset)
alignHY(alignment, station, offset)Returns the global Y coordinate on an alignment.
Parameters: Same as alignHX()
Returns: Number - Y coordinate
alignHZ(alignment, station, offset)
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)
alignHA(alignment, station, offset)Returns the horizontal angle (bearing) of alignment at a station.
Parameters:
alignment(Alignment): The alignment objectstation(Number): Station valueoffset(Number): Transverse offset
Returns: Number - Angle in degrees
Example:
alignH(alignment, station, offset)
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)
alignLocal(alignment, x, y, z)Converts global coordinates to local alignment coordinates (station, offset).
Parameters:
alignment(Alignment): The alignment objectx,y,z(Numbers): Global coordinates
Returns: Object - {Station, Offset}
Example:
Related: alignH(), alignProjection()
alignProjection(sourceAlign, targetAlign, station, offset, ...)
alignProjection(sourceAlign, targetAlign, station, offset, ...)Projects a point from one alignment to another.
Parameters:
sourceAlign(Alignment): Source alignmenttargetAlign(Alignment): Target alignmentstation(Number): Station on sourceoffset(Number): Offset on sourceAdditional parameters for projection method
Returns: Object - {Station, Offset} on target alignment
alignT(alignment, station, offset)
alignT(alignment, station, offset)Returns transverse elevation at a station and offset.
Parameters:
alignment(Alignment): The alignment objectstation(Number): Station valueoffset(Number): Transverse offset
Returns: Number - Elevation
alignTA(alignment, station, offset)
alignTA(alignment, station, offset)Returns transverse slope angle at a station and offset.
Returns: Number - Slope angle in degrees
alignV(alignment, station)
alignV(alignment, station)Returns vertical profile elevation at a station.
Parameters:
alignment(Alignment): The alignment objectstation(Number): Station value
Returns: Number - Elevation from vertical profile
Example:
alignA(alignment, station)
alignA(alignment, station)Returns alignment angle (bearing) at a station.
Parameters:
alignment(Alignment): The alignment objectstation(Number): Station value
Returns: Number - Bearing angle
alignLength(alignment, ...)
alignLength(alignment, ...)Returns the total length of an alignment.
Returns: Number - Alignment length
alignRad(alignment, station, ...)
alignRad(alignment, station, ...)Returns the horizontal radius at a station.
Returns: Number - Radius (positive for curves, very large for tangents)
stationDifference(alignment, station1, station2, ...)
stationDifference(alignment, station1, station2, ...)Calculates the difference between two stations accounting for equations.
Returns: Number - Station difference
verticalClearance(alignment, ...)
verticalClearance(alignment, ...)Calculates vertical clearance at a location.
Returns: Number - Clearance value
CutFillPolygon(surface1, surface2, ...)
CutFillPolygon(surface1, surface2, ...)Generates cut/fill polygons between two surfaces.
Returns: Array - Cut and fill regions
SplitPolygonByLine(polygon, line, ...)
SplitPolygonByLine(polygon, line, ...)Splits a polygon by a line.
Returns: Array - Split polygon pieces
mto(objects, ...)
mto(objects, ...)Performs material take-off calculations.
Returns: Object - Material quantities
alignLine(alignment, startStation, endStation, ...)
alignLine(alignment, startStation, endStation, ...)Extracts a line segment from an alignment between stations.
Returns: Line3D
stressStrainCurvePoints(material, ...)
stressStrainCurvePoints(material, ...)Returns points on a material stress-strain curve.
Returns: Array - Curve points
lineProjection(line, targetAlignment, ...)
lineProjection(line, targetAlignment, ...)Projects a line onto an alignment.
Returns: Object - Projection data
pointProjection(point, targetAlignment, ...)
pointProjection(point, targetAlignment, ...)Projects a point onto an alignment.
Returns: Object - {Station, Offset}
controlLocations(alignment, ...)
controlLocations(alignment, ...)Returns control point locations on an alignment.
Returns: Array - Control points
alignHCenter(alignment, station, ...)
alignHCenter(alignment, station, ...)Returns horizontal center point at a station.
Returns: Point
convertToLocal(alignment, 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.ts.
feobj(objectName, paramName?, repeat?, index?)
feobj(objectName, paramName?, repeat?, index?)Retrieves a finite element object or its parameter value.
Parameters:
objectName(String): Name of FEA objectparamName(String, optional): Parameter name to retrieverepeat(Number, optional): Repeat indexindex(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 forcesforceN(element, loadCase)- Axial forceforceV(element, loadCase)- Shear forceforceM(element, loadCase)- Moment
Displacement Functions:
disp(node, loadCase, component)- Node displacementsdispX(node, loadCase)- X displacementdispY(node, loadCase)- Y displacementdispZ(node, loadCase)- Z displacement
Stress Functions:
stress(element, loadCase, component)- Element stressesstressXX(element, loadCase)- Normal stress XXstressVM(element, loadCase)- Von Mises stress
Example:
forceNeg(component, elementPath, loadCase, station?)
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 (usefullname()for dynamic paths)loadCase(String): Load case or combination namestation(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?)
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 elementloadCase(String): Load case or combination namestation(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)
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)
tshortTermLoss(tendon, point)Calculates short-term prestress losses in a tendon.
Parameters:
tendon(Tendon): The tendon objectpoint(Number or Point): Evaluation point
Returns: Number - Stress loss
getPushoverSubStageNames(analysisCase, ...)
getPushoverSubStageNames(analysisCase, ...)Returns substage names from a pushover analysis.
Returns: Array of Strings - Substage names
getPushoverControlNode(analysisCase, ...)
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 recalculatingPrefer 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:
Param.ts:655-973 -
ExprProvFunctionCall()method
Implementation Files:
ParamFunc.ts - Core function implementations
SEC/Functions.ts - Section analysis functions
OBrIM/Functions.ts - Alignment/bridge functions
FEA/Functions.ts - Finite element analysis functions
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:
Functions are case-sensitive
Most geometric functions require execution context
External module functions are only available in appropriate contexts
Functions can be nested and combined in expressions
Always handle potential null returns from geometric operations
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