Functions - HxGN SDx - Update 63 - Administration & Configuration

Administration and Configuration of HxGN SDx

Language
English
Product
HxGN SDx
Search by Category
Administration & Configuration
SmartPlant Foundation / SDx Version
10

The following functions can be used when creating condition expressions.

Function name

Description

Example

ABS

Specifies the absolute value of a number.

ABS(Obj.Value1) > 3

AVG

Specifies the average value for a returned set of values.

AVG(Obj.Value1, Obj.Value2) < 5

COUNT

Counts the number of objects in a set.

COUNT(Obj->TagArea) > 0

INSTR

Searches for a string in the values returned for the attribute.

INSTR(Obj.Name, "Admin User") > 0

INSTRB

Searches for a string in the values returned for the attribute. Returns TRUE if the substring exists in the string and FALSE if it does not.

INSTRB(Obj.Name, "Admin User")

ISSET

Tests whether the property value has been defined or set. Returns an integer value (1 if the property has been set).

ISSET(Obj.Name)>0

ISSETB

Tests whether the property value has been defined or set. Returns TRUE if the value has been set and FALSE if it has not.

ISSETB(Obj.Name)

LEFT

Specifies characters on the left side of a string.

LEFT(Obj.Name) = "ABC"

LEN

Counts the number of characters in a string.

LEN(Obj.Name) > 5

LIKE

Returns TRUE if the object contains the value or the value is a substring of the object.

Env.USERORGANIZATIONNAMEWITHDELIMITER LIKE(Obj.SPFCollaboratingOrganizations)

LOWER

Converts the contents of the returned string to lowercase characters, and compares the results to the specified string.

LOWER(Obj.Name) = "graph"

MAX

Specifies the highest of the returned values.

MAX(Obj.Value1, Obj.Value2) > 5

MID

Returns all characters from a given position in a string to the end of the string.

MID("Intergraph", 6) would return a value of "graph".

MIN

Specifies a minimum value for returned values.

MIN(Obj.Value1, Obj.Value2) < 3

RIGHT

Specifies characters on the right side of a string.

RIGHT(Obj.Name) = "XYZ"

ROUND

Rounds the returned number to the nearest integer.

ROUND(Obj.Value1) >= 3

SUM

Evaluates the sum of all returned values.

SUM(Obj.Value1, Obj.Value2) < 5

TRUNC

Specifies the integer portion of a number.

TRUNC(Obj.Value1)=3

UPPER

Converts the contents of the returned string to uppercase characters, and compares the results to the specified string.

UPPER(Obj.Name) = "ADMIN"

Date and time functions

Function name

Description

Example

DateAdd

Adds a time (in seconds) to a date and returns a new date.

If you want to display the Update method on an object for a specific duration, you can use this function in a condition on the method.

For example, you want to display the method on the object for only 1800 seconds after the object is created.

Now<DateAdd(Obj.CreationDate, 1800)

DateDiff

Returns the difference between two dates in seconds.

If you want to display the Update method on an object after a specific duration, you can use this function in a condition on the method.

For example, you want to display the method on the object only 1200 seconds after the object is created.

DateDiff(Now, Obj.CreationDate)>1200

Year

Returns the year (integer) for a date (evaluated using regional settings).

For example, if the date and time is 12 seconds past 1:54 PM CST on March 18, 2020, each of these functions return the following:

Year = 2020

Year_GMT

Returns the year for a date based on the international time (Greenwich Mean Time).

Year_GMT = 2020

Month

Returns the month (between 1 and 12) using regional settings.

Month = 3

Month_GMT

Returns the month based on the international time.

Month_GMT = 3

Day

Returns the day (between 1 and 31) using regional settings.

Day = 18

Day_GMT

Returns the day based on the international time.

Day_GMT = 18

Weekday

Returns the weekday (Sunday=1, Saturday=7) using regional settings.

Weekday = 4 (Wednesday=4)

Hour

Returns the hour (between 0 and 23) using regional settings.

Hour = 13

Hour_GMT

Returns the hour based on the international time.

Hour_GMT = 19

Minute

Returns the minute (between 0 and 59) using regional settings.

Minute = 54

Minute_GMT

Returns the minute based on the international time.

Minute_GMT = 54

Second

Returns the second.

Second = 12

UOM function

Use the UOM function to insert a unit of measure value into a function. The UOM function has two arguments that are both strings (the second value can come from a user variable). The first argument identifies the unit of measure list, and the second argument is the actual UM value.

For example:

  • UoM('LengthUoM','40 cm')>obj.length. Objects with lengths less the .04 m (4 cm) satisfy this condition.

  • obj.length*obj.width>UoM(AreaUoM,'200 cm^2'). Objects whose length*width is greater than .2 m^2 (the SI UoM) satisfy this condition.

When conditions involve units of measure, the unit of measure values are converted to SI values for purposes of analyzing the condition.