About Functions Used in Relations
Mathematical, graph, and curve evaluation functions can be used in relations.
Mathematical Functions
The following operators can be used in relations, both in equations and in conditional statements.
Relations can include the following mathematical functions:
sin(x), cos(x), tan(x)
Standard trigonometric functions, where x is an angular value in degrees
asin(x)
Arc sine function, where the value of x is between -1.0 and 1.0. Result is the angular value in degrees.
acos(x)
Arc cosine function, where the value of x lies between -1.0 and 1.0. Result is the angular value in degrees.
atan(x)
Arc tangent function, where x is a numeric value. Result is the angular value in degrees.
atan2(y,x)
Arc tangent function of y/x, where x and y are any numeric values. Result is the angular value in degrees.
sinh(x)
Hyperbolic sine function, where the value of x lies between -85.0 and 85.0
cosh(x)
Hyperbolic cosine function, where the value of x lies between -85.0 and 85.0
tanh(x)
Hyperbolic tangent function, where the value of x lies between -85.0 and 85.0
sign(x,y)
Sign transfer of y to x. If y<0, the result is –abs(x); if y>=0, the result is abs(x).
mod(x,y)
Remainder function, that is x–int(x/y)*y, where int() is “integer part of”. The sign of the result is always the same as the sign of x.
if(c,x,y)
The “if” test or the switching function, where c is the condition, and x and y are the returned values. If the condition results in a non-zero value, the result of the function is x; if not, the result of the function is y.
bound(x,lo,hi)
Limits x between the ‘lo’ and the ‘hi’ values. If x < lo; the result of the function is lo; if x > hi, the result is hi; for all other values of x, the result of the function is x. The ‘lo’ value must be smaller than the ‘hi’ value.
dead(x,lo,hi)
Defines a range of values for x, for which the result of the function is 0. ‘lo’ and ‘hi’ define the range of values. If x < lo, the result of the function is x–lo; if x > hi, the result of the function is x–hi, if x is between “lo” and “hi”, the result of the function is 0.
near(x,y,delta)
Tests whether two values are close, where x and y are the two values and delta defines their permissible difference. If x lies within delta of y, the result of the function is 1.0 (true). If abs(x–y) <= delta, the result of the function is 1.0; if abs(x-y) > delta, the result of the function is 0.0.
min(x,y)
Returns either x or y, whichever is the minimum value. If x < y, the result of the function is x; if x >=y, the result of the function is y.
max(x,y)
Returns either x or y, whichever is the maximum value. If x > y, the result of the function is x; if x<=y, the result of the function is y.
log(x)
Common logarithm (logarithm to the base 10)
ln(x)
Natural logarithm (logarithm to the base e)
exp(x)
e to an exponential degree
pow(num1, num2)
Obtains the value of num1 to the power num2.
sqrt(x)
Square root of x
abs(x)
Returns the absolute value of x. If x≥0, the result of the function is x; if x<0, the result of the function is –x.
ceil(x)
Rounds (x – 0.000 000 001) to positive infinity.
floor(x)
Rounds (x + 0.000 000 001) to negative infinity.
dbl_in_tol (arg1, arg2, arg3)
Checks whether a real number arg 1 matches another real number arg 2 within a specified tolerance arg 3. It returns TRUE, if the value of arg1 is between (arg 2 - arg 3) and (arg 2 + arg 3).
The function returns TRUE, if, the following condition is met:arg1 <= arg2+arg3 && arg1 >= arg2-arg3.
For example, to check if a given angle equals 45 degree within a tolerance of 3 degree. If the given angle (arg1) is 47, then it is within the range of arg2-arg3 (45-3) and arg2+arg3(45+3).
* 
All trigonometric functions use degrees.
 
Cabling Mode Function
You can use the Cabling mode functions to determine the length and maximum diameter of a cable, wire, or bundle.
To calculate the length of the cable
Use the following syntax to calculate the current length of a cable or bundle:
cable_len ("cable_name",location_id1,location_id2)
cable_name is the name of the cable or bundle that you want to measure in the current harness.
location_id is the internal feature ID of the location through which cable_name is routed, where location_id1 and location_id2 denote the locations between which the length is to be calculated.
Use the following syntax to calculate the length of the entire cable:
cable_len ("cable_name",-1,-1)
To calculate the maximum diameter of a cable, wire, or bundle
Use the following syntax to calculate the maximum diameter of a cable, wire, or bundle at a specific location:
cable_thick ("cable_name",location_id)
cable_name is the name of the cable, wire, or bundle that you want to measure in the current harness.
location_id is the internal feature ID of the location through which cable_name is routed.
Use the following syntax to calculate the maximum diameter of a cable, wire, or bundle:
cable_thick ("cable_name",-1)
Cabling Logical Data File Name Function
The cbl_logical_file function allows you to create a relation to the logical data file name that you import in an assembly. Note that this relation will return a value only if defined at an assembly level with logical data. The relation returns the name of the file as value. This relation can be assigned to a parameter. This parameter, when designated, can be used in Windchill to identify logical file name used in the cabling assembly without retrieving that assembly. The parameter helps you locate the referenced logical data file when you want to update it.
Case Study Functions
eang(e_ID1, e_ID2)
Angle in radians between two entities, e_ID1 and e_ID2, of a case study
elen(e_ID1)
Length of the e_ID1 entity of a case study
edistk(e_ID1, e_ID2)
Distance between two entities, e_ID1 and e_ID2
ecoordx(e_ID1)
x coordinate of the e_ID1 entity of a case study
ecoordy(e_ID1)
y coordinate of the e_ID1 entity of a case study
* 
e_ID1 and e_ID2 are integers that identify the Case Study entities.
 
Graph Evaluation Function
Graph evaluation function enables you to use graph features to drive dimensions through relations. The dimensions can be section, part, or assembly dimensions. The format is the following:
evalgraph("graph_name", x)
where:
graph_name—the name of a graph.
x—the value along the x-axis of the graph for which the y value is returned.
For sweep features, you can specify the trajectory parameter trajpar as the second argument of this function.
* 
A graph feature is usually evaluated for its defined x-axis values. When it is evaluated beyond the defined range, the y-axis values are extrapolated. The system calculates the extrapolated value for values of x less than the initial value by extending a tangent line back from the initial point. Likewise, the system calculates the extrapolated value for values of x greater than the final value by extending a tangent line out from the final point.
Composite Curve Trajectory Function
The trajectory parameter of a composite curve, trajpar_of_pnt, can be used in relations.
The following function returns a value between 0.0 and 1.0:
trajpar_of_pnt("trajname", "pointname")
where:
trajname—the name of a composite curve.
pointname—the name of a datum point.
The trajectory is a parameter along the composite curve at which the plane, normal to the tangent of the curve, passes through the datum point. The datum point does not have to be located on the curve—the parameter is calculated at the point on the curve that is closest to the datum point.
If the composite curve is used as the spine of a multitrajectory sweep, then trajpar_of_pnt either agrees with the parameter trajpar at this plane, or else with 1.0 – trajpar (depending on your choice of the starting point for the sweep feature).