/
Guard Parameter

Guard Parameter

The Guard parameter is a special type of parameter used to control the activation or deactivation of objects based on the values of other parameters. The "Guard" parameter is utilized in conjunction with Logical Statements.

In the Library, the "Guard" parameter should be positioned beneath the "Group" object. It is important to note that each "Guard" parameter that is connected to the same parameter must be placed within a separate “Group” object.

 

Example Syntax:

... <O N="GP1" T="Group"> <O T="--"> <P N="Guard" V="ColumnType .EQ. Rectangular" /> ... </O> <O T="--"> <P N="Guard" V="ColumnType .EQ. Circular" /> ... </O> </O>

 

List of Logical Statements

The following are logical statements that can be used within the expressions of Guard parameters:

.EQ. → Equal to (==)

.NE. → Not equal to (!=)

.LT. → Less than (<)

.LE. → Less than or equal to (<=)

.GT. → Greater than (>)

.GE. → Greater than or equal to (>=)

.AND. → AND (&&)

.OR. → OR (||)

.NOT. → NOT (!)

 

Example:

<O N="GuardObject1" T="Project" Category="Logical Statement and Test" TransAlignRule="Right"> <!-- created by ParamML Examples on 09.02.2023 --> <O N="Column_Type" T="Group"> <P N="Rectangular" V="1" Category="Column_Type" /> <P N="Circular" V="2" Category="Column_Type" /> </O> <O N="Input" T="Group"> <P N="W" V="10" D="column width" Role="Input" Category="Input" /> <P N="L" V="10" D="column length" Role="Input" Category="Input" /> <P N="D" V="10" D="column diameter" Role="Input" Category="Input" /> <P N="H" V="100" D="column height" Role="Input" Category="Input" /> <P N="ColumnType" V="Circular" Role="Input" Category="Input" /> </O> <O N="Geometry" T="Group"> <O T="Surface" Z="0"> <P N="Guard" V="ColumnType .EQ. Rectangular" /> <P N="Thickness" V="H" /> <O T="Point" X="0" Y="0" /> <O T="Point" X="W" Y="0" /> <O T="Point" X="W" Y="L" /> <O T="Point" X="0" Y="L" /> </O> <O T="Circle" Z="0"> <P N="Guard" V="ColumnType .EQ. Circular" /> <P N="Thickness" V="H" /> <P N="Radius" V="D/2" /> </O> </O> </O>

 

<O N="GuardObject1" T="Project" Category="Logical Statement and Test" TransAlignRule="Right"> <!-- created by ParamML Examples on 09.02.2023 --> <O N="Column_Type" T="Group"> <P N="Rectangular" V="1" Category="Column_Type" /> <P N="Circular" V="2" Category="Column_Type" /> </O> <O N="Input" T="Group"> <P N="W" V="10" D="column width" Role="Input" Category="Input" /> <P N="L" V="10" D="column length" Role="Input" Category="Input" /> <P N="D" V="10" D="column diameter" Role="Input" Category="Input" /> <P N="H" V="100" D="column height" Role="Input" Category="Input" /> <P N="ColumnType" V="Circular" Role="Input" Category="Input" /> </O> <O N="Geometry" T="Group"> <O T="Surface" Z="0"> <P N="Guard" V="ColumnType .EQ. Rectangular" /> <P N="Thickness" V="H" /> <O T="Point" X="0" Y="0" /> <O T="Point" X="W" Y="0" /> <O T="Point" X="W" Y="L" /> <O T="Point" X="0" Y="L" /> </O> <O T="Circle" Z="0"> <P N="Guard" V="ColumnType .EQ. Circular" /> <P N="Thickness" V="H" /> <P N="Radius" V="D/2" /> </O> </O> </O>

 

Navigate to the OpenBrIM App and search for your desired object.

Change the values of the "ColumnType" cell to "1" and "2" within the OpenBrIM app.

ColumnType=”1”
ColumnType=”2”

To view this example in the library, see (OpenBrIM Platform)

 

Example:

In the example provided, if the authors enters "2" as the value for the "DATA" parameter, only the "Guard" value in the group named "G2" is correct and functional, while the other groups are disregarded because they are incorrect.

As a result, the value of the "DataOutput" parameter will be 9 when "DATA" is equal to "2".

If the value of the "DATA" parameter is set to "1", then the "DataOutput" parameter will be equal to 5.

And, if the "DATA" parameter is set to "3", the value of the "DataOutput" parameter will be equal to 13.

To view this example in the library, see (OpenBrIM Platform)

 

Example:

To view this example in the library, see (OpenBrIM Platform)

Related content

Logical Statements
Logical Statements
More like this
"iif" Functions
"iif" Functions
More like this
Parameters
Parameters
More like this
Barrier [SIG]
Barrier [SIG]
More like this
What are Object and Parameter?
What are Object and Parameter?
More like this
Substructure Code Checks [EX1-SIG]
Substructure Code Checks [EX1-SIG]
More like this