Headers
stringlengths 3
162
| Content
stringlengths 12
32.8k
|
---|---|
MULTIPLY and DIVIDE (* and /) | The multiply and divide functions available are
number * number
-> number
number / number
-> number
Multiply or divide two numbers. They can also be used as unary operators at the beginning of a parenthesized sub-expression. Numeric underflow is not considered to be an error and neither is it flagged as a warning. The result returned is zero.
Units are consolidated across Multiply and Divide. The result is returned in the current units of the physical quantity of the result for example when current units of pressure are psi then:
If one value has no unit it is assumed to be a scaling factor. This also applies to reciprocal physical quantities. For example:
for (10 / XLEN) will return 2mm-1 when XLEN is 5mm
2 * 3 -> 6.0
2 / 3 -> 0.666666666
Divide by zero.
Synopsis
number * number
-> number
number / number
-> number
Description
Multiply or divide two numbers. They can also be used as unary operators at the beginning of a parenthesized sub-expression. Numeric underflow is not considered to be an error and neither is it flagged as a warning. The result returned is zero.
Side Effects
Units are consolidated across Multiply and Divide. The result is returned in the current units of the physical quantity of the result for example when current units of pressure are psi then:
q (20kgf/ 1 cm2 ) will return 284.47PSI
If one value has no unit it is assumed to be a scaling factor. This also applies to reciprocal physical quantities. For example:
for (10 / XLEN) will return 2mm-1 when XLEN is 5mm
Example
2 * 3 -> 6.0
2 / 3 -> 0.666666666
Errors
Divide by zero.
Synopsis
number * number
-> number
number / number
-> number
Description
Side Effects
(10 / XLEN)
Example
2 * 3 -> 6.0
2 / 3 -> 0.666666666
Errors |
Numeric (Real) Functions | All referenced units are current units. The numeric functions available are:
ABS ( number1 )
Gives the absolute value of a number
ACOS ( number1 )
Gives the arc cosine of a number, in degrees.
ASIN ( number1 )
Gives the arc sine of a number, in degrees.
ATAN ( number1 )
Gives the arc tangent of a number, in degrees.
ATANT ( number1, number2 )
Gives the arc tangent of number1/number2, in degrees, with the appropriate sign.
ALOG ( number1 )
Gives the exponential function (natural anti-log) of a number.
ARRAY(pos or dir or ori)
Converts a position, direction or orientation value or attribute into three numbers.
ARRAYSIZE ( variable-name )
Gives the size of an array variable.
ARRAYWIDTH( variable-name )
Gives the largest display width of any string in array variable-name.
COMPONENT dir OF pos2
Gives the magnitude of a vector drawn from E0 N0 U0 to pos2, projected in the direction dir1.
INT ( number1 )
Gives the truncated integer value of a number.
SIN ( number1 )
Gives the sine, cosine or tangent value of a number (considered to be in current units of angle (degrees) if value is unqualified).
COS ( number1 )
Gives the sine, cosine or tangent value of a number (considered to be in current units of angle (degrees) if value is unqualified).
TAN ( number1 )
Gives the sine, cosine or tangent value of a number (considered to be in current units of angle (degrees) if value is unqualified).
LENGTH ( text1 )
Gives the length of text1.
LOG ( number1 )
Gives the natural logarithm of a number.
MATCH ( text1, text2 )
Gives the position of the beginning of the leftmost occurrence of text2 in text1. If text2 does not occur in text1, 0 is returned.
MAX ( number1, number2[ , number3 [. . .]]) )
Gives the maximum value of the arguments.
MIN ( number1, number2[ , number3 [. . .]]) )
Gives the minimum value of the arguments.
NEGATE
Multiply a number by -1.0.
NINT ( number1 )
Gives the nearest integer to a real. NINT(N+0.5) is equal to N+1 if N is positive or equal to zero, to N if N is negative.
OCCUR ( text1, text2 )
Gives the number of times string text2 occurs in string text1.
REAL ( text1 )
Try to read a number at the beginning of text1.
POWER ( number1, number2 )
Gives the value of number1 raised to the power number2.
SQRT ( number1 )
Gives the square root of a number.
VVALUE ( variable-name )
Used for late evaluation of variables. Gives a real value.
ABS ( number1 )
-> number
Returns the absolute value of a real.
None.
ABS ( -3.2 ) -> 3.2
None.
All these will return values in current angle units.
ASIN ( number1 )
-> number
ACOS ( number1 )
-> number
ATAN ( number1 )
-> number
ATANT ( number1, number2 )
-> number
Return the arc-cosine, arc-sine or arc-tangent of a number, in degrees.
ATANT returns the arc-tangent of number1/number2 with the appropriate sign. ATANT is useful where the second value is near or equal to zero.
For example, (6 0 ATANT) will give the correct result of 90 degrees, but (6 0 D ATAN) will indicate an error when trying to divide by zero.
None.
ACOS ( 0.8660254 ) -> 30degrees
Argument of ACOS or ASIN out of range [-1.0,+1.0]
ATANT (0.0,0.0) is undefined.
ALOG ( number1 )
-> number
Return the exponential function (natural anti-log) of a number.
Numeric underflow causes the result to be set to zero.
ALOG( -0.7 ) -> 0.4965853
Floating point overflow.
ARRAY(pos or dir or ori)
-> number
Converts a position, direction or orientation value or attribute into three numbers.
None
ARRAY(e100 ) -> 100 0 0
None.
ARRAYSize ( variable-name )
-> number
Give the size of an array variable.
If the array variable does not exist, the result is undefined.
ARRAYSIZE(!array) -> 2.0
The variable is a scalar variable and not an array variable.
The variable is an array variable element and not an array variable.
ARRAYWIDTH ( variable-name )
-> number
Give the largest display with of any string in array variable_name.
None.
If an array contains the following values:
!ARRAY[1] ’Bread’
!ARRAY[2] ’is’
!ARRAY[3] ’for’
!ARRAY[4] ’life,’
!ARRAY[5] ’not’
!ARRAY[6] ’just’
!ARRAY[7] ’for’
!ARRAY[8] ’breakfast’
Then
ARRAYWIDTH(!ARRAY -> 9
defines the length of ’breakfast’.
The variable is a scalar variable and not an array variable.
The variable is an array variable element and not an array variable.
COMPonent dir1 OF pos2
-> text
Returns the magnitude of a vector drawn from E0 N0 U0 to pos2, projected in the direction dir1.
None.
COMP E 45 N of N 0 E 100 U 50 -> 70.710
None.
DISTConvert ( number )
-> number
Returns a distance value cast from the input number.
The input value is converted to its database units (if it is a physical quantity) and then cast to database units of distance (i.e. mm) and presented in current units of distance.
None.
When current distance units are mm
distc(1000)
distc(10metre)
distc( 5pascal)
distc (5atm)
-> 1000mm
-> 10000mm
-> 5mm
-> 506625mm
When current distance units are inch
distc(1000)
distc(10metre)
distc( 5pascal)
distc (5atm)
-> 39.4in
-> 393.7in
-> 0.2in
-> 19945.9in
None.
All these will accept values qualified by angle units. If no unit is supplied the value is assumed to be in current angle units (usually degrees).
SINe ( number1 )
-> number
COSine ( number1 )
-> number
TANgent ( number1 )
-> number
Return the sine, cosine or tangent value of a number (considered to be in degrees).
None.
COS ( 0.0 ) returns 1.0
TAN ( 45.0 degrees ) returns 1.0
TAN (0.785 radians) ) returns 0.9992
Division by zero for TAN if the sine is (nearly) equal to zero.
INT ( number1 )
-> number
Return the truncated integer value of a number.
None.
INT ( -23.7 ) -> -23.0
Integer overflow.
LENgth ( text1 )
-> number
Return the length of text1.
None.
LENGTH ( ’abcdef’ ) -> 6.0
LENGTH ( ’’ ) -> 0.0
None.
LOG ( number1 )
-> number
Return the natural logarithm of a number.
None.
LOG( 3 ) -> 1 0986123
Negative arguments.
MATch ( text1 , text2)
-> number
Return the position of the beginning of the leftmost occurrence of text2 in text1. If text2 does not occur in text1, 0 is returned.
None.
MATCH ( ’abcdef’ , ’cd’ ) -> 3.0
MATCH ( ’abcdef’ , ’x’ ) -> 0.0
MATCH ( ’abcdef’ , ’’ ) -> 1.0
None.
MAX ( number1 , number2 [ , number3 [ ... ] ] )
-> number
MIN ( number1 , number2 [ , number3 [ ... ] ] )
-> number
Return the maximum or minimum value of the arguments.
Values being evaluated are assumed to of a common physical quantity.
If no unit qualifiers are supplied they are simply numbers.
If a physical quantity is defined the result will be in current units of that quantity.
If unqualified numbers are mixed with unit values they are assumed to be in the current units of that physical quantity.
If quantities are in mixed units they are all compared in comparison to a standard unit.
If quantities are of different types of physical quantities a warning is issued and the numeric result compares the values in their database units.
Min and Max return a value with the same dimension as that of their arguments.
MAX ( 1 , 3.4 ) -> 3.4
MIN ( 7.6 , -12.33 , 2.3 ) -> -12.33
MIN (7.6ft, 12.33inch, 1000mm ) -> 12.3 in (current distance units are inch)
MAX (7.6ft, 12.33inch, 1000 ) -> 1000in (current distance units are inch)
MAX (7.6ft, 12.33inch, 1kg ) -> 2316.5 (database mm equivalent of 7.6ft)
None.
NEGate ( number1 )
-> number
Multiply a real by -1.0.
None.
NEG ( 1 ) -> -1.0
None.
NINT ( number1 )
-> number
Return the nearest integer to a real. NINT(N+0.5) is equal to N+1 if N is positive or equal to zero, to N if N is negative.
None.
NINT ( 1.1 ) -> 1.0
NINT ( -23.7 ) -> -24.0
NINT ( 1.5 ) -> 2.0
NINT ( -11.5 ) -> -12.0
Integer overflow.
OCCUR(text1, text2)
-> integer
Counts the number of times string text2 occurs in string text1
None.
OCCUR (’ABBACCBBBBBAB’, ’BB’) -> 3
OCCUR(’ZZZZZZZZZZZ’, ’A’) -> 0
None.
REAL ( text1 )
-> number
Try to read a real number at the beginning of text1.
Note that if text is in the form of an exponent, (-12E-1 in the third example), there must be no spaces in it.
Note: this function was formerly called NUMBER.
Numeric underflow causes the result to be set to zero.
If the text string contains units they are ignored and the value only is returned.
If the test string contains text that is NOT a valid unit it will generate an error.
If the text string is space separated from the number it is completely ignored.
REAL ( ’12.34’) -> 12.34
REAL ( ’ 7.23 E 3 meters’ ) -> 7.23
REAL ( ’ -12E-1 meters ’ ) -> -1.2
REAL (' 1200 fred ' ) -> 1200
REAL (' 1200fred ' ) -> returns an error
This will return the value of the number in the string IGNORING any unit qualifier. The unit qualifier must still be a valid unit qualifier. This is done so that output from $! And VAR ! commands can still be accepted by the REAL function.
Unable to convert the text into a real number.
POWer ( number1 , number2 )
-> real
Return the value of number1 raised to the power number2.
If the value being raised to a power is that of a physical quantity the result is also of a physical quantity.(in relevant current units).
If the resultant quantity is non physical (for example, by raising to a fractional power, or an extreme power, a warning is given and only the value of quantity is raised to the power.
If the power is a physical quantity this also gives a warning.
POWER ( -2 , 3 ) -> -8
POWER ( -2inch , 2 ) -> 4in2
POWER ( 2inch, 3.5 ) -> returns 11.314 with an error (i.e. 2**3.5)
Floating point overflow.
Zero first argument and non-positive second argument (effectively divide by zero).
Negative first argument and non-integer second argument.
SQrt ( number1 )
-> number
Return the square root of a real.
Units are consolidated across SQRT. The resultant value will be in current units of that quantity.
If the resultant quantity has no recognized physical dimension a warning is given and the value return will be a number relating to the input value in database units.
SQRT ( 4 ) -> 2.0
SQRT ( 4inch2 ) -> 2.0inch
sqrt ( 4inch3 ) -> a warning and 256.02 which is sqrt (4*25.4mm)
Negative argument.
VVALUE is used for the late evaluation of PML variables.
VVALue( variable_name )
-> number
VVALue( variable_name , number )
-> number
With one argument, returns value of the scalar variable or value of the array variable element as a number.
With two arguments, returns value of the element corresponding to the index number as a number.
The value of the variable will be returned, irrespective of its units.
This will return the value of the number in the string IGNORING any unit qualifier. The unit qualifier must still be a valid unit qualifier. This is done so that output from $! And VAR ! commands can still be accepted by the VVAL function.
If the scalar variable, the array variable or the array variable element does not exist, the result is undefined.
VVAL ( !array[1] ) -> 1.0
VVAL ( !array , 2 ) -> 0.0
Scalar variable may not be indexed. For example, VTEXT (!var[1]) ) will return an error.
Array variable must have an index. For example, VTEXT ( !array ) ) will return an error.
The string can not be converted to a number.
Function
Comments
ABS ( number1 )
Gives the absolute value of a number
ACOS ( number1 )
Gives the arc cosine of a number, in degrees.
ASIN ( number1 )
Gives the arc sine of a number, in degrees.
ATAN ( number1 )
Gives the arc tangent of a number, in degrees.
ATANT ( number1, number2 )
Gives the arc tangent of number1/number2, in degrees, with the appropriate sign.
ALOG ( number1 )
Gives the exponential function (natural anti-log) of a number.
ARRAY(pos or dir or ori)
Converts a position, direction or orientation value or attribute into three numbers.
ARRAYSIZE ( variable-name )
Gives the size of an array variable.
ARRAYWIDTH( variable-name )
Gives the largest display width of any string in array variable-name.
COMPONENT dir OF pos2
Gives the magnitude of a vector drawn from E0 N0 U0 to pos2, projected in the direction dir1.
INT ( number1 )
Gives the truncated integer value of a number.
SIN ( number1 )
Gives the sine, cosine or tangent value of a number (considered to be in current units of angle (degrees) if value is unqualified).
COS ( number1 )
Gives the sine, cosine or tangent value of a number (considered to be in current units of angle (degrees) if value is unqualified).
TAN ( number1 )
Gives the sine, cosine or tangent value of a number (considered to be in current units of angle (degrees) if value is unqualified).
LENGTH ( text1 )
Gives the length of text1.
LOG ( number1 )
Gives the natural logarithm of a number.
MATCH ( text1, text2 )
Gives the position of the beginning of the leftmost occurrence of text2 in text1. If text2 does not occur in text1, 0 is returned.
MAX ( number1, number2[ , number3 [. . .]]) )
Gives the maximum value of the arguments.
MIN ( number1, number2[ , number3 [. . .]]) )
Gives the minimum value of the arguments.
NEGATE
Multiply a number by -1.0.
NINT ( number1 )
Gives the nearest integer to a real. NINT(N+0.5) is equal to N+1 if N is positive or equal to zero, to N if N is negative.
OCCUR ( text1, text2 )
Gives the number of times string text2 occurs in string text1.
REAL ( text1 )
Try to read a number at the beginning of text1.
POWER ( number1, number2 )
Gives the value of number1 raised to the power number2.
SQRT ( number1 )
Gives the square root of a number.
VVALUE ( variable-name )
Used for late evaluation of variables. Gives a real value.
Synopsis
ABS ( number1 )
-> number
Description
Returns the absolute value of a real.
Side Effects
None.
Example
ABS ( -3.2 ) -> 3.2
Errors
None.
Synopsis
ASIN ( number1 )
-> number
ACOS ( number1 )
-> number
ATAN ( number1 )
-> number
ATANT ( number1, number2 )
-> number
Description
Return the arc-cosine, arc-sine or arc-tangent of a number, in degrees.
ATANT returns the arc-tangent of number1/number2 with the appropriate sign. ATANT is useful where the second value is near or equal to zero.
For example, (6 0 ATANT) will give the correct result of 90 degrees, but (6 0 D ATAN) will indicate an error when trying to divide by zero.
Side Effects
None.
Example
ACOS ( 0.8660254 ) -> 30degrees
Errors
Argument of ACOS or ASIN out of range [-1.0,+1.0]
ATANT (0.0,0.0) is undefined.
Synopsis
ALOG ( number1 )
-> number
Description
Return the exponential function (natural anti-log) of a number.
Side Effects
Numeric underflow causes the result to be set to zero.
Example
ALOG( -0.7 ) -> 0.4965853
Errors
Floating point overflow.
Synopsis
ARRAY(pos or dir or ori)
-> number
Description
Converts a position, direction or orientation value or attribute into three numbers.
Side Effects
None
Example
ARRAY(e100 ) -> 100 0 0
Errors
None.
Synopsis
ARRAYSize ( variable-name )
-> number
Description
Give the size of an array variable.
Side Effects
If the array variable does not exist, the result is undefined.
Example
ARRAYSIZE(!array) -> 2.0
Errors
The variable is a scalar variable and not an array variable.
The variable is an array variable element and not an array variable.
Synopsis
ARRAYWIDTH ( variable-name )
-> number
Description
Give the largest display with of any string in array variable_name.
Side Effects
None.
Example
If an array contains the following values:
!ARRAY[1] ’Bread’
!ARRAY[2] ’is’
!ARRAY[3] ’for’
!ARRAY[4] ’life,’
!ARRAY[5] ’not’
!ARRAY[6] ’just’
!ARRAY[7] ’for’
!ARRAY[8] ’breakfast’
Then
ARRAYWIDTH(!ARRAY -> 9
defines the length of ’breakfast’.
Errors
The variable is a scalar variable and not an array variable.
The variable is an array variable element and not an array variable.
Synopsis
COMPonent dir1 OF pos2
-> text
Description
Returns the magnitude of a vector drawn from E0 N0 U0 to pos2, projected in the direction dir1.
Side Effects
None.
Example
COMP E 45 N of N 0 E 100 U 50 -> 70.710
Errors
None.
Synopsis
DISTConvert ( number )
-> number
Description
Returns a distance value cast from the input number.
The input value is converted to its database units (if it is a physical quantity) and then cast to database units of distance (i.e. mm) and presented in current units of distance.
Side Effects
None.
Example
When current distance units are mm
distc(1000)
distc(10metre)
distc( 5pascal)
distc (5atm)
-> 1000mm
-> 10000mm
-> 5mm
-> 506625mm
When current distance units are inch
distc(1000)
distc(10metre)
distc( 5pascal)
distc (5atm)
-> 39.4in
-> 393.7in
-> 0.2in
-> 19945.9in
Errors
None.
Synopsis
SINe ( number1 )
-> number
COSine ( number1 )
-> number
TANgent ( number1 )
-> number
Description
Return the sine, cosine or tangent value of a number (considered to be in degrees).
Side Effects
None.
Example
COS ( 0.0 ) returns 1.0
TAN ( 45.0 degrees ) returns 1.0
TAN (0.785 radians) ) returns 0.9992
Errors
Division by zero for TAN if the sine is (nearly) equal to zero.
Synopsis
INT ( number1 )
-> number
Description
Return the truncated integer value of a number.
Side Effects
None.
Example
INT ( 1.6 ) -> 1.0
INT ( -23.7 ) -> -23.0
Errors
Integer overflow.
Synopsis
LENgth ( text1 )
-> number
Description
Return the length of text1.
Side Effects
None.
Example
LENGTH ( ’abcdef’ ) -> 6.0
LENGTH ( ’’ ) -> 0.0
Errors
None.
Synopsis
LOG ( number1 )
-> number
Description
Return the natural logarithm of a number.
Side Effects
None.
Example
LOG( 3 ) -> 1 0986123
Errors
Negative arguments.
Synopsis
MATch ( text1 , text2)
-> number
Description
Return the position of the beginning of the leftmost occurrence of text2 in text1. If text2 does not occur in text1, 0 is returned.
Side Effects
None.
Example
MATCH ( ’abcdef’ , ’cd’ ) -> 3.0
MATCH ( ’abcdef’ , ’x’ ) -> 0.0
MATCH ( ’abcdef’ , ’’ ) -> 1.0
Errors
None.
Synopsis
MAX ( number1 , number2 [ , number3 [ ... ] ] )
-> number
MIN ( number1 , number2 [ , number3 [ ... ] ] )
-> number
Description
Return the maximum or minimum value of the arguments.
Side Effects
Values being evaluated are assumed to of a common physical quantity.
If no unit qualifiers are supplied they are simply numbers.
If a physical quantity is defined the result will be in current units of that quantity.
If unqualified numbers are mixed with unit values they are assumed to be in the current units of that physical quantity.
If quantities are in mixed units they are all compared in comparison to a standard unit.
If quantities are of different types of physical quantities a warning is issued and the numeric result compares the values in their database units.
Min and Max return a value with the same dimension as that of their arguments.
Example
MAX ( 1 , 3.4 ) -> 3.4
MIN ( 7.6 , -12.33 , 2.3 ) -> -12.33
MIN (7.6ft, 12.33inch, 1000mm ) -> 12.3 in (current distance units are inch)
MAX (7.6ft, 12.33inch, 1000 ) -> 1000in (current distance units are inch)
MAX (7.6ft, 12.33inch, 1kg ) -> 2316.5 (database mm equivalent of 7.6ft)
Errors
None.
Synopsis
NEGate ( number1 )
-> number
Description
Multiply a real by -1.0.
Side Effects
None.
Example
NEG ( 1 ) -> -1.0
Errors
None.
Synopsis
NINT ( number1 )
-> number
Description
Return the nearest integer to a real. NINT(N+0.5) is equal to N+1 if N is positive or equal to zero, to N if N is negative.
Side Effects
None.
Example
NINT ( 1.1 ) -> 1.0
NINT ( -23.7 ) -> -24.0
NINT ( 1.5 ) -> 2.0
NINT ( -11.5 ) -> -12.0
Errors
Integer overflow.
Synopsis
OCCUR(text1, text2)
-> integer
Description
Counts the number of times string text2 occurs in string text1
Side Effects
None.
Example
OCCUR (’ABBACCBBBBBAB’, ’BB’) -> 3
OCCUR(’ZZZZZZZZZZZ’, ’A’) -> 0
Errors
None.
Synopsis
REAL ( text1 )
-> number
Description
Try to read a real number at the beginning of text1.
Note that if text is in the form of an exponent, (-12E-1 in the third example), there must be no spaces in it.
Note: this function was formerly called NUMBER.
Side Effects
Numeric underflow causes the result to be set to zero.
If the text string contains units they are ignored and the value only is returned.
If the test string contains text that is NOT a valid unit it will generate an error.
If the text string is space separated from the number it is completely ignored.
Example
REAL ( ’12.34’) -> 12.34
REAL ( ’ 7.23 E 3 meters’ ) -> 7.23
REAL ( ’ -12E-1 meters ’ ) -> -1.2
REAL (' 1200 fred ' ) -> 1200
REAL (' 1200fred ' ) -> returns an error
This will return the value of the number in the string IGNORING any unit qualifier. The unit qualifier must still be a valid unit qualifier. This is done so that output from $! And VAR ! commands can still be accepted by the REAL function.
Note:
The extension of these functions are NOT supported in DARS as they require PML functionality.
Errors
Unable to convert the text into a real number.
Synopsis
POWer ( number1 , number2 )
-> real
Description
Return the value of number1 raised to the power number2.
Side Effects
If the value being raised to a power is that of a physical quantity the result is also of a physical quantity.(in relevant current units).
If the resultant quantity is non physical (for example, by raising to a fractional power, or an extreme power, a warning is given and only the value of quantity is raised to the power.
If the power is a physical quantity this also gives a warning.
Example
POWER ( -2 , 3 ) -> -8
POWER ( -2inch , 2 ) -> 4in2
POWER ( 2inch, 3.5 ) -> returns 11.314 with an error (i.e. 2**3.5)
Errors
Floating point overflow.
Zero first argument and non-positive second argument (effectively divide by zero).
Negative first argument and non-integer second argument.
Synopsis
SQrt ( number1 )
-> number
Description
Return the square root of a real.
Side Effects
Units are consolidated across SQRT. The resultant value will be in current units of that quantity.
If the resultant quantity has no recognized physical dimension a warning is given and the value return will be a number relating to the input value in database units.
Example
SQRT ( 4 ) -> 2.0
SQRT ( 4inch2 ) -> 2.0inch
sqrt ( 4inch3 ) -> a warning and 256.02 which is sqrt (4*25.4mm)
Errors
Negative argument.
Synopsis
VVALue( variable_name )
-> number
VVALue( variable_name , number )
-> number
Description
With one argument, returns value of the scalar variable or value of the array variable element as a number.
With two arguments, returns value of the element corresponding to the index number as a number.
The value of the variable will be returned, irrespective of its units.
This will return the value of the number in the string IGNORING any unit qualifier. The unit qualifier must still be a valid unit qualifier. This is done so that output from $! And VAR ! commands can still be accepted by the VVAL function.
Note:
The extension of these functions are NOT supported in DARS as they require PML functionality.
Side Effects
If the scalar variable, the array variable or the array variable element does not exist, the result is undefined.
Example
VVAL ( !array[1] ) -> 1.0
VVAL ( !array , 2 ) -> 0.0
Errors
Scalar variable may not be indexed. For example, VTEXT (!var[1]) ) will return an error.
Array variable must have an index. For example, VTEXT ( !array ) ) will return an error.
The string can not be converted to a number.
Note:
The extension of these functions are NOT supported in DARS as they require PML functionality.
Note:
The extension of these functions are NOT supported in DARS as they require PML functionality.
Function
Comments
ABS ( number1 )
ACOS ( number1 )
ASIN ( number1 )
ATAN ( number1 )
ATANT ( number1, number2 )
number1
number2
ALOG ( number1 )
ARRAY(pos or dir or ori)
ARRAYSIZE ( variable-name )
ARRAYWIDTH( variable-name )
COMPONENT dir OF pos2
pos2
dir1
INT ( number1 )
SIN ( number1 )
COS ( number1 )
TAN ( number1 )
LENGTH ( text1 )
LOG ( number1 )
MATCH ( text1, text2 )
text2
text1
text2
text1
MAX ( number1, number2[ , number3 [. . .]]) )
MIN ( number1, number2[ , number3 [. . .]]) )
NEGATE
NINT ( number1 )
OCCUR ( text1, text2 )
text2
text1
REAL ( text1 )
text1
POWER ( number1, number2 )
number1
number2
SQRT ( number1 )
VVALUE ( variable-name )
Synopsis
ABS ( number1 )
-> number
Description
Side Effects
Example
ABS ( -3.2 ) -> 3.2
Errors
Synopsis
ASIN ( number1 )
-> number
ACOS ( number1 )
-> number
ATAN ( number1 )
-> number
ATANT ( number1, number2 )
-> number
Description
number1/number2
Side Effects
Example
ACOS ( 0.8660254 ) -> 30degrees
Errors
ATANT (0.0,0.0)
Synopsis
ALOG ( number1 )
-> number
Description
Side Effects
Example
ALOG( -0.7 ) -> 0.4965853
Errors
Synopsis
ARRAY(pos or dir or ori)
-> number
Description
Side Effects
Example
ARRAY(e100 ) -> 100 0 0
Errors
Synopsis
ARRAYSize ( variable-name )
-> number
Description
Side Effects
Example
Errors
Synopsis
ARRAYWIDTH ( variable-name )
-> number
Description
variable_name
Side Effects
Example
If an array contains the following values:
!ARRAY[1] ’Bread’
!ARRAY[2] ’is’
!ARRAY[3] ’for’
!ARRAY[4] ’life,’
!ARRAY[5] ’not’
!ARRAY[6] ’just’
!ARRAY[7] ’for’
!ARRAY[8] ’breakfast’
ARRAYWIDTH(!ARRAY -> 9
Errors
Synopsis
COMPonent dir1 OF pos2
-> text
Description
pos2
dir1.
Side Effects
Example
COMP E 45 N of N 0 E 100 U 50 -> 70.710
Errors
Synopsis
DISTConvert ( number )
-> number
Description
Side Effects
Example
-> 1000mm
-> 10000mm
-> 5mm
-> 506625mm
distc(1000)
distc(10metre)
distc( 5pascal)
distc (5atm)
-> 39.4in
-> 393.7in
-> 0.2in
-> 19945.9in
Errors
Synopsis
SINe ( number1 )
-> number
COSine ( number1 )
-> number
TANgent ( number1 )
-> number
Description
Side Effects
Example
COS ( 0.0 ) returns 1.0
TAN ( 45.0 degrees ) returns 1.0
TAN (0.785 radians) ) returns 0.9992
Errors
Synopsis
INT ( number1 )
-> number
Description
Side Effects
Example
Errors
Synopsis
LENgth ( text1 )
-> number
Description
text1
Side Effects
Example
LENGTH ( ’abcdef’ ) -> 6.0
LENGTH ( ’’ ) -> 0.0
Errors
Synopsis
LOG ( number1 )
-> number
Description
Side Effects
Example
LOG( 3 ) -> 1 0986123
Errors
Synopsis
MATch ( text1 , text2)
-> number
Description
text2
text1
text2
text1
Side Effects
Example
MATCH ( ’abcdef’ , ’cd’ ) -> 3.0
MATCH ( ’abcdef’ , ’x’ ) -> 0.0
MATCH ( ’abcdef’ , ’’ ) -> 1.0
Errors
Synopsis
MAX ( number1 , number2 [ , number3 [ ... ] ] )
-> number
MIN ( number1 , number2 [ , number3 [ ... ] ] )
-> number
Description
Side Effects
Example
MAX ( 1 , 3.4 ) -> 3.4
MIN ( 7.6 , -12.33 , 2.3 ) -> -12.33
MIN (7.6ft, 12.33inch, 1000mm ) -> 12.3 in (current distance units are inch)
MAX (7.6ft, 12.33inch, 1000 ) -> 1000in (current distance units are inch)
MAX (7.6ft, 12.33inch, 1kg ) -> 2316.5 (database mm equivalent of 7.6ft)
Synopsis
NEGate ( number1 )
-> number
Description
Side Effects
Example
NEG ( 1 ) -> -1.0
Errors
Synopsis
Description
NINT(N+0.5)
N+1
N
N
N
Side Effects
Example
NINT ( 1.1 ) -> 1.0
NINT ( -23.7 ) -> -24.0
NINT ( 1.5 ) -> 2.0
NINT ( -11.5 ) -> -12.0
Errors
Synopsis
OCCUR(text1, text2)
-> integer
Description
text2
text1
Side Effects
Example
OCCUR (’ABBACCBBBBBAB’, ’BB’) -> 3
OCCUR(’ZZZZZZZZZZZ’, ’A’) -> 0
Errors
Synopsis
REAL ( text1 )
-> number
Description
text1
Side Effects
Example
REAL ( ’12.34’) -> 12.34
REAL ( ’ 7.23 E 3 meters’ ) -> 7.23
REAL ( ’ -12E-1 meters ’ ) -> -1.2
REAL (' 1200 fred ' ) -> 1200
REAL (' 1200fred ' ) -> returns a
Note
:
Errors
Synopsis
POWer ( number1 , number2 )
-> real
Description
number1
number2
Side Effects
Example
POWER ( -2 , 3 ) -> -8
POWER ( -2inch , 2 ) -> 4in2
POWER ( 2inch, 3.5 ) -> returns 11.314 with an error (i.e. 2**3.5)
Errors
Synopsis
SQrt ( number1 )
-> number
Description
Side Effects
Example
SQRT ( 4 ) -> 2.0
SQRT ( 4inch2 ) -> 2.0inch
sqrt ( 4inch3 ) -> a warning and 256.02 which is sqrt (4*25.4mm)
Errors
Synopsis
VVALue( variable_name )
-> number
VVALue( variable_name , number )
-> number
Description
Note
:
Side Effects
Example
VVAL ( !array[1] ) -> 1.0
VVAL ( !array , 2 ) -> 0.0
Errors
VTEXT (!var[1]) )
VTEXT ( !array ) ) |
Real Arrays | Real array expressions can contain attributes of type real array, for example: DESP.
|
Units and Physical Quantity Attributes in Expressions | In real expressions the dimension of the result is tracked using:
If at any time a value with no dimension occurs where a value with a specific dimension is needed then the value is taken to be one of that dimension in the current working units of that dimension (for example, mm for distances, degrees for angles). This will occur in addition and subtraction operations, and arguments for typed functions (for example,. trigonometric).
Whenever a clash of physical quantity occurs then either a warning or an error will be raised (for example, SIN(25inch).
In all expressions and functions physical quantities are tracked and the result, wherever possible is returned in the current units of the resultant physical quantity (dimension). If the system cannot do this (for example, the expression is not dimensionally sound, or the dimension exceeds the scope which the system can track) then a warning is issued and a simple numeric result is returned.
When a user enters a literal value then the type of physical quantity is not known and the decision as to what it is determined to make it consistent with the context with respect to other values in the expression. When it is finally determined the value is then taken to be in the current units of that quantity. The method of this determination is normally straightforward and is described in specific sections above.
The units for PML variables are also unknown. Where units are known and handled similarly in expression.
To cope with ’unknown’ units each value remembers its original units internally. An attempt is then made to allow for ’unknown’ units across operators and within functions. In general the physical quantity of the result of a function, or expressions, is tracked by the system and the resulting value is one of the resultant physical quantities. For example multiplying 3 distances together gives a result of a volume which will have units such as gallons, litres or cubic ft.
On comparison, addition or subtraction of two values then if one has units and the other has none (i.e. not a physical quantity) it is assumed to be the same sort of quantity as the other, and in the current units of that quantity.
For example:
If we are working in distance units of inches, it is known that XLEN is a distance value. Internally the value is held in mm, but the units are held as INCH. The units for ’10’ are held as unknown. On doing the comparison, the ’10’ is assumed to be inches and thus multiplied by 25.4 to make sure that the comparison works as expected.
Special action is also taken to preserve the correct units across multiplication, division, POWER and SQRT, as described in the sections above.
(XLEN GT 10).
The dimension of any attribute values used (for example, XLEN, BANG, DENS, GVOL)
The unit qualifiers of any values supplied
The known result of any function (for example, ASIN returns an angle, POW, SQRT return a computed dimension, MIN/MAX that of their arguments etc.)
The computed result of multiplication and division operation. (for example, GWEI/GVOL is a density)
The need for consistency for addition and subtraction operations
The dimension of any attribute values used (for example, XLEN, BANG, DENS, GVOL)
The dimension of any attribute values used (for example, XLEN, BANG, DENS, GVOL)
The unit qualifiers of any values supplied
The unit qualifiers of any values supplied
The known result of any function (for example, ASIN returns an angle, POW, SQRT return a computed dimension, MIN/MAX that of their arguments etc.)
The known result of any function (for example, ASIN returns an angle, POW, SQRT return a computed dimension, MIN/MAX that of their arguments etc.)
The computed result of multiplication and division operation. (for example, GWEI/GVOL is a density)
The computed result of multiplication and division operation. (for example, GWEI/GVOL is a density)
The need for consistency for addition and subtraction operations
The need for consistency for addition and subtraction operations
|
Using IDs in Expressions | IDs can be used in expressions. IDs can be any of the following:
SPEC OF SPREF OF FLAN 1 OF NEXT BRAN.
HEAD TUBE OF /BRAN1.
Element name, for example: /VESS1.
Refno, for example: =23/456.
Element type further up the hierarchy, for example: SITE.
Number within member list, for example: 3.
Type and number within member list, for example: BOX 3.
NEXT, PREV for next, previous within current list. Optionally with a count and/or element type, for example: NEXT 2 BOX, LAST CYL.
NEXT, PREV MEMBER for next, previous within member list. Optionally with a count and/or element type.
If the element type given is only valid as a member then MEMBER is assumed. For example, NEXT BOX at an EQUIPMENT will assume MEMBER.
FIRST, LAST for first and last in current list. Optionally with a count and/or element type.
FIRST, LAST MEMBER for first and last in member list. If the element type given is only valid as a member then MEMBER is assumed.
END to navigate up from current list.
END is similar to owner but not quite the same. For example, if the current element is a GROUP MEMBER, and it has been reached from the GROUP then END will return to the group but OWNE will go to the true owner.
Attribute of type ref, for example: CREF
SAME to mean last current element
NULREF to mean =0/0
CE for the current element
’OF’ may be used to nest the options indefinitely. For example:
SPEC OF SPREF OF FLAN 1 OF NEXT BRAN.
This denotes the SPEC element owing the SELE element pointed to by the SPREF attribute on the first FLANGE of the next BRANCH. ILEAVE TUBE, IARRIV TUBE, HEAD TUBE, TAIL TUBE can be added to denote tube. For example:
HEAD TUBE OF /BRAN1.
An error will occur if there is no implied tube for the element concerned.
ID arrays can also be used in expressions. For example, CRFA.
Element name, for example: /VESS1.
Element name, for example: /VESS1.
Refno, for example: =23/456.
Refno, for example: =23/456.
Element type further up the hierarchy, for example: SITE.
Element type further up the hierarchy, for example: SITE.
Number within member list, for example: 3.
Number within member list, for example: 3.
Type and number within member list, for example: BOX 3.
Type and number within member list, for example: BOX 3.
NEXT, PREV for next, previous within current list. Optionally with a count and/or element type, for example: NEXT 2 BOX, LAST CYL.
NEXT, PREV for next, previous within current list. Optionally with a count and/or element type, for example: NEXT 2 BOX, LAST CYL.
NEXT, PREV MEMBER for next, previous within member list. Optionally with a count and/or element type.
NEXT, PREV MEMBER for next, previous within member list. Optionally with a count and/or element type.
If the element type given is only valid as a member then MEMBER is assumed. For example, NEXT BOX at an EQUIPMENT will assume MEMBER.
If the element type given is only valid as a member then MEMBER is assumed. For example, NEXT BOX at an EQUIPMENT will assume MEMBER.
FIRST, LAST for first and last in current list. Optionally with a count and/or element type.
FIRST, LAST for first and last in current list. Optionally with a count and/or element type.
FIRST, LAST MEMBER for first and last in member list. If the element type given is only valid as a member then MEMBER is assumed.
FIRST, LAST MEMBER for first and last in member list. If the element type given is only valid as a member then MEMBER is assumed.
END to navigate up from current list.
END to navigate up from current list.
END is similar to owner but not quite the same. For example, if the current element is a GROUP MEMBER, and it has been reached from the GROUP then END will return to the group but OWNE will go to the true owner.
END is similar to owner but not quite the same. For example, if the current element is a GROUP MEMBER, and it has been reached from the GROUP then END will return to the group but OWNE will go to the true owner.
Attribute of type ref, for example: CREF
Attribute of type ref, for example: CREF
SAME to mean last current element
SAME to mean last current element
NULREF to mean =0/0
NULREF to mean =0/0
CE for the current element
CE for the current element
’OF’ may be used to nest the options indefinitely. For example:
SPEC OF SPREF OF FLAN 1 OF NEXT BRAN.
’OF’ may be used to nest the options indefinitely. For example:
This denotes the SPEC element owing the SELE element pointed to by the SPREF attribute on the first FLANGE of the next BRANCH. ILEAVE TUBE, IARRIV TUBE, HEAD TUBE, TAIL TUBE can be added to denote tube. For example:
HEAD TUBE OF /BRAN1.
This denotes the SPEC element owing the SELE element pointed to by the SPREF attribute on the first FLANGE of the next BRANCH. ILEAVE TUBE, IARRIV TUBE, HEAD TUBE, TAIL TUBE can be added to denote tube. For example:
An error will occur if there is no implied tube for the element concerned.
ID arrays can also be used in expressions. For example, CRFA.
An error will occur if there is no implied tube for the element concerned.
Note:
Some of the ID syntax clashes with other types. To allow for this, an id expression may always be preceded with the keyword ID. For example, ID 3 will mean the third member of the current list rather than a number of value 3.
Note
: |
Positions, Directions and Orientations in Expressions | Information is provided on how to use and compare positions and on how to define units, an offset from a fixed point, the direction and orientation in expressions.
|
Use Positions in Expressions | The basic ways of defining a position are:
The Cartesian position may optionally be followed by WRT to specify the axis system. Refer to WRT.
POS OF /VESS1 WRT /* or P1 POS OF /CYL2
N 45 W 20000 U 1000
N 1000 FROM /ATEST.
N 1000 FROM P1 OF /BOX2.
N 1000 FROM POSS OF /SCTN1
N (DESP[1] + 10) E
Position attribute plus optional WRT. For example:
POS OF /VESS1 WRT /* or P1 POS OF /CYL2
Cartesian position. For example:
N 45 W 20000 U 1000
Cartesian position from an element. For example:
N 1000 FROM /ATEST.
Cartesian position from a ppoint. For example:
N 1000 FROM P1 OF /BOX2.
Cartesian position from an attribute. For example:
N 1000 FROM POSS OF /SCTN1
Any numeric value within a position may itself be an expression. For example: the following is a valid position expression
N (DESP[1] + 10) E
Position attribute plus optional WRT. For example:
POS OF /VESS1 WRT /* or P1 POS OF /CYL2
Position attribute plus optional WRT. For example:
Cartesian position. For example:
N 45 W 20000 U 1000
Cartesian position. For example:
Cartesian position from an element. For example:
N 1000 FROM /ATEST.
Cartesian position from an element. For example:
Cartesian position from a ppoint. For example:
N 1000 FROM P1 OF /BOX2.
Cartesian position from a ppoint. For example:
Cartesian position from an attribute. For example:
N 1000 FROM POSS OF /SCTN1
Cartesian position from an attribute. For example:
Any numeric value within a position may itself be an expression. For example: the following is a valid position expression
N (DESP[1] + 10) E
Any numeric value within a position may itself be an expression. For example: the following is a valid position expression
WRT
WRT |
WRT | The WRT keyword is used to toggle between absolute and relative units.
When we specify an element (or attribute of an element) we are specifying an absolute point in world space. The point can be given in world space or some other axis. Normally the answer is required relative to the owner axis system and this is taken as the default. For example:
Q POS
$ will return the position of the current element
$ relatively to its owner.
Q POS OF /EQUIP1
$ will return the position of EQUIP1 relative to its
$ owner.
Q POS
$ will return the position of the current element
$ relatively to its owner.
Q POS OF /EQUIP1
$ will return the position of EQUIP1 relative to its
$ owner.
If we require the result in some other axis system then the WRT keyword is used. For example:
Q POS WRT /*
$.for the position in world coordinates.
Q POS WRT /*
$.for the position in world coordinates.
When we specify a Cartesian coordinate we are dealing with a relative position.
For example, ’N 10’ is meaningless until we specify the axis system, or default to an axis system.
Again we use WRT to do this, although it is important to note that in this case we are going from a relative position to an absolute position (in the previous example WRT was used to go from an absolute position to a relative one).
For example:
N 100 WRT /BOX1
$ specifies an absolute position in world space
$ which is N100 of /BOX1.
N 100 WRT /BOX1
$ specifies an absolute position in world space
$ which is N100 of /BOX1.
The default is that Cartesian coordinates are in the owning element’s axis system. This absolute position can be expressed in different coordinate systems: the default is again the owner’s axis system.
A SITE at (0,0,0)
With default (World) orientation
A ZONE at (100,0,0)
With default (World) orientation
An EQUIPMENT at (100,0,0)
With orientation ’N IS E
A BOX at (-100,0,0)
With default (World) orientation
The result of Q (N 100 WRT /BOX1), will depend on the current element.
World
(300,100,0), in World coordinates.
Site
(300,100,0) in World coordinates because the World is the owner of the current element.
Zone
(300,100,0) in World coordinates, because the Site is the owner of the current element, and the Site coordinates are the same as the World coordinates.
Equipment
(200,100,0), which is the position relative to its owner, the Zone.
Box
(100,100,0) which is the position relative to its owner, the Equipment.
WRT can be further qualified by FROM.
Q POS
$ will return the position of the current element
$ relatively to its owner.
Q POS OF /EQUIP1
$ will return the position of EQUIP1 relative to its
$ owner.
Q POS WRT /*
$.for the position in world coordinates.
N 100 WRT /BOX1
$ specifies an absolute position in world space
$ which is N100 of /BOX1.
Item
Comments
A SITE at (0,0,0)
With default (World) orientation
A ZONE at (100,0,0)
With default (World) orientation
An EQUIPMENT at (100,0,0)
With orientation ’N IS E
A BOX at (-100,0,0)
With default (World) orientation
Location
Result
World
(300,100,0), in World coordinates.
Site
(300,100,0) in World coordinates because the World is the owner of the current element.
Zone
(300,100,0) in World coordinates, because the Site is the owner of the current element, and the Site coordinates are the same as the World coordinates.
Equipment
(200,100,0), which is the position relative to its owner, the Zone.
Box
(100,100,0) which is the position relative to its owner, the Equipment.
Note:
The CONSTRUCT syntax uses the world as the default axis.
Q POS
Q POS OF /EQUIP1
Q POS WRT /*
N 100 WRT /BOX1
Note
:
Q (N 100 WRT /BOX1) |
FROM | In some cases we require an offset from a fixed point, other than the position of an item. For example, a point or attribute.
The FROM syntax is used for this. We may still use WRT in combination with FROM, but in this case the WRT is only used to determine the axis direction and not the offset, since the offset is specified by the FROM part.
Consider the following:
A SITE at (0,0,0)
With default (World) orientation
A ZONE at (100,0,0)
With default (World) orientation
An EQUIPMENT at (100,0,0)
With orientation ’N IS E
A BOX at (-100,0,0)
With default (World) orientation
The result of Q (N 100 WRT /* FROM /BOX1), shown as Ä in , will depend on the current element.
World, Site, and Zone
(200,200,0) since the offset of N100 is applied in world axis rather than /BOX1 axis.
Equipment
(100,200,0). Note: the default axis for the result is the Zone.
Box
(200,0,0), because the default axis for the result is the Equipment.
The result of ’Q (N 100 WRT /BOX1 FROM /* ) is different:
Site and Zone
(100,0,0)
Equipment
(0,0,0)
Box
(0, -100, 0), because the axis for the result is the Equipment.
The result of ’Q (N 100 FROM /* )’ is different yet again.
For this we cannot mark an absolute point on the diagram since the default WRT will vary with the current element. In fact for the SITE, ZONE, EQUI the point Ä is marked in , and for the BOX the point coincides with the ZONE.
Site and Zone
(0,100,0)
Equipment
(-100,100,0), because the default result axis is the Zone.
Box
(0, -100, 0), because the axis for the result is the Equipment.
Item
Comments
A SITE at (0,0,0)
With default (World) orientation
A ZONE at (100,0,0)
With default (World) orientation
An EQUIPMENT at (100,0,0)
With orientation ’N IS E
A BOX at (-100,0,0)
With default (World) orientation
Location
Result
World, Site, and Zone
(200,200,0) since the offset of N100 is applied in world axis rather than /BOX1 axis.
Equipment
(100,200,0). Note: the default axis for the result is the Zone.
Box
(200,0,0), because the default axis for the result is the Equipment.
Location
Result
Site and Zone
(100,0,0)
Equipment
(0,0,0)
Box
(0, -100, 0), because the axis for the result is the Equipment.
Location
Result
Site and Zone
(0,100,0)
Equipment
(-100,100,0), because the default result axis is the Zone.
Box
(0, -100, 0), because the axis for the result is the Equipment.
Q (N 100 WRT /* FROM /BOX1),
Ä
’Q (N 100 WRT /BOX1 FROM /* )
’Q (N 100 FROM /* )’
Ä |
Compare Positions | Two positions can be compared with EQ, NE, GT, LT, GE or LE. The pairs of coordinates are only compared in the coordinate axes for which the two positions are defined. A position attribute always has all three coordinates defined.
For positions entered by you, only those coordinates which are given by you are defined. For example:
’N10U3’
$ only the Y and Z coordinates are defined,
$ while the X coordinate remains undefined
’N10U3’
$ only the Y and Z coordinates are defined,
$ while the X coordinate remains undefined
For the EQ operator, all the pairs of defined coordinates should be equal. For NE, only one pair of defined coordinates need be different. For GT (LT,GE,LE), all the defined coordinates of the first position should be greater than (less than, greater than or equal to, less than or equal to) the defined coordinates of the second position. This means that GE is not the opposite of LT and LE is not the opposite of GT.
If no coordinate of the two positions are defined for a common axis (e.g. ’N10’ and ’W4D7’), the result of the comparison is undefined.
’POS EQ W1S2D3’
$ This evaluates to true only if POS of the current $ element is (-1,-2,-3).
’POS GT N10’ or ’N10 LE POS’
$ Only the second coordinate of POS is compared;
$ if it is greater than 10, then the result is true.
’E10N10 GT E0N0’
$ Is true because the inequality is verified for the X
$ and Y axis (both coordinates are undefined for
$ the Z axis, so it is ignored).
’E10N0 GT E0N0’
$ Is false because the Y components are different $ axes.
’E10N0 GT E0U100’
$ Is true. Although no comparison can be
$ performed n either the Y or the Z axis, because
$ the components are not present in both position
$ constants, the comparison is true in the X
$ component.
’N10 EQ W4D7’
$ Is undefined (no comparison is possible).
’POS EQ W1S2D3’
$ This evaluates to true only if POS of the current $ element is (-1,-2,-3).
’POS GT N10’ or ’N10 LE POS’
$ Only the second coordinate of POS is compared;
$ if it is greater than 10, then the result is true.
’E10N10 GT E0N0’
$ Is true because the inequality is verified for the X
$ and Y axis (both coordinates are undefined for
$ the Z axis, so it is ignored).
’E10N0 GT E0N0’
$ Is false because the Y components are different $ axes.
’E10N0 GT E0U100’
$ Is true. Although no comparison can be
$ performed n either the Y or the Z axis, because
$ the components are not present in both position
$ constants, the comparison is true in the X
$ component.
’N10 EQ W4D7’
$ Is undefined (no comparison is possible).
Refer to Precision of Comparisons, for tolerances in comparing numbers.
’N10U3’
$ only the Y and Z coordinates are defined,
$ while the X coordinate remains undefined
’POS EQ W1S2D3’
$ This evaluates to true only if POS of the current $ element is (-1,-2,-3).
’POS GT N10’ or ’N10 LE POS’
$ Only the second coordinate of POS is compared;
$ if it is greater than 10, then the result is true.
’E10N10 GT E0N0’
$ Is true because the inequality is verified for the X
$ and Y axis (both coordinates are undefined for
$ the Z axis, so it is ignored).
’E10N0 GT E0N0’
$ Is false because the Y components are different $ axes.
’E10N0 GT E0U100’
$ Is true. Although no comparison can be
$ performed n either the Y or the Z axis, because
$ the components are not present in both position
$ constants, the comparison is true in the X
$ component.
’N10 EQ W4D7’
$ Is undefined (no comparison is possible).
Precision of Comparisons
’N10U3’
’POS EQ W1S2D3’
’POS GT N10’ or ’N10 LE POS’
’E10N10 GT E0N0’
’E10N0 GT E0N0’
’E10N0 GT E0U100’
’N10 EQ W4D7’
Precision of Comparisons
, |
POLAR | The POLAR keyword allows positions to be defined in terms of a distance in a particular direction from a point.
If FROM is not specified the default is the origin of the owner.
POLAR N 45 E DIST 20M FROM U 10 M
POLAR AXES PL OF PREV DIST ( ABORE * 10 ) FROM PL OF PRE V
POLAR N 45 E DIST 20M FROM U 10 M
POLAR AXES PL OF PREV DIST ( ABORE * 10 ) FROM PL OF PRE V
POLAR N 45 E DIST 20M FROM U 10 M
POLAR AXES PL OF PREV DIST ( ABORE * 10 ) FROM PL OF PRE V
POLAR dir DISTance expr -+- FROM -+- pos -----.
| | |
| ‘- point ---|
| |
‘--------------------+--->
POLAR dir DISTance expr -+- FROM -+- pos -----.
| | |
| ‘- point ---|
| |
‘--------------------+--->
POLAR N 45 E DIST 20M FROM U 10 M
POLAR AXES PL OF PREV DIST ( ABORE * 10 ) FROM PL OF PRE V |
Direction | The basic ways of defining a direction are:
HDIR OF /PIPE1 WRT /*
N 45 W
(U WRT CE )
Q ( Z WRT /SCTN )
FROM N 50 WRT CE TO N 100
>- CLOSEST type -+- WITH exp -.
| |
‘------------+- DIRECTION dir -+- EXTENT val -.
| |
‘--------------+--> cont
continued >-+- AFTER val -.
| |
‘-------------+- FROM ? -.
| |
‘----------+-->
CLOSEST DIR E
CLOSEST BOX WITH ( PURP EQ ’FLOO’ ) DIR D WRT /* EXTENT 20M
CLOSEST VALVE DIR N 45 U FROM E100 N200 U300
CLOSEST BRAN HANG AFTER 2M
Direction attribute plus optional WRT. For example,
HDIR OF /PIPE1 WRT /*
Cartesian direction. For example,
N 45 W
Cartesian direction WRT to an element.
All Cartesian directions are returned in the axis of the owner of the current element. For example:
(U WRT CE )
will return the Z axis of the current element relative to its owner.
Q ( Z WRT /SCTN )
will return the Z axis direction of /SCTN relative to the owner of the current element. For example, if the result is required in world coordinates the current element must be the World or a Site.
FROM pos2 TO pos2. For example
FROM N 50 WRT CE TO N 100
Keyword AXES followed by a p-point or pline.
The CLOSEST keyword, which will find the closest element in a particular direction.
Direction attribute plus optional WRT. For example,
HDIR OF /PIPE1 WRT /*
Direction attribute plus optional WRT. For example,
Cartesian direction. For example,
N 45 W
Cartesian direction. For example,
Cartesian direction WRT to an element.
Cartesian direction WRT to an element.
All Cartesian directions are returned in the axis of the owner of the current element. For example:
(U WRT CE )
All Cartesian directions are returned in the axis of the owner of the current element. For example:
will return the Z axis of the current element relative to its owner.
Q ( Z WRT /SCTN )
will return the Z axis of the current element relative to its owner.
will return the Z axis direction of /SCTN relative to the owner of the current element. For example, if the result is required in world coordinates the current element must be the World or a Site.
will return the Z axis direction of /SCTN relative to the owner of the current element. For example, if the result is required in world coordinates the current element must be the World or a Site.
FROM pos2 TO pos2. For example
FROM N 50 WRT CE TO N 100
FROM pos2 TO pos2. For example
Keyword AXES followed by a p-point or pline.
Keyword AXES followed by a p-point or pline.
The CLOSEST keyword, which will find the closest element in a particular direction.
The CLOSEST keyword, which will find the closest element in a particular direction.
In the above graph the keywords are:
EXTENT, which is how far to search in the direction specified, default 10M
AFTER, or the distance along vector after which to start search, default 0M
FROM, which specifies an alternative start point other than current element. This is of particular use for a branch where you might want to specify the HPOS or TPOS.
In the above graph the keywords are:
In the above graph the keywords are:
EXTENT, which is how far to search in the direction specified, default 10M
EXTENT, which is how far to search in the direction specified, default 10M
AFTER, or the distance along vector after which to start search, default 0M
AFTER, or the distance along vector after which to start search, default 0M
FROM, which specifies an alternative start point other than current element. This is of particular use for a branch where you might want to specify the HPOS or TPOS.
FROM, which specifies an alternative start point other than current element. This is of particular use for a branch where you might want to specify the HPOS or TPOS.
|
Orientations | The basic ways of defining an orientation are:
ORI OF /BOX1 WRT /*
dir IS dir AND dir IS dir
(E IS U WRT /SCTN1 AND N IS E WRT /SCTN1)
----<---------.
/ |
>-- AXES --*--- PArrive ---|
| |
|--- PLeave ----|
| |
|--- PTail -----|
| |
|--- HHead -----|
| |
|--- HTail -----|
| |
‘--- PPOINT n --+-- OF - <gid> ---->
( AXES PLEAVE IS AXES PLEAVE OF PREV AND AXES P3 IS UP )
Orientation attribute plus optional WRT. For example:
ORI OF /BOX1 WRT /*
Cartesian orientation. For example:
dir IS dir AND dir IS dir
For example to set an orientation of an element to that of a section, rotated by 90 degrees use:
(E IS U WRT /SCTN1 AND N IS E WRT /SCTN1)
The AXES keyword, which will allow you to use P-points to specify orientations.
Orientation attribute plus optional WRT. For example:
ORI OF /BOX1 WRT /*
Orientation attribute plus optional WRT. For example:
Cartesian orientation. For example:
dir IS dir AND dir IS dir
Cartesian orientation. For example:
For example to set an orientation of an element to that of a section, rotated by 90 degrees use:
(E IS U WRT /SCTN1 AND N IS E WRT /SCTN1)
For example to set an orientation of an element to that of a section, rotated by 90 degrees use:
The AXES keyword, which will allow you to use P-points to specify orientations.
The AXES keyword, which will allow you to use P-points to specify orientations.
This will orient a branch component, such as a valve, so that it is aligned with the previous component and its P3 is up.
Refer to also Compare Positions.
This will orient a branch component, such as a valve, so that it is aligned with the previous component and its P3 is up.
Refer to also Compare Positions.
This will orient a branch component, such as a valve, so that it is aligned with the previous component and its P3 is up.
Compare Positions
----<---------.
/ |
>-- AXES --*--- PArrive ---|
| |
|--- PLeave ----|
| |
|--- PTail -----|
| |
|--- HHead -----|
| |
|--- HTail -----|
| |
‘--- PPOINT n --+-- OF - <gid> ---->
Compare Positions |
Text Expressions | Text expressions can contain the following:
A text string, which must be enclosed in quotes. For example: ’FRED’.
An AVEVA E3D Design attribute of type text or word. For example: FUNC
A single element of a word array attribute. For example: ELEL[2].
Text operators
Text functions
A text string, which must be enclosed in quotes. For example: ’FRED’.
A text string, which must be enclosed in quotes. For example: ’FRED’.
An AVEVA E3D Design attribute of type text or word. For example: FUNC
An AVEVA E3D Design attribute of type text or word. For example: FUNC
A single element of a word array attribute. For example: ELEL[2].
A single element of a word array attribute. For example: ELEL[2].
Text operators
Text operators
Text functions
Text functions
|
Text Operator | The text operator available is +, used for concatenation.
text1 + text2 -> text
-> text
Return the concatenation of two text strings.
None.
’no’ + ’space’ -> ’nospace’
Text result too long.
Synopsis
text1 + text2 -> text
-> text
Description
Return the concatenation of two text strings.
Side Effects
None.
Example
’no’ + ’space’ -> ’nospace’
Errors
Text result too long.
Synopsis
text1 + text2 -> text
-> text
Description
Side Effects
Example
Errors |
Text Functions | The text functions available are:
AFTER
BEFORE
DIMENSIONOF, DIMOF
DIMWOOD
DISTANCE
LOWCASE, UPCASE
PART
REPLACE
STRING
SUBS, DSUBS
TRIM
UNITSOF
VTEXT
AFTER
BEFORE
DIMENSIONOF, DIMOF
DIMWOOD
DISTANCE
LOWCASE, UPCASE
PART
REPLACE
STRING
SUBS, DSUBS
TRIM
UNITSOF
VTEXT
AFTER ( text1 , text2 )
-> text
Return the substring of text1 which is after the leftmost occurrence of text2 in text1.
If text2 does not occur in text1, the null string is returned.
None.
AFTER ( ’abcdef’ , ’cd’ ) ->’ef’
AFTER ( ’abcdef’ , ’x’ ) -> ’’
AFTER ( ’abcdef’ , ’’ ) -> ’abcdef’
None.
BEFORE ( text1 , text2 )
-> text
Return the substring of text1 which is before the leftmost occurrence of text2 in text1. If text2 does not occur in text1, text1 is returned.
None.
BEFORE ( ’abcdef’ , ’cd’ ) -> ’ab’
BEFORE ( ’abcdef’ , ’x’ ) -> ’’
BEFORE ( ’abcdef’ , ’’ ) -> ‘’
None.
DIMensionof or DIMOF
(any real variable or expression)
-> text
Evaluates the real expression and returns its physical dimension as a text string. This is name of the dimension in the table in Standard Units.
The argument can be a single real value (with or without unit qualifier) or any real expression.
None.
Dim (1)
dim(1kg)
dimof(1kg/m3)
dimensionof (1 curie)
dim (1joule / 1 day / sqrt (1 m4))
dim (1 newton / sqrt ( 1 m4)
-> NONE
-> Mass
-> Density
-> Radioactivity
-> GENERIC
-> Pressure
DIMWORD
(any real variable or expression)
-> text
Evaluates the real expression and returns its physical dimension as a word string. This is HASH name of the dimension in the table in Standard Units.
The argument can be a single real value (with or without unit qualifier) or any real expression.
None.
Dimword (1)
dimword (1curie)
Dimword (1kg/5litre)
dimword (1curie)
dimword (1kg/5litre)
dimword (1joule / 1 day / sqrt (1 m4))
dimword (1 newton / sqrt (1 m4)
dim(1kg)
-> NONE
-> RADY
-> DENS
-> RADY
-> DENS
-> GENERIC
-> PRESS
-> Mass
DISTance ( number1 )
-> text
DISTance( number1, logical1, logical2, logical3, number2, logical4)
-> text
For the one-argument form, if the current distance units are FINCH, text is the conversion of the decimal inches value number1 into the format ’aa’bb.cc/dd’. Otherwise, text is the STRING conversion of number1.
The six-argument form is more complex. The format is:
DIST/ANCE (distance, feet, usformat, fraction, denom_or_dp, zeros)
where:
AVEVA E3D Design
For both US and AVEVA E3D Design formats the following rules are observed:
The inches and fraction of inches are followed by a double quote(").
None.
If the current distance units are FINCH:
DISTANCE ( 17.5 ) -> ’1’5.1/2’
Some examples, where the current distance units are feet and inches:
DIST(34.5,TRUE,TRUE,TRUE,100,TRUE) -> 2’-10.1/2.
DIST(34.5,FALSE,TRUE,FALSE,1,TRUE) -> 34.5"
DIST(34.5,FALSE,TRUE,TRUE,4,FALSE) -> 34 1/2"
DIST(128.5,TRUE,FALSE,TRUE,2,TRUE) -> 10’08.1/2"
The following table shows sets of options that could have been chosen and the format of the output produced for different numbers. Blanks output by the system are represented by underscores(_).
The value is too big to be converted.
UPCase ( text1 )
-> text
LOWCase ( text1 )
-> text
Return an upper or lower case version of text1.
None.
UPCASE ( ’False’) -> ’FALSE’
LOWCASE ( ’False’) -> ’false’
None.
PART(text1, number1)
-> text
PART(text1, number1 , text2)
-> text
With two arguments, returns the number1 component of text1 assuming that text1 is split on any whitespace characters. If number1 is negative, counting of components starts from the right.
With three arguments, as above, but use text2 as the separator on which splitting takes place.
If you give a part number higher than the number of components in the string, the function returns an empty string.
None.
PART (’x-y-z’, 1, ’-’ -> ’x’
PART (’a b c d e’, 4-> ’d’
PART (’/PIPE45/B9’, -1, ’/’) -> ’B9’
PART(’aa bb cc’, 2) -> ’bb’
PART(’aa-bb-cc’,3,’-’) -> ’cc’
None.
REPLace (text1,text2,text3)
-> text
REPLace(text1,text2,text3,int1)
-> text
REPLace(text1,text2,text2,int1,int2)
-> text
Replace search string text2 in input string text1 with replacement string text3.
If int1 is given this specifies the first occurrence of text2 at which to start replacement.
If int2 is given this specifies the number of replacements to make. int1 and/or int2 may be negative to indicate that the direction is backwards.
None.
Three arguments:
REPLACE (’cat dog cat cat dog ’, ’cat’, ’dog’ ) -> ’dog dog dog dog dog’
All occurrences of ’cat’ are replaced with ’dog’.
Four arguments: start occurrence given:
REPLACE (’cat dog cat cat cat dog’, ’cat’, ’dog’, 2) -> ’cat dog dog dog dog dog
All occurrence of ’cat’ from the second occurrence onwards are replaced with ’dog’
REPLACE(’cat dog cat cat dog’ ,’cat’, dog’, -2 -> ’dog dog dog cat dog’
All occurrences starting at the second occurrence from the end of the string and moving backwards are replaced Note that a negative fourth argument without a fifth argument implies backwards mode.
Five arguments: start occurrence and number of replacements given. Replace two occurrences of ’cat’ starting at second occurrence:
REPLACE (’cat dog cat cat cat, ’cat’, ’dog’, 2,2) -> ’cat dog dog dog cat’
Replace two occurrences in backwards direction starting at the second occurrence:
REPLACE (’cat dog cat cat cat’, ,’cat’, ’dog’, 2, -2) -> ’dog dog dog cat cat ’
Replace two occurrences in forwards direction starting at second occurrence from the end of the string:
REPLACE (’cat cat cat cat dog’, ’cat’, ’dog’,-2,2) -> ’cat cat dog dog dog’
Replace two occurrences in backwards direction starting at second occurrence from the end of the string.
REPLACE (’cat cat cat cat dog’,’cat’, ’dog’, -2, -2) -> ’cat dog dog cat dog’
The following examples all give the same result:
REPLACE(’cat1 cat2 cat3 cat4 cat5 cat6 cat7 cat8 cat9 cat10’, ’cat’, ’dog’, 4, 2)
REPLACE(’cat1 cat2 cat3 cat4 cat5 cat6 cat7 cat8 cat9 cat10’, ’cat’, ’dog’, 5, -2)
REPLACE(’cat1 cat2 cat3 cat4 cat5 cat6 cat7 cat8 cat9 cat10’, ’cat’, ’dog’,-6, -2)
REPLACE(’cat1 cat2 cat3 cat4 cat5 cat6 cat7 cat8 cat9 cat10’, ’cat’, ’dog’, -7, 2)
In each case, the output string is
’cat1 cat2 cat3 dog4 dog5 cat6 cat7 cat8 cat9 cat10’
If the replacement string text3 is a null string the required number of occurrences of the search string text2 are removed. For example:
REPLACE (’AAABBABZ’, ’B’, ’’) -> ’AAAAZ’
REPLACE (’AAABBABZ’, ’B’, ’’, -1, -1) -> ’AAABBAZ’
If the input string text1 is a null string or an unset text attribute, the input string text1 is returned unchanged. For example:
REPLACE (’’, ’A’,’B’) -> ’’
If the search string text2 is longer than the input string text1, the input string text1 is returned unchanged. For example:
REPLACE(’AA’, ’AAAAA’ , ’B’) -> ’AA’
If no occurrence of the search string text2 is found, the input string text1 is returned unchanged. For example:
If required occurrence int1 is not found the input string text1 is returned unchanged. For example:
REPLACE(’AAAAAA’, ’A’, ’B’, 10 ) -> ’AAAAAA’
If the number of replacements required int2 is greater than the actual number of occurrence from the specified start occurrence, replacements are made up to the end of the string ( or beginning in backwards mode). For example:
REPLACE (’AAAAAA’, ’A’, ’B’, -3, 8) -> ’BBBBAA’
STRing ( any scalar type )
-> text
STRing ( number , text1 )
-> text
STRing ( pos , text1 )
-> text
Turns a value into a text string.
With a single argument the STRING function can be applied to the following scalar data types:
With only one argument, decimal places are output to give a maximum of six significant figures. Trailing zeros are always removed in this case.
With two arguments the data type may be either numeric (scalar) or position or direction. With two arguments, convert a number or position into a text string using the format described by text1, which may take any of the values between ’D0’ and ’D6’ (or ’d0’ and ’d6’), where the number indicates the number of decimal places.
For numbers, STRING always outputs values as millimetres. If unit conversion is needed then the DIST function should be used. For positions, the current distance units are used.
None.
STRING ( 1 ) -> ’1’
STRING ( 1 , ’D3’ ) -> ’1.000’
STRING ( 1.23456789 ) -> ’1.23457’
STRING(1.1230000) ->’1.123’
STRING ( 1.23456789 , ’D3’ ) -> ’1.235’
STRING (9*9 LT 100) -> ’TRUE’
STRING (OWN OF CE) -> ’/PIPE1’
STRING(POS) -> ’W1000 N20000 U18000’
STRING(POS, ’D4’ ) -> ’W10000.1234 N20000.1234 U18000.1234’
STRING(HDIR OF /PIPE1-1) -> ’D’
STRING(E 22.0125 N, ’D2’) -> ’E 22.01 N’
STRING (ORI OF NEXT) -> ’Y IS D AND Z IS U’
SUBString ( text1 , number1 )
-> text
SUBString ( text1 , number1 , number2 )
-> text
With two arguments, return the substring of text1 beginning at the position number1 to the end of text1.
With three arguments, return the substring of text1 beginning at the position number1 and of length number2. If number1 is negative, then counting of characters starts from the RHS of the input string. If number2 is negative, then characters up to and including the start position are returned.
None.
SUBSTRING ( ’abcdef’ , 3 ) -> ’cdef’
SUBSTRING ( ’abcdef’ ,-3 ) -> ’abcd’
SUBSTRING ( ’abcdef’ , 3 , 2 ) -> ’cd’
SUBSTRING ( ’abcdef’ , -3, 2 ) -> ’de’
SUBSTRING ( ’abcdef’ , 3 , -2 ) -> ’bc’
SUBSTRING ( ’abcdef’ , 10 ) -> ’’
SUBSTRING ( ’abcdef’ , -10 , 2 ) -> ’ab’
None.
TRIM ( text1 )
-> text
TRIM ( text1, text2 )
-> text
TRIM ( text1, text2, text3 )
-> text
When only one argument is supplied, TRIM removes all spaces to the left (leading) and right (trailing) of text1 and returns the answer in text.
When two arguments are supplied, text2 specifies where the spaces should be removed from: either ’L’ or ’l’ for left, ’R’ or ’r’ for right, and ’M’ or ’m’ for multiple (where multiple occurrences of blanks are squeezed to a single spaces) or any combination of the three key letters. So the default is ’LR’ when this field is omitted.
When the third argument text3 is also supplied, this should only be a single character which overrides the space character as the character being trimmed.
None.
TRIM ( ’ How now, brown cow ’, ’LRM’ ) -> ’How now, brown cow’
TRIM ( ’10.3000’, ’R’, ’0’ ) -> ’10.3’
None.
UNITSOF or UNIT
(any real variable or expression)
-> text
Evaluates the real expression and returns its current units a text string. This is standard unit qualifier that would be output with the value when queried.
The argument can be a single real value (with or without unit qualifier) or any real expression.
None.
Note these are only possible results, depending on current units
UNITOF (1)
UNITOF (1kg)
UNITOF (1kg/m3)
UNITOF (1 curie)
UNITOF (1joule / 1 day / sqrt (1 m4))
UNITOF (1 newton / sqrt (1 m4))
-> ‘’
-> lb
-> lb/ft3
-> curie
-> j/s/mm2
-> bar
None.
VTEXT is used for the late evaluation of variables.
VTEXT ( variable-name )
-> text
VTEXT ( variable-name , number )
-> text
With one argument, it gets the value of the scalar variable or the value of the array variable element.
With two arguments, it gets the value of the element corresponding to the index number.
The value is returned as a text string.
See also VLOGICAL used for late evaluation when a logical result is required, and VVALUE used for late evaluation when a numeric result is required.
If the scalar variable, the array variable or the array variable element does not exist, the result is undefined.
VTEXT ( !var ) -> ’hello’
VTEXT ( !array[1] ) -> ’1.00’
VTEXT ( !array , 2 ) -> ’0.00’
Errors Scalar variable may not be indexed (for example, VTEXT (!var[1]) ).
Array variable must have an index (for example, VTEXT ( !array ) ).
AFTER
BEFORE
DIMENSIONOF, DIMOF
DIMWOOD
DISTANCE
LOWCASE, UPCASE
PART
REPLACE
STRING
SUBS, DSUBS
TRIM
UNITSOF
VTEXT
Synopsis
AFTER ( text1 , text2 )
-> text
Description
Return the substring of text1 which is after the leftmost occurrence of text2 in text1.
If text2 does not occur in text1, the null string is returned.
Side Effects
None.
Example
AFTER ( ’abcdef’ , ’cd’ ) ->’ef’
AFTER ( ’abcdef’ , ’x’ ) -> ’’
AFTER ( ’abcdef’ , ’’ ) -> ’abcdef’
Errors
None.
Synopsis
BEFORE ( text1 , text2 )
-> text
Description
Return the substring of text1 which is before the leftmost occurrence of text2 in text1. If text2 does not occur in text1, text1 is returned.
Side Effects
None.
Example
BEFORE ( ’abcdef’ , ’cd’ ) -> ’ab’
BEFORE ( ’abcdef’ , ’x’ ) -> ’’
BEFORE ( ’abcdef’ , ’’ ) -> ‘’
Errors
None.
Synopsis
DIMensionof or DIMOF
(any real variable or expression)
-> text
Description
Evaluates the real expression and returns its physical dimension as a text string. This is name of the dimension in the table in Standard Units.
The argument can be a single real value (with or without unit qualifier) or any real expression.
Side Effects
None.
Example
Dim (1)
dim(1kg)
dimof(1kg/m3)
dimensionof (1 curie)
dim (1joule / 1 day / sqrt (1 m4))
dim (1 newton / sqrt ( 1 m4)
-> NONE
-> Mass
-> Density
-> Radioactivity
-> GENERIC
-> Pressure
Errors
Synopsis
DIMWORD
(any real variable or expression)
-> text
Description
Evaluates the real expression and returns its physical dimension as a word string. This is HASH name of the dimension in the table in Standard Units.
The argument can be a single real value (with or without unit qualifier) or any real expression.
Side Effects
None.
Example
Dimword (1)
dimword (1curie)
Dimword (1kg/5litre)
dimword (1curie)
dimword (1kg/5litre)
dimword (1joule / 1 day / sqrt (1 m4))
dimword (1 newton / sqrt (1 m4)
dim(1kg)
-> NONE
-> RADY
-> DENS
-> RADY
-> DENS
-> GENERIC
-> PRESS
-> Mass
Errors
Synopsis
DISTance ( number1 )
-> text
DISTance( number1, logical1, logical2, logical3, number2, logical4)
-> text
Description
For the one-argument form, if the current distance units are FINCH, text is the conversion of the decimal inches value number1 into the format ’aa’bb.cc/dd’. Otherwise, text is the STRING conversion of number1.
The six-argument form is more complex. The format is:
DIST/ANCE (distance, feet, usformat, fraction, denom_or_dp, zeros)
where:
distance is the numeric distance in inches that is to be formatted.
feet is a logical flag set to true if output is to be in feet and inches and to false if output is to be in inches.
usformat is a logical set to true if US format is to be used or false if AVEVA E3D Design format is to be used.
fraction is a logical set to true if the fractional component is to be output as a fraction or false if to be output as a decimal denom_or_dp is a number representing the largest denominator if fraction is TRUE or representing the number of decimal places if it is FALSE.
zeros is a logical set to true if zeros are to be shown when that component of the output has no value. .
AVEVA E3D Design
For both US and AVEVA E3D Design formats the following rules are observed:
If distance is negative, the first symbol is a minus sign.
If feet is true and the distance is at least a foot, then the number of feet is output next, followed by a single quote (’). Only if zeros is true will the number of feet be output as 0 for distances less than a foot. Otherwise the feet will be omitted.
If feet have been output, the inches will be at least two characters wide. Numbers less than ten will be preceded by a space if US format is being used or a zero if AVEVA E3D Design format is used. A zero will be output if there are no whole inches.
If no feet have been output and the distance is at least an inch, then the number of inches is displayed but without any preceding spaces. Only if zeros is true will a 0 be output for distances of less than an inch.
If inches have been output and fraction is true, these will be followed by a decimal point (.).
If fraction is TRUE and the number has a fractional component, then the numerator and the denominator are shown separated by a slash (/). This is then blank padded up to the width that the largest numerator and denominator would take.
If fraction is FALSE and the number of decimal places is greater than zero, then the decimal point (.) is displayed followed by the remainder up to the appropriate number of decimal places. If the number of decimal places is 0 then the decimal point is not shown either.
If US format has been selected then the following additional rules are observed on output:
The (’) after the number of feet is followed by a dash
(-).
The decimal point separating the inches from the fraction is replaced by a space.
The inches and fraction of inches are followed by a double quote(").
Side Effects
None.
Example
If the current distance units are FINCH:
DISTANCE ( 17.5 ) -> ’1’5.1/2’
Some examples, where the current distance units are feet and inches:
DIST(34.5,TRUE,TRUE,TRUE,100,TRUE) -> 2’-10.1/2.
DIST(34.5,FALSE,TRUE,FALSE,1,TRUE) -> 34.5"
DIST(34.5,FALSE,TRUE,TRUE,4,FALSE) -> 34 1/2"
DIST(128.5,TRUE,FALSE,TRUE,2,TRUE) -> 10’08.1/2"
The following table shows sets of options that could have been chosen and the format of the output produced for different numbers. Blanks output by the system are represented by underscores(_).
Errors
The value is too big to be converted.
Synopsis
UPCase ( text1 )
-> text
LOWCase ( text1 )
-> text
Description
Return an upper or lower case version of text1.
Side Effects
None.
Example
UPCASE ( ’False’) -> ’FALSE’
LOWCASE ( ’False’) -> ’false’
Errors
None.
Synopsis
PART(text1, number1)
-> text
PART(text1, number1 , text2)
-> text
Description
With two arguments, returns the number1 component of text1 assuming that text1 is split on any whitespace characters. If number1 is negative, counting of components starts from the right.
With three arguments, as above, but use text2 as the separator on which splitting takes place.
If you give a part number higher than the number of components in the string, the function returns an empty string.
Side Effects
None.
Example
PART (’x-y-z’, 1, ’-’ -> ’x’
PART (’a b c d e’, 4-> ’d’
PART (’/PIPE45/B9’, -1, ’/’) -> ’B9’
PART(’aa bb cc’, 2) -> ’bb’
PART(’aa-bb-cc’,3,’-’) -> ’cc’
Errors
None.
Synopsis
REPLace (text1,text2,text3)
-> text
REPLace(text1,text2,text3,int1)
-> text
REPLace(text1,text2,text2,int1,int2)
-> text
Description
Replace search string text2 in input string text1 with replacement string text3.
If int1 is given this specifies the first occurrence of text2 at which to start replacement.
If int2 is given this specifies the number of replacements to make. int1 and/or int2 may be negative to indicate that the direction is backwards.
Side Effects
None.
Example
Three arguments:
REPLACE (’cat dog cat cat dog ’, ’cat’, ’dog’ ) -> ’dog dog dog dog dog’
All occurrences of ’cat’ are replaced with ’dog’.
Four arguments: start occurrence given:
REPLACE (’cat dog cat cat cat dog’, ’cat’, ’dog’, 2) -> ’cat dog dog dog dog dog
All occurrence of ’cat’ from the second occurrence onwards are replaced with ’dog’
REPLACE(’cat dog cat cat dog’ ,’cat’, dog’, -2 -> ’dog dog dog cat dog’
All occurrences starting at the second occurrence from the end of the string and moving backwards are replaced Note that a negative fourth argument without a fifth argument implies backwards mode.
Five arguments: start occurrence and number of replacements given. Replace two occurrences of ’cat’ starting at second occurrence:
REPLACE (’cat dog cat cat cat, ’cat’, ’dog’, 2,2) -> ’cat dog dog dog cat’
Replace two occurrences in backwards direction starting at the second occurrence:
REPLACE (’cat dog cat cat cat’, ,’cat’, ’dog’, 2, -2) -> ’dog dog dog cat cat ’
Replace two occurrences in forwards direction starting at second occurrence from the end of the string:
REPLACE (’cat cat cat cat dog’, ’cat’, ’dog’,-2,2) -> ’cat cat dog dog dog’
Replace two occurrences in backwards direction starting at second occurrence from the end of the string.
REPLACE (’cat cat cat cat dog’,’cat’, ’dog’, -2, -2) -> ’cat dog dog cat dog’
The following examples all give the same result:
REPLACE(’cat1 cat2 cat3 cat4 cat5 cat6 cat7 cat8 cat9 cat10’, ’cat’, ’dog’, 4, 2)
REPLACE(’cat1 cat2 cat3 cat4 cat5 cat6 cat7 cat8 cat9 cat10’, ’cat’, ’dog’, 5, -2)
REPLACE(’cat1 cat2 cat3 cat4 cat5 cat6 cat7 cat8 cat9 cat10’, ’cat’, ’dog’,-6, -2)
REPLACE(’cat1 cat2 cat3 cat4 cat5 cat6 cat7 cat8 cat9 cat10’, ’cat’, ’dog’, -7, 2)
In each case, the output string is
’cat1 cat2 cat3 dog4 dog5 cat6 cat7 cat8 cat9 cat10’
If the replacement string text3 is a null string the required number of occurrences of the search string text2 are removed. For example:
REPLACE (’AAABBABZ’, ’B’, ’’) -> ’AAAAZ’
REPLACE (’AAABBABZ’, ’B’, ’’, -1, -1) -> ’AAABBAZ’
Errors
If the input string text1 is a null string or an unset text attribute, the input string text1 is returned unchanged. For example:
REPLACE (’’, ’A’,’B’) -> ’’
If the search string text2 is longer than the input string text1, the input string text1 is returned unchanged. For example:
REPLACE(’AA’, ’AAAAA’ , ’B’) -> ’AA’
If no occurrence of the search string text2 is found, the input string text1 is returned unchanged. For example:
REPLACE( ’AAAAAA’,’B’,’C’) -> ’AAAAAA
If required occurrence int1 is not found the input string text1 is returned unchanged. For example:
REPLACE(’AAAAAA’, ’A’, ’B’, 10 ) -> ’AAAAAA’
If the number of replacements required int2 is greater than the actual number of occurrence from the specified start occurrence, replacements are made up to the end of the string ( or beginning in backwards mode). For example:
REPLACE(’AAAAAA’, ’A’, ’B’, 2, 8) -> ’ABBBBB’
REPLACE (’AAAAAA’, ’A’, ’B’, -3, 8) -> ’BBBBAA’
Synopsis
STRing ( any scalar type )
-> text
STRing ( number , text1 )
-> text
STRing ( pos , text1 )
-> text
Description
Turns a value into a text string.
With a single argument the STRING function can be applied to the following scalar data types:
Numeric
Logical
Id
Position
Direction
Orientation
With only one argument, decimal places are output to give a maximum of six significant figures. Trailing zeros are always removed in this case.
With two arguments the data type may be either numeric (scalar) or position or direction. With two arguments, convert a number or position into a text string using the format described by text1, which may take any of the values between ’D0’ and ’D6’ (or ’d0’ and ’d6’), where the number indicates the number of decimal places.
For numbers, STRING always outputs values as millimetres. If unit conversion is needed then the DIST function should be used. For positions, the current distance units are used.
Side Effects
None.
Example
STRING ( 1 ) -> ’1’
STRING ( 1 , ’D3’ ) -> ’1.000’
STRING ( 1.23456789 ) -> ’1.23457’
STRING(1.1230000) ->’1.123’
STRING ( 1.23456789 , ’D3’ ) -> ’1.235’
STRING (9*9 LT 100) -> ’TRUE’
STRING (OWN OF CE) -> ’/PIPE1’
STRING(POS) -> ’W1000 N20000 U18000’
STRING(POS, ’D4’ ) -> ’W10000.1234 N20000.1234 U18000.1234’
STRING(HDIR OF /PIPE1-1) -> ’D’
STRING(E 22.0125 N, ’D2’) -> ’E 22.01 N’
STRING (ORI OF NEXT) -> ’Y IS D AND Z IS U’
Errors
Synopsis
SUBString ( text1 , number1 )
-> text
SUBString ( text1 , number1 , number2 )
-> text
Description
With two arguments, return the substring of text1 beginning at the position number1 to the end of text1.
With three arguments, return the substring of text1 beginning at the position number1 and of length number2. If number1 is negative, then counting of characters starts from the RHS of the input string. If number2 is negative, then characters up to and including the start position are returned.
Side Effects
None.
Example
SUBSTRING ( ’abcdef’ , 3 ) -> ’cdef’
SUBSTRING ( ’abcdef’ ,-3 ) -> ’abcd’
SUBSTRING ( ’abcdef’ , 3 , 2 ) -> ’cd’
SUBSTRING ( ’abcdef’ , -3, 2 ) -> ’de’
SUBSTRING ( ’abcdef’ , 3 , -2 ) -> ’bc’
SUBSTRING ( ’abcdef’ , 10 ) -> ’’
SUBSTRING ( ’abcdef’ , -10 , 2 ) -> ’ab’
Errors
None.
Synopsis
TRIM ( text1 )
-> text
TRIM ( text1, text2 )
-> text
TRIM ( text1, text2, text3 )
-> text
Description
When only one argument is supplied, TRIM removes all spaces to the left (leading) and right (trailing) of text1 and returns the answer in text.
When two arguments are supplied, text2 specifies where the spaces should be removed from: either ’L’ or ’l’ for left, ’R’ or ’r’ for right, and ’M’ or ’m’ for multiple (where multiple occurrences of blanks are squeezed to a single spaces) or any combination of the three key letters. So the default is ’LR’ when this field is omitted.
When the third argument text3 is also supplied, this should only be a single character which overrides the space character as the character being trimmed.
Side Effects
None.
Example
TRIM ( ’ How now, brown cow ’, ’LRM’ ) -> ’How now, brown cow’
TRIM ( ’10.3000’, ’R’, ’0’ ) -> ’10.3’
Errors
None.
Synopsis
UNITSOF or UNIT
(any real variable or expression)
-> text
Description
Evaluates the real expression and returns its current units a text string. This is standard unit qualifier that would be output with the value when queried.
The argument can be a single real value (with or without unit qualifier) or any real expression.
Side Effects
None.
Example
Note these are only possible results, depending on current units
UNITOF (1)
UNITOF (1kg)
UNITOF (1kg/m3)
UNITOF (1 curie)
UNITOF (1joule / 1 day / sqrt (1 m4))
UNITOF (1 newton / sqrt (1 m4))
-> ‘’
-> lb
-> lb/ft3
-> curie
-> j/s/mm2
-> bar
Errors
None.
Synopsis
VTEXT ( variable-name )
-> text
VTEXT ( variable-name , number )
-> text
Description
With one argument, it gets the value of the scalar variable or the value of the array variable element.
With two arguments, it gets the value of the element corresponding to the index number.
The value is returned as a text string.
See also VLOGICAL used for late evaluation when a logical result is required, and VVALUE used for late evaluation when a numeric result is required.
Side Effects
If the scalar variable, the array variable or the array variable element does not exist, the result is undefined.
Example
VTEXT ( !var ) -> ’hello’
VTEXT ( !array[1] ) -> ’1.00’
VTEXT ( !array , 2 ) -> ’0.00’
Errors
Errors Scalar variable may not be indexed (for example, VTEXT (!var[1]) ).
Array variable must have an index (for example, VTEXT ( !array ) ).
distance is the numeric distance in inches that is to be formatted.
feet is a logical flag set to true if output is to be in feet and inches and to false if output is to be in inches.
usformat is a logical set to true if US format is to be used or false if AVEVA E3D Design format is to be used.
distance is the numeric distance in inches that is to be formatted.
distance is the numeric distance in inches that is to be formatted.
feet is a logical flag set to true if output is to be in feet and inches and to false if output is to be in inches.
feet is a logical flag set to true if output is to be in feet and inches and to false if output is to be in inches.
usformat is a logical set to true if US format is to be used or false if AVEVA E3D Design format is to be used.
usformat is a logical set to true if US format is to be used or false if AVEVA E3D Design format is to be used.
fraction is a logical set to true if the fractional component is to be output as a fraction or false if to be output as a decimal denom_or_dp is a number representing the largest denominator if fraction is TRUE or representing the number of decimal places if it is FALSE.
zeros is a logical set to true if zeros are to be shown when that component of the output has no value. .
fraction is a logical set to true if the fractional component is to be output as a fraction or false if to be output as a decimal denom_or_dp is a number representing the largest denominator if fraction is TRUE or representing the number of decimal places if it is FALSE.
fraction is a logical set to true if the fractional component is to be output as a fraction or false if to be output as a decimal denom_or_dp is a number representing the largest denominator if fraction is TRUE or representing the number of decimal places if it is FALSE.
zeros is a logical set to true if zeros are to be shown when that component of the output has no value. .
zeros is a logical set to true if zeros are to be shown when that component of the output has no value. .
If distance is negative, the first symbol is a minus sign.
If feet is true and the distance is at least a foot, then the number of feet is output next, followed by a single quote (’). Only if zeros is true will the number of feet be output as 0 for distances less than a foot. Otherwise the feet will be omitted.
If distance is negative, the first symbol is a minus sign.
If distance is negative, the first symbol is a minus sign.
If feet is true and the distance is at least a foot, then the number of feet is output next, followed by a single quote (’). Only if zeros is true will the number of feet be output as 0 for distances less than a foot. Otherwise the feet will be omitted.
If feet is true and the distance is at least a foot, then the number of feet is output next, followed by a single quote (’). Only if zeros is true will the number of feet be output as 0 for distances less than a foot. Otherwise the feet will be omitted.
If feet have been output, the inches will be at least two characters wide. Numbers less than ten will be preceded by a space if US format is being used or a zero if AVEVA E3D Design format is used. A zero will be output if there are no whole inches.
If feet have been output, the inches will be at least two characters wide. Numbers less than ten will be preceded by a space if US format is being used or a zero if AVEVA E3D Design format is used. A zero will be output if there are no whole inches.
If feet have been output, the inches will be at least two characters wide. Numbers less than ten will be preceded by a space if US format is being used or a zero if AVEVA E3D Design format is used. A zero will be output if there are no whole inches.
If no feet have been output and the distance is at least an inch, then the number of inches is displayed but without any preceding spaces. Only if zeros is true will a 0 be output for distances of less than an inch.
If inches have been output and fraction is true, these will be followed by a decimal point (.).
If no feet have been output and the distance is at least an inch, then the number of inches is displayed but without any preceding spaces. Only if zeros is true will a 0 be output for distances of less than an inch.
If no feet have been output and the distance is at least an inch, then the number of inches is displayed but without any preceding spaces. Only if zeros is true will a 0 be output for distances of less than an inch.
If inches have been output and fraction is true, these will be followed by a decimal point (.).
If inches have been output and fraction is true, these will be followed by a decimal point (.).
If fraction is TRUE and the number has a fractional component, then the numerator and the denominator are shown separated by a slash (/). This is then blank padded up to the width that the largest numerator and denominator would take.
If fraction is TRUE and the number has a fractional component, then the numerator and the denominator are shown separated by a slash (/). This is then blank padded up to the width that the largest numerator and denominator would take.
If fraction is TRUE and the number has a fractional component, then the numerator and the denominator are shown separated by a slash (/). This is then blank padded up to the width that the largest numerator and denominator would take.
If fraction is FALSE and the number of decimal places is greater than zero, then the decimal point (.) is displayed followed by the remainder up to the appropriate number of decimal places. If the number of decimal places is 0 then the decimal point is not shown either.
If US format has been selected then the following additional rules are observed on output:
If fraction is FALSE and the number of decimal places is greater than zero, then the decimal point (.) is displayed followed by the remainder up to the appropriate number of decimal places. If the number of decimal places is 0 then the decimal point is not shown either.
If fraction is FALSE and the number of decimal places is greater than zero, then the decimal point (.) is displayed followed by the remainder up to the appropriate number of decimal places. If the number of decimal places is 0 then the decimal point is not shown either.
If US format has been selected then the following additional rules are observed on output:
If US format has been selected then the following additional rules are observed on output:
The (’) after the number of feet is followed by a dash
(-).
The decimal point separating the inches from the fraction is replaced by a space.
The (’) after the number of feet is followed by a dash
The (’) after the number of feet is followed by a dash
(-).
(-).
The decimal point separating the inches from the fraction is replaced by a space.
The decimal point separating the inches from |
Late Evaluation of Variables in Expressions | The functions Valid Value elements (VVALUE), VLOGICAL and VTEXT are used for late evaluation of Programmable Macro Language (PML) variables, that is, they enable you to specify PML variables in expressions which will not be evaluated until the expression is evaluated. For example, when you are creating a report template, you are actually creating a macro which will run when a report is generated. All variables in a report template must therefore be preceded by a suitable late evaluation operator; otherwise the system will try to substitute a value for the variable when it is entered on the form. The difference between the operators is the type of output. VVALUE is used to output a numeric value, VLOGICAL to output a logical variable and VTEXT to output a text variable.
|
Attributes in Expressions | All attributes and pseudo-attributes may be recognised within expressions. Optionally they may be followed by ’OF’ to denote a different element to the current one; for example, POS OF /VESS1. Brackets may be used to denote an element of an array, for example DESP[8 + 1] for the ninth value of DESP. Since syntax clashes are possible, the keyword ATTRIB may be used to denote that an attribute follows. For example, ATTRIB E will denote the pseudo-attribute EAST as opposed to the start of a position or direction. Attributes are described in the Data Model Reference Manual.
Data Model Reference Manual
DESP[8 + 1]
Data Model Reference Manual |
Query Expressions | All expressions may be queried. Arrays are always concatenated into a single variable. Imperial values are always output as inch to variables. This preserves maximum accuracy. To output in FINCH, then the DISTANCE function must be used. In general expression do not have to be enclosed in brackets, but to be sure that other queries are not picked up by mistake then it is advisable to do so.
Particular queries that could lead to confusion are those available both outside and inside expressions. These are:
The functionality may vary between outside and inside expression queries. For example, ’Q N 100 FROM /POSS’ is not valid. It must be entered as Q N 100 FROM /POSS ).
Q PPOINT n
Q POS or cartesian position
Q ORI or cartesian orientation
Q PPOINT n
Q PPOINT n
Q POS or cartesian position
Q POS or cartesian position
Q ORI or cartesian orientation
Q ORI or cartesian orientation
Q PPOINT n
Q POS or cartesian position
Q ORI or cartesian orientation
’Q N 100 FROM /POSS’
Q N 100 FROM /POSS |
Precision of Comparisons | To allow for small losses of accuracy, the following tolerances are used.
Number
Tolerance factor of 0.000001.
In other words, if the difference between two reals is not greater than 0.000001* (maximum of the two values) then the values are considered to be equal. For example,
Position
Considered to be equal if within 0.5 mm of one another.
Direction or Orientation
Considered to be equal if values are within 0.005.
Object
Tolerance
Number
Tolerance factor of 0.000001.
In other words, if the difference between two reals is not greater than 0.000001* (maximum of the two values) then the values are considered to be equal. For example,
(1.000001 GT 1) is FALSE as it considers 1.000001; and 1 to be equal;
(1.000002 GT 1) is TRUE.
Position
Considered to be equal if within 0.5 mm of one another.
Direction or Orientation
Considered to be equal if values are within 0.005.
(1.000001 GT 1) is FALSE as it considers 1.000001; and 1 to be equal;
(1.000002 GT 1) is TRUE.
(1.000001 GT 1) is FALSE as it considers 1.000001; and 1 to be equal;
(1.000001 GT 1) is FALSE as it considers 1.000001; and 1 to be equal;
(1.000002 GT 1) is TRUE.
(1.000002 GT 1) is TRUE.
|
Undefined Values | In order to permit expressions like ((DIAM GT 200.0) OR (TYPE EQ ’BOX’)), expressions must be able to cope with undefined values. Generally, applying an operator to one or more undefined arguments has an undefined result.
Two exceptions are: the use of the AND operator with a false argument, will result in FALSE, regardless of whether or not the remainder of the arguments are defined; and OR which returns TRUE if any of its arguments is TRUE. For example, consider applying the above expression when the current element is a box. DIAM is undefined; therefore (DIAM GT 200.0) is also undefined. However, (TYPE EQ ’BOX’) is certainly true and so the final result of the whole expression evaluates to TRUE.
An undefined result occurs when:
One of the operands or arguments of a function (except some cases of AND and OR) is undefined.
An attribute is unavailable for the corresponding element (for example, ’DIAM OF OWNER’ when the current element is a box).
An element is undefined (for example, ’OWNER’ when the current element is the WORLD).
An attribute is unset (for example, text attribute or User defined Atrtribute (UDA) of length 0).
A variable is undefined (for example, ’VVAL(!ARC6)’ where !ARC6 has never been initialized).
Two position constants are compared with GT, GE, LT or LE and they have no common coordinates (for example, ’N10 EQ E5’).
If the result of the whole expression is undefined, an error occurs.
One of the operands or arguments of a function (except some cases of AND and OR) is undefined.
One of the operands or arguments of a function (except some cases of AND and OR) is undefined.
An attribute is unavailable for the corresponding element (for example, ’DIAM OF OWNER’ when the current element is a box).
An attribute is unavailable for the corresponding element (for example, ’DIAM OF OWNER’ when the current element is a box).
An element is undefined (for example, ’OWNER’ when the current element is the WORLD).
An element is undefined (for example, ’OWNER’ when the current element is the WORLD).
An attribute is unset (for example, text attribute or User defined Atrtribute (UDA) of length 0).
An attribute is unset (for example, text attribute or User defined Atrtribute (UDA) of length 0).
A variable is undefined (for example, ’VVAL(!ARC6)’ where !ARC6 has never been initialized).
A variable is undefined (for example, ’VVAL(!ARC6)’ where !ARC6 has never been initialized).
Two position constants are compared with GT, GE, LT or LE and they have no common coordinates (for example, ’N10 EQ E5’).
Two position constants are compared with GT, GE, LT or LE and they have no common coordinates (for example, ’N10 EQ E5’).
If the result of the whole expression is undefined, an error occurs.
If the result of the whole expression is undefined, an error occurs.
((DIAM GT 200.0) OR (TYPE EQ ’BOX’))
(DIAM GT 200.0)
(TYPE EQ ’BOX’)
’DIAM OF OWNER’
’OWNER’
’VVAL(!ARC6)’
!ARC6
’N10 EQ E5’ |
Unset Values | A particular class of undefined values are unset values. The concept exists for attributes which are valid for a given element, but for which no value has been assigned. Typically these may be elements of an array, or ’word’ attributes. References of value =0/0 are also treated as unset.
Unset values are propagated as for undefined values (except for Boolean operations- see below). Undefined values take precedence over unset. There is a specific logical function UNSET to test if a values is unset.
Across comparisons, unset values are not propagated, but are treated as follows:
EQ, GT, GE, LT, LE
Results in FALSE.
NE
Results in TRUE.
OR , AND
Values are treated as FALSE.
For example, if DESP(2) and LVAL(3) are unset then:
Operator
When Applied to an UNSET
EQ, GT, GE, LT, LE
Results in FALSE.
NE
Results in TRUE.
OR , AND
Values are treated as FALSE.
(DESP(2) GT 99) -> False
(DESP(2) NE 33) -> True
(:LVAL(3) AND TRUE) -> False
DESP(2)
LVAL(3) |
Rules to Define Attribute Settings | Rather than being set explicitly, the values of some types of attribute can be specified in terms of rules; that is, expressions from which the attribute values can be evaluated. Rules can be set only for attributes of the following types (including user-defined attributes): text, scalar (integer, real or logical), position, orientation, direction; they cannot be set for reference attributes. A static rule will change the attribute setting only when verified or executed explicitly, whereas a dynamic rule will update the attribute setting whenever any part of the expression changes (the default type is static).
static
dynamic |
Set Attribute Rules | Lets you set a rule for the value of a single named attribute. The rule may contain any valid expression of the type applicable to the attribute setting.
RULE SET ZLEN (XLEN + YLEN)
Sets rule that ZLEN of the current element is the sum of its XLEN and YLEN values. The ZLEN will be updated to reflect changes to XLEN or YLEN only when the rule is verified or executed (i.e. it is a static rule).
RULE SET XLEN DYNAM (YLEN + 2)
XLEN will be updated automatically whenever YLEN is changed.
RULE SET POS (N300 E400 U500) ON ALL BOX FOR /PUMP1
Sets rule for position attribute for all boxes in /PUMP1
RULE SET POS DYNAM (N100 FROM /BOX2 )
If BOX2 moves, the element with this attribute rule will move with it automatically. (Note space between last character of element name and closing parenthesis.)
Q ATT
Displays all attribute values and all rules for the current element.
Q RULES
Displays all rules for current element.
Q RUL OF XLEN
Displays rule for XLEN attribute of current element.
Q ATT
Displays all attribute values and all rules for the current element.
Q RULES
Displays all rules for current element.
Q RUL OF XLEN
Displays rule for XLEN attribute of current element.
Examples
RULE SET ZLEN (XLEN + YLEN)
Sets rule that ZLEN of the current element is the sum of its XLEN and YLEN values. The ZLEN will be updated to reflect changes to XLEN or YLEN only when the rule is verified or executed (i.e. it is a static rule).
RULE SET XLEN DYNAM (YLEN + 2)
XLEN will be updated automatically whenever YLEN is changed.
RULE SET POS (N300 E400 U500) ON ALL BOX FOR /PUMP1
Sets rule for position attribute for all boxes in /PUMP1
RULE SET POS DYNAM (N100 FROM /BOX2 )
If BOX2 moves, the element with this attribute rule will move with it automatically. (Note space between last character of element name and closing parenthesis.)
Q ATT
Displays all attribute values and all rules for the current element.
Q RULES
Displays all rules for current element.
Q RUL OF XLEN
Displays rule for XLEN attribute of current element.
>- RULE SET - attribute_name -+- STAtic --.
| |
|- DYNamic -|
| |
‘-----------+- <expre> -+- ON -.
| |
‘------+-.
|
.------’
|
‘-+- <selatt> -.
| |
‘------------+->
RULE SET ZLEN (XLEN + YLEN)
RULE SET XLEN DYNAM (YLEN + 2)
RULE SET POS (N300 E400 U500) ON ALL BOX FOR /PUMP1
RULE SET POS DYNAM (N100 FROM /BOX2 )
Q ATT
Q RULES
Q RUL OF XLEN |
Verify Attribute Rules | When a rule is verified, the expression held in the rule is evaluated and both the result of the evaluation and the current value of the attribute are displayed.
RULE VERIFY ALL
Verifies all rules for the current element.
RULE VER HEIG ON CYLI 1 FOR /PUMP1
Verifies rule for height attribute on first cylinder of /PUMP1.
Examples
RULE VERIFY ALL
Verifies all rules for the current element.
RULE VER HEIG ON CYLI 1 FOR /PUMP1
Verifies rule for height attribute on first cylinder of /PUMP1.
>-- RULE VERify --+-- attribute_name --.
| |
‘-- ALL -------------+-- ON --.
| |
‘--------+-- <selatt> --.
| |
‘--------------+-->
RULE VERIFY ALL
RULE VER HEIG ON CYLI 1 FOR /PUMP1 |
Execute Attribute Rules | When a rule is executed, the expression held in the rule is evaluated and the value of the attribute is replaced by the result of the evaluation.
RULE EXECUTE :TEMP1
Executes rule for uda :TEMP1 for the current element.
RULE EXE ALL ON ALL BOX FOR /PUMP1
Executes all rules for all boxes owned by /PUMP1.
Examples
RULE EXECUTE :TEMP1
Executes rule for uda :TEMP1 for the current element.
RULE EXE ALL ON ALL BOX FOR /PUMP1
Executes all rules for all boxes owned by /PUMP1.
>-- RULE EXEcute --+-- attribute_name --.
| |
‘-- ALL -------------+-- ON --.
| |
‘--------+-- <selatt> --.
| |
‘--------------+->
RULE EXECUTE :TEMP1
RULE EXE ALL ON ALL BOX FOR /PUMP1 |
Delete Attribute Rules | Lets you delete one or more rules for the current element or for specified elements.
RULE DELETE ALL
Deletes all rules for the current element.
RULE DEL ALL ON ALL FOR /PUMP1
Deletes all rules for all primitives owned by /PUMP1.
Examples
RULE DELETE ALL
Deletes all rules for the current element.
RULE DEL ALL ON ALL FOR /PUMP1
Deletes all rules for all primitives owned by /PUMP1.
>-- RULE DELete --+-- attribute_name --.
| |
‘-- ALL -------------+-- ON --.
| |
‘--------+-- <selatt> --.
| |
‘--------------+-->
RULE DELETE ALL
RULE DEL ALL ON ALL FOR /PUMP1 |
Rules for Arrays | Rules can be set for array attributes by using the NUM syntax, for example, the following sets rules for the first 3 design parameters.
RUL SET DESP NUM 1 ( DESP(1) OF /RULE-SCTN )
RUL SET DESP NUM 2 ( DESP(4) OF /RULE-SCTN )
RUL SET DESP NUM 3 ( 100 + DESP(2) OF PREV )
|
Collections | You can create an array which includes a number of elements which all satisfy specific selection criteria, as defined by yourself. This is a useful way of collecting information on particular elements. You use the syntax:
!Array is the name of the array that will be created to contain the elements selected.
The following general criteria can be used to define the selection:
It is possible to limit the number of items collected using the MAX number option. Starting for example: MAX 50, will collect only the first 50 items that matches the criteria given.
Class is essentially a list of element types (or possibly of actual elements). This list can be optionally qualified to indicate whether members should be included, or whether only ‘items’ (that is, the lowest level components in the hierarchy below a given element) should be included.
For example:
ALL
Selects all elements
ALL FRMW
Selects all framework elements
ALL BRANCH MEMBERS
Selects all piping components
ITEMS OF EQUI /VESS1
Selects all primitives below /VESS1
( /PIPE1 /PIPE2 )
Selects only /PIPE1 and /PIPE2.
The command:
Would create the array !PIPECOMPS and set it to contain the reference numbers of every piping component in the MDB.
Logical expressions, which return TRUE or FALSE, can be used. They are most likely to be used to check the value of an attribute for collection. The WITH or WHERE options introduce the expression. For example:
would collect all elements for which the attributes XLEN, YLEN and ZLEN match the criteria in the array !LENGTHS.
A volume is defined by the WITHIN keyword. You can define the volume either in terms of two diagonally opposite points of an enclosing box, or as a volume around an element (with an optional clearance around the box which contains the element). For example:
collects all elements in the defined volume into the array !VOLUME.
collects all piping components within the volume defined by a box ‘drawn’ 1500 mm around /PUMP1 and puts them into the array !P. The EXCLUSIVE keyword indicates that only the chosen elements exclusively within the given volume are to be selected.
In Plant there are structural design data, termed MODEL, and detailed design data, termed PRODUCTION. These two sets of data represent the same model and occupy the same 3D space. For a volumetric query you only want one of the sets of data returned.
These two options allow you to choose which set of data will be returned by the volumetric query.
Q VOLUMEOPTION HULL DESIGN
Returns DESIGN data
Q VOLUMEOPTION HULL PRODUCTION
Returns PRODUCTION data
Q VOLUMEOPTION HULL DESIGN
Returns DESIGN data
Q VOLUMEOPTION HULL PRODUCTION
Returns PRODUCTION data
Hierarchy criteria can be defined by the FOR keyword. It identifies a list of elements below which all selected elements must occur. You can also include an exclusion list. For example:
You can append the results of such a collection to an existing array using the APPEND keyword. For example:
Would add the references for all elbows to the array !BENDS.
You can also overwrite elements in the array by specifying the first index in the array which you want to be overwritten. The specified index, and the indexes following it, will be overwritten by the results. For example:
Would place the reference for the first ELBOW selected at position 99 in the array !BENDS, overwriting any existing data, and subsequent selections in the array elements that follow.
If you specify more than one criteria, the specifications must be in the above order Some more examples:
ALL
Selects all elements
ALL FRMW
Selects all framework elements
ALL BRANCH MEMBERS
Selects all piping components
ITEMS OF EQUI /VESS1
Selects all primitives below /VESS1
( /PIPE1 /PIPE2 )
Selects just /PIPE1 and /PIPE2
ALL WITH (XLEN GT 1000 )
Selects all elements where XLEN is greater than 1000mm
ALL WITHIN W8000N17000U1000 TO W1400N13500U1200
Selects all elements within the defined volume
ALL PIPE WITHIN VOLUME /PIPE1 1500
Selects all piping elements within a volume defined as a box drawn around /PIPE1, with a clearance of 1500mm between the edges of /PIPE1 and the volume box.
ALL
Selects all elements
ALL FRMW
Selects all framework elements
ALL BRANCH MEMBERS
Selects all piping components
ITEMS OF EQUI /VESS1
Selects all primitives below /VESS1
( /PIPE1 /PIPE2 )
Selects just /PIPE1 and /PIPE2
ALL WITH (XLEN GT 1000 )
Selects all elements where XLEN is greater than 1000mm
ALL WITHIN W8000N17000U1000 TO W1400N13500U1200
Selects all elements within the defined volume
ALL PIPE WITHIN VOLUME /PIPE1 1500
Selects all piping elements within a volume defined as a box drawn around /PIPE1, with a clearance of 1500mm between the edges of /PIPE1 and the volume box.
Typically, the expression is the slowest condition to evaluate, so it is important to limit the selection as much as possible. For instance, take the example which appeared above:
Since only BOXes (and NBOXes) meet this criterion it would be sensible to limit the search by specifying an appropriate class:
This cuts the time to execute the selection. This is because the selection system knows that BOXes only occur in DESI databases. Therefore it does not search other types of database. It also knows where boxes are in the hierarchy, and so does not search unnecessary elements.
Even greater performance savings can be gained by explicitly limiting the elements which have to be visited by the search:
By default, the entire MDB is searched. But by specifying a hierarchy criterion, the selection time can be cut considerably.
Limiting the volume of the search also cuts the number of elements which have to be checked. However, it should be noted that this criterion is applied by determining whether element limit boxes fall within the specified volume, using the spatial map. This is a fast approach, but is not meant to provide the same accuracy as is used in on line clashing.
will set up the array IPIPECOMPS to contain the reference numbers of every piping component in the MDB, e.g.
Every flange could then be extracted as follows:
and then enhanced (highlighted):
This could alternatively be performed in one step:
Collections may be joined or concatenated by preceding the COLLECT keyword by APPEND:
Alternatively, the following:
would place the reference of the first SLCY at position 99 in !LIST overwriting any data that already exists at that and subsequent elements of the array.
If a selection contains elements of type TUBIng, then the collection describes it as the Leave Tube of an existing database element:
Then !TUBING would contain something like the following:
!TUBING[1]
'IL TUB OF =20/302'
!TUBING[2]
'IL TUB OF =20/303'
!TUBING[1]
'IL TUB OF =20/302'
!TUBING[2]
'IL TUB OF =20/303'
The evaluate command allows an expression to be evaluation for all members of a collection.
The syntax is:
VAR !variable EVALUATE expression For selection e.g. to get the description of all equipment you can do:
The PML collection object can also be used as an alternative to the COLLECTION syntax. This object is described in the Software Customisation Reference Manual.
The name of a given prefix may be collected using the 'FROM TABLE NAME PREFIX' option.
For example:
This will find all names starting with 'B'.
The syntax may be used in conjunction with the standard options. E.g.
Some reference attributes index the attribute values. For these the indexed values can be accessed directly using FROM TABLE XXXX VALUE YYYY, where XXX is the attribute name and YYYY is the attribute match.
For example:
This will return all elements with SPRE set to /RF300/100G.
The syntax may be used in conjunction with the standard options. For example:
Searching using indexes directly will be considerably faster than the standard searches.for example:
The referenced attributes that are indexed are:
CATR
Catalog reference
PTRE
Point set reference
GMRE
geometry set reference
DTRE
Data set reference
PSTR
Structural Pline set reference
GSTR
Structural geometry set reference
NGMR
Negative geometry set reference
PAIREF
Reference to a PAINT element
SRFTRE
Reference to a SRFTRT element
SLOREF
Pipe slope reference
INSURE
Reference to a INSCMP element
DOCREF
Cross reference DOCU elements
CATR
Catalog reference
SPRE
Sprec reference
LSTU
Tube spec
ISPE
Insulation ref
HSTU
Head tube spec
INRE
Insulation reference
HCREF
References to head connected branches
TCREF
References to tail connected branches
GOBREF
Hull Generating OBject REFerence
CONNRE
Connections on nodes
POSREF
Reference to point
MDSYSF
model reference
ACCREF
Access element reference
HDBREF
Hull generic references
HTPREF
Hull topological object model reference
SCHLNK
Connectivity link to schematic item references
DESLNK
Connectivity link to design model item references
ENGLNK
Connectivity link to design model item references
PRODRF
reference from outfitting element to hull element
SPBREF
Space boundary element reference
SPINRE
Space inventory element reference
INPRTR
Inside Paint Reference
OUPRTR
Outside Paint Reference
ASSTAR
Association target reference
MARKRF
Cable Mark points
ASSTMP
Assembly template reference
ROUTND
Cable Preliminary route point
SLOREF
Pipe slope reference
To benefit from indexing you must use the 'FROM TABLE' syntax in collections. This syntax is similar the same as for system attributes.
For Text Userd Defined Attributes (UDAS):
will find all elements in current Database (DB) with :MYTEXTATT set to 'fred'
will find all elements in current DB with :MYTEXTATT starting with 'fred'
For Integer UDAS:
This will find all elements with a :MYATT of 100
This will find all elements where :MYATT is between 100 and 110.
For Ref Attributes:
will find all elements in current DB with :MYREFATT set to /PIPE1
The new syntax may be combined with existing collection syntax. E.g.
Currently a collection can be restricted to a specific DB by navigating to a specific DB and setting the scope of /*. For example:
At 12.1 the DB name may be specified as part of the collection.
For example:
Or
Or
Command
Effect
ALL
Selects all elements
ALL FRMW
Selects all framework elements
ALL BRANCH MEMBERS
Selects all piping components
ITEMS OF EQUI /VESS1
Selects all primitives below /VESS1
( /PIPE1 /PIPE2 )
Selects only /PIPE1 and /PIPE2.
Q VOLUMEOPTION HULL DESIGN
Returns DESIGN data
Q VOLUMEOPTION HULL PRODUCTION
Returns PRODUCTION data
ALL
Selects all elements
ALL FRMW
Selects all framework elements
ALL BRANCH MEMBERS
Selects all piping components
ITEMS OF EQUI /VESS1
Selects all primitives below /VESS1
( /PIPE1 /PIPE2 )
Selects just /PIPE1 and /PIPE2
ALL WITH (XLEN GT 1000 )
Selects all elements where XLEN is greater than 1000mm
ALL WITHIN W8000N17000U1000 TO W1400N13500U1200
Selects all elements within the defined volume
ALL PIPE WITHIN VOLUME /PIPE1 1500
Selects all piping elements within a volume defined as a box drawn around /PIPE1, with a clearance of 1500mm between the edges of /PIPE1 and the volume box.
!TUBING[1]
'IL TUB OF =20/302'
!TUBING[2]
'IL TUB OF =20/303'
Catalog DB
CATR
Catalog reference
PTRE
Point set reference
GMRE
geometry set reference
DTRE
Data set reference
PSTR
Structural Pline set reference
GSTR
Structural geometry set reference
NGMR
Negative geometry set reference
PAIREF
Reference to a PAINT element
SRFTRE
Reference to a SRFTRT element
SLOREF
Pipe slope reference
INSURE
Reference to a INSCMP element
Design DB
DOCREF
Cross reference DOCU elements
CATR
Catalog reference
SPRE
Sprec reference
LSTU
Tube spec
ISPE
Insulation ref
HSTU
Head tube spec
INRE
Insulation reference
HCREF
References to head connected branches
TCREF
References to tail connected branches
GOBREF
Hull Generating OBject REFerence
CONNRE
Connections on nodes
POSREF
Reference to point
MDSYSF
model reference
ACCREF
Access element reference
HDBREF
Hull generic references
HTPREF
Hull topological object model reference
SCHLNK
Connectivity link to schematic item references
DESLNK
Connectivity link to design model item references
ENGLNK
Connectivity link to design model item references
PRODRF
reference from outfitting element to hull element
SPBREF
Space boundary element reference
SPINRE
Space inventory element reference
INPRTR
Inside Paint Reference
OUPRTR
Outside Paint Reference
ASSTAR
Association target reference
MARKRF
Cable Mark points
ASSTMP
Assembly template reference
ROUTND
Cable Preliminary route point
SLOREF
Pipe slope reference
VAR !Array COLLECT selection criteria MAX number
VAR !PIPECOMPS COLLECT ALL BRANCH MEMBERS
VAR !LENGTHS COLLECT ALL WITH ( XLEN * YLEN 8 ZLEN GT 1000 )
VAR !VOLUME COLLECT ALL WITHIN W800N17000U0 TO W1400N13500U1200
VAR !P COLLECT ALL PIPE EXCLUSIVE WITHIN VOLUME /PUMP1 1500
>--- VOLUMEOPTION ---+--- HULL DESIGN ---.
| |
| |
‘- HULL PRODUCTION -+--- ON ---.
| |
| |
‘--- OFF ---+--->
VAR !BRANCH COLLECT ALL BRANCH MEMBERS FOR /PIPE1 /PIPE2
EXCLUDE BRAN 1 OF /PIPE2
VAR !BENDS APPEND COLLECT ALL ELBOWS
VAR !BENDS[99] COLLECT ALL ELBOWS
ENHANCE ALL WITH ( XLEN * YLEN * ZLEN GT 100 0 )
ENHANCE ALL BOX WITH ( XLEN * YLEN * ZLEN GT 100 0 )
ENHANCE ALL BOX WITH ( XLEN * YLEN * ZLEN GT 1000 ) FOR /*
VAR IPIPECOMPS COLLECT ALL BRANCH MEMBERS
IPIPECOMPS [1] = '=20/302'
IPIPECOMPS [2] = '=20/303'
IPIPECOMPS [3] = '=20/304'
.
.
.
IPIPECOMPS [354] = '=25/510'
VAR !FLANGES COLLECT (ALL FLANGES) FROM IPIPECOMPS
ENHANCE ALL FROM !FLANGES
ENHANCE ALL FLANGES FROM IPIPECOMPS
VAR !BENDS APPEND COLLECT ALL ELBOWS
VAR !LIST[99] COLLECT ALL SLCY
VAR !TUBING COLLECT (ALL TUBI) FOR /*
var !cln collect all EQUI
var !name evaluate (description) for all from !cln
var !name evaluate (description) for all EQUI
COLLECT ALL FROM TABLE NAME PREFIX '/B'
COLLECT ALL NOZZ WHERE (HEIGHT GT 100) FROM TABLE NAME PREFIX '/B'
VAR !COLL COLLECT ALL FROM TABLE SPRE VALUE /RF300/100G
VAR !COLL COLLECT ALL FLAN FROM TABLE SPRE VALUE /RF300/100G
VAR !COLL COLLECT ALL WHERE (SPRE EQ /RF300/100G)
VAR !COLL COLLECT ALL for /* FROM TABLE :MYTEXTATT VALUE 'fred'
VAR !COLL COLLECT ALL for /* FROM TABLE :MYTEXTATT PREFIX 'fred'
VAR !COLL COLLECT ALL FROM TABLE :MYATT VALUE 100
VAR !COLL COLLECT ALL FROM TABLE :MYATT VALUE 100 TO 110
VAR !COLL COLLECT ALL for /* FROM TABLE :MYREFATT VALUE /PIPE1
VAR !COLL COLLECT ALL for /* FROM TABLE :MYREFATT VALUE /PIPE1
Q ALL … for /*
VAR !COLL COLLECT ALL BOX FOR DB CTBATEST/DESI
VAR !COLL COLLECT ALL WHERE (SITE EQ /ATEST) FOR DB CTBATEST/DESI FROM TABLE SPRE
VALUE /RF300/100G
VAR !COLL COLLECT ALL FOR DB CTBATEST/DESI FROM TABLE NAME PREFIX '/B'
A class of elements or element types.
A logical expression to be satisfied at all selected elements.
A physical volume in which all selected elements must lie.
A point in the hierarchy below which all selected elements must lie.
All criteria (except for class) are optional.
A class of elements or element types.
A class of elements or element types.
A logical expression to be satisfied at all selected elements.
A logical expression to be satisfied at all selected elements.
A physical volume in which all selected elements must lie.
A physical volume in which all selected elements must lie.
A point in the hierarchy below which all selected elements must lie.
All criteria (except for class) are optional.
A point in the hierarchy below which all selected elements must lie.
Note: This selection mechanism is a very powerful tool for searching whole databases and MDBs. However, if you're not careful the selection process could be very time consuming and tie up a lot of computer resource. Therefore, it is important that selection is performed as efficiently as possible. Plant tries to apply the above criteria so that the fastest condition is applied first and the most expensive is left to last.
!Array
Class
ALL
ALL FRMW
ALL BRANCH MEMBERS
ITEMS OF EQUI /VESS1
/VESS1
( /PIPE1 /PIPE2 )
/PIPE1
/PIPE2
!PIPECOMPS
MDB
TRUE
FALSE
WITH
WHERE
VAR !LENGTHS COLLECT ALL WITH ( XLEN * YLEN 8 ZLEN GT 1000 )
XLEN
YLEN
ZLEN
!LENGTHS
volume
WITHIN
VAR !VOLUME COLLECT ALL WITHIN W800N17000U0 TO W1400N13500U1200
!VOLUME
VAR !P COLLECT ALL PIPE EXCLUSIVE WITHIN VOLUME /PUMP1 1500
/PUMP1
!P
EXCLUSIVE
Q VOLUMEOPTION HULL DESIGN
Q VOLUMEOPTION HULL PRODUCTION
Command Syntax
>--- VOLUMEOPTION ---+--- HULL DESIGN ---.
| |
| |
‘- HULL PRODUCTION -+--- ON ---.
| |
| |
‘--- OFF ---+--->
Hierarchy
FOR
append
APPEND
!BENDS
overwrite
ELBOW
!BENDS
ALL
ALL FRMW
ALL BRANCH MEMBERS
ITEMS OF EQUI /VESS1
( /PIPE1 /PIPE2 )
ALL WITH (XLEN GT 1000 )
ALL WITHIN W8000N17000U1000 TO W1400N13500U1200
ALL PIPE WITHIN VOLUME /PIPE1 1500
Note
:
!TUBING[1]
'IL TUB OF =20/302'
!TUBING[2]
'IL TUB OF =20/303'
CATR
Catalog reference
PTRE
Point set reference
GMRE
geometry set reference
DTRE
Data set reference
PSTR
Structural Pline set reference
GSTR
Structural geometry set reference
NGMR
Negative geometry set reference
PAIREF
Reference to a PAINT element
SRFTRE
Reference to a SRFTRT element
SLOREF
Pipe slope reference
INSURE
Reference to a INSCMP element
DOCREF
Cross reference DOCU elements
CATR
Catalog reference
SPRE
Sprec reference
LSTU
Tube spec
ISPE
Insulation ref
HSTU
Head tube spec
INRE
Insulation reference
HCREF
References to head connected branches
TCREF
References to tail connected branches
GOBREF
Hull Generating OBject REFerence
CONNRE
Connections on nodes
POSREF
Reference to point
MDSYSF
model reference
ACCREF
Access element reference
HDBREF
Hull generic references
HTPREF
Hull topological object model reference
SCHLNK
Connectivity link to schematic item references
DESLNK
Connectivity link to design model item references
ENGLNK
Connectivity link to design model item references
PRODRF
reference from outfitting element to hull element
SPBREF
Space boundary element reference
SPINRE
Space inventory element reference
INPRTR
Inside Paint Reference
OUPRTR
Outside Paint Reference
ASSTAR
Association target reference
MARKRF
Cable Mark points
ASSTMP
Assembly template reference
ROUTND
Cable Preliminary route point
SLOREF
Pipe slope reference |
Comparisons Across Sessions and Stamps | Information is provided on changing the management, defining the comparison data, comparing the database changes and reverting elements.
|
Change Management | You can query the following aspects of the history of modifications to the current database:
When and by whom an element or attribute was last modified.
A complete history of the sessions in which an element or attribute has been modified.
Details of a given session.
The session number for a given date.
When and by whom an element or attribute was last modified.
When and by whom an element or attribute was last modified.
A complete history of the sessions in which an element or attribute has been modified.
A complete history of the sessions in which an element or attribute has been modified.
Details of a given session.
Details of a given session.
The session number for a given date.
The session number for a given date.
|
Query the Last Modification to an Element or Attribute | Lets you query details of the most recent change to a given element or attribute.
Q LASTMOD
Gives date for last modification to current element.
Q SESSMOD
Gives session number for last modification to current element.
Q USERMOD
Gives name of user who last modified current element.
Q LASTMOD HIER
Gives dates for last modifications to current element and its members.
Q LASTMOD XLEN
Gives date for last modification to XLEN attribute of current element.
Examples
Q LASTMOD
Gives date for last modification to current element.
Q SESSMOD
Gives session number for last modification to current element.
Q USERMOD
Gives name of user who last modified current element.
Q LASTMOD HIER
Gives dates for last modifications to current element and its members.
Q LASTMOD XLEN
Gives date for last modification to XLEN attribute of current element.
Q --+-- LASTMod --.
| |
|-- SESSMod --|
| |
‘-- USERMod --+--+-- <selatt> --.
| | |
| ‘--------------+-- HIERarchy --.
| | |
| ‘---------------+-->
|
‘-- attribute_name -->
Q LASTMOD
Q SESSMOD
Q USERMOD
Q LASTMOD HIER
Q LASTMOD XLEN |
Query the Session History for an Element or Attribute | Lets you query modification history for a given attribute; i.e. session numbers during which the attribute was modified.
Q HISTORY DIAM
Gives all sessions in which DIAM attribute was modified.
Examples
Q HISTORY DIAM
Gives all sessions in which DIAM attribute was modified.
Q HISTORY attribute_name
Note:
HISTORY is an array type pseudo-attribute, so that qualifying positions may be appended to query specific occurrences in the modification history. For example:
Q HISTORY[2] DIAM
gives second most recent session in which DIAM attribute was modified.
Note:
History records are restricted to a maximum of 120 sessions.
Q HISTORY DIAM
Note
:
Q HISTORY[2] DIAM
Note
:
attribute_name |
Query Details of a Specific Session | Lets you query details of any specific session. This is particularly useful to get details of sessions listed by a HISTORY command.
Q SESSCOMM 58
Gives comment text associated with session 58
Q SESSUSER 58
Gives name of user responsible for session 58.
Q SESSDATE 58
Gives date and time at which session 58 was created.
Examples
Q SESSCOMM 58
Gives comment text associated with session 58
Q SESSUSER 58
Gives name of user responsible for session 58.
Q SESSDATE 58
Gives date and time at which session 58 was created.
Q --+-- SESSComment --.
| |
|-- SESSUser -----|
| |
‘-- SESSDate -----+-- integer -->
Note:
All session queries are for the current DB.
Q SESSCOMM 58
Q SESSUSER 58
Q SESSDATE 58
Note
: |
Query Session Number for a Given Time | Lets you query which session was current at a given time. (This is the inverse of the Q SESSDATE option described in Query Details of a Specific Session.)
Q SESSION ON 12:00 22 August 1995 Q SESSION ON 9 /9 /96
Time defaults to 23:59, so returns last session number on given date.
where <date> is a standard syntax graph. Remember that <date> actually specifies a time (to the nearest minute), so take care if you use any defaults here.
Examples
Q SESSION ON 12:00 22 August 1995 Q SESSION ON 9 /9 /96
Time defaults to 23:59, so returns last session number on given date.
Q SESSION ON <date>
Query Details of a Specific Session
Query Details of a Specific Session |
Comparison Date | It is only by comparing a drawing at two states or sessions that it is possible to determine what has changed. Using the current state of the drawing as one state we must then reference an earlier state in order to make the comparison. We do this by specifying a Comparison Date (COMPDATE), that is, the drawing state at a time that we wish to use as a baseline or datum.
|
et the Comparison Date | You can enter a comparison date, either for the entire Multiple Database (MDB) or an individual Database (DB). For individual DBs, you can also enter a specific session number and extract number.
SETCOMPDATE 31 March 2002
SETCOMPDATE STAMP /STAMP1
SETCOMPDATE NOW
Compares against the start values
SETCOMPDATE FOR CTBATEST/DESI to session 99
SETCOMPDATE FOR CTBATEST/DESI to EXTRACT
Compares against the parent.
SETCOMPDATE FOR CTBATEST/DESI to CTBATEST/MASTER
CTBATEST/MASTER must be up the extract hierarchy.
The ‘date’ subgraph takes the keyword NOW This in effect sets the comparison date to the start of the session. This can be useful for querying the original value of an attribute.
The EXTRACT keyword sets the comparison to an extract DB. This extract DB must be one further up the extract hierarchy. If the EXTRACT keyword is used by itself, the comparison is set to the parent extract. Thus this enables you to find out what has been changed in this extract.
Examples
SETCOMPDATE 31 March 2002
SETCOMPDATE STAMP /STAMP1
SETCOMPDATE NOW
Compares against the start values
SETCOMPDATE FOR CTBATEST/DESI to session 99
SETCOMPDATE FOR CTBATEST/DESI to EXTRACT
Compares against the parent.
SETCOMPDATE FOR CTBATEST/DESI to CTBATEST/MASTER
CTBATEST/MASTER must be up the extract hierarchy.
-SETCOMPDATE--|---date->
| --STAMP------name->
‘-FOR--DB--dbname--TO--|--date-->
|--Session -int-|--|-EXTRACT--|—- int---->
‘---------------‘ ‘--> |-- Dbname->
‘---------->
SETCOMPDATE 31 March 2002
SETCOMPDATE STAMP /STAMP1
SETCOMPDATE NOW
SETCOMPDATE FOR CTBATEST/DESI
SETCOMPDATE FOR CTBATEST/DESI to EXTRACT
SETCOMPDATE FOR CTBATEST/DESI to CTBATEST/MASTER |
Query the Comparison Date | The query will return the comparison session number or extract number for a Database (DB).
Q COMPDATE EXTRACT FOR DB CTBATEST/DESI
to get extract
Q COMPDATE COMPDATE SESSION FOR DB CTBATEST/DESI
to get session
Q COMPDATE DATE
to get date
Q COMPDATE STAMP
to get stamp
The query for the comparison date will only return a value if the COMPDATE was set using a single date. Otherwise it will return ‘unset’. Similarly querying a stamp is only valid if the COMPDATE was set using a stamp.
Examples
Q COMPDATE EXTRACT FOR DB CTBATEST/DESI
to get extract
Q COMPDATE COMPDATE SESSION FOR DB CTBATEST/DESI
to get session
Q COMPDATE DATE
to get date
Q COMPDATE STAMP
to get stamp
Q ----------|-COMPDATE-|--SESSION--|--FOR---dbname--->
VAR ‑vname--‘ |—EXTRACT---´
|----DATE--------->
‘----STAMP-------->
Note:
Note that if a stamp is used to set the comparison date, this will set the comparison session for each database within the stamp. It will also reset any comparison dates set previously.
Q COMPDATE EXTRACT FOR DB CTBATEST/DESI
Q COMPDATE COMPDATE SESSION FOR DB CTBATEST/DESI
Q COMPDATE DATE
Q COMPDATE STAMP
Note
: |
MODIFIED Function | For the more sophisticated queries relating to modifications, the MODIFIED function tells you if the given element has changed since the comparison date. This function is not implemented within PML2 expressions.
To return true if element has changed at all since the comparison date use:
Q MODIFIED()
It will also return true if the element has been created since the comparison date.
To return true if POS or ORI have been modified since the comparison date use:
Q MODIFIED(POS,ORI)
To return true if the position of P1 has changed use.
Q MODIFIED(P1 POS)
You may follow each attribute name with the qualifying keywords below.
To check this element and members use:
OFFSPRING
To check all elements for which this element represents the significant one use:
SIGNIF
To check all elements for which this element represents the primary one use:
PRIMARY
To check this element and everything below (descendants):
DESCENDANTS
You can use the keywords below on their own to test for any attribute change. For example, to return true if any geometry for item or any descendants have changed use:
Q MODIFIED(GEOM DESCENDANTS)
To return true if any element for which this element is primary, has changed use:
Q MODIFIED(PRIMARY)
You may use the ‘OF’ syntax as for attributes. for example, to return true if /PIPE1 has been modified since the comparison date use:
Q MODIFIED() OF /PIPE1
You may put the new functions anywhere within an AVEVA E3D Design PML1 expression. that means. after Q/Var and within collections. For example,
Q (BUIL OR MODIFIED() OR ELECREC OF NEXT )
‘-->
Examples
To return true if element has changed at all since the comparison date use:
Q MODIFIED()
It will also return true if the element has been created since the comparison date.
To return true if POS or ORI have been modified since the comparison date use:
Q MODIFIED(POS,ORI)
To return true if the position of P1 has changed use.
Q MODIFIED(P1 POS)
You may follow each attribute name with the qualifying keywords below.
To check this element and members use:
OFFSPRING
To check all elements for which this element represents the significant one use:
SIGNIF
To check all elements for which this element represents the primary one use:
PRIMARY
To check this element and everything below (descendants):
DESCENDANTS
You can use the keywords below on their own to test for any attribute change. For example, to return true if any geometry for item or any descendants have changed use:
Q MODIFIED(GEOM DESCENDANTS)
To return true if any element for which this element is primary, has changed use:
Q MODIFIED(PRIMARY)
You may use the ‘OF’ syntax as for attributes. for example, to return true if /PIPE1 has been modified since the comparison date use:
Q MODIFIED() OF /PIPE1
You may put the new functions anywhere within an AVEVA E3D Design PML1 expression. that means. after Q/Var and within collections. For example,
Q (BUIL OR MODIFIED() OR ELECREC OF NEXT )
Q MODIFIED()
Q MODIFIED(POS,ORI)
Q MODIFIED(P1 POS)
OFFSPRING
SIGNIF
PRIMARY
DESCENDANTS
Q MODIFIED(GEOM DESCENDANTS)
Q MODIFIED(PRIMARY)
Q MODIFIED() OF /PIPE1
Q (BUIL OR MODIFIED() OR ELECREC OF NEXT )
.------------------------------------.
/ |
>-MODIFIED-(-+--attname-------|--*--DESCENDANTS--+--+-comma--+--attname--´
| | | |
|--DESCENDANTS--. |-- SIGNIFICANT-| |
| | | | |
|--SIGNIFICANT--| |--PRIMARY----- | |
| | | | |
|--PRIMARY------| |--MEMBERS------| |
| | | | |
|--MEMBERS------| ‘---------------‘ |
| | |
| | |
| | |
‘---------------+----------------------+--+--) ---OF --id-->
|
‘--> |
CREATED Function | Determine if an element has changed since the Comparison Date. The functionality of CREATED() is identical to using the pseudo attribute ELECREC.
Q ( CREATED() )
|
DELETED Function | Determine if an element has been deleted since the Comparison Date. The functionality of DELETED() is identical to using the pseudo attribute ELEDELC.
Q ( DELETED() )-
returns deleted since comparison date
However if the element has been deleted then you cannot have navigated to it in the first place, hence DELETED() by itself will always be true. There are two ways around this.
Either include the element’s reference number, for example:
Q (DELETED() of =15752/234 )
Or use it as part of the 'old' syntax. e.g.:
Q OLD (DELETED() of /VESS2)
Examples
Q ( DELETED() )-
returns deleted since comparison date
However if the element has been deleted then you cannot have navigated to it in the first place, hence DELETED() by itself will always be true. There are two ways around this.
Either include the element’s reference number, for example:
Q (DELETED() of =15752/234 )
Or use it as part of the 'old' syntax. e.g.:
Q OLD (DELETED() of /VESS2)
Q ( DELETED() )-
Q (DELETED() of =15752/234 )
Q OLD (DELETED() of /VESS2) |
GEOM, CATTEXT, and CATMOD Special Attributes | There are three new special attributes ‘GEOM’, ‘CATTEXT’, and CATMOD (previously called ‘CATA’).
The GEOM attribute returns true if any aspect of the evaluated geometry has changed.
The definition of evaluated geometry change includes:
This will return true if any part of the evaluated detail or material text has changed.
Special attribute CATMOD will return true if any value in the catalog has changed, for example,
Thus it is possible that the geometry element has changed but the GEOM keyword returns false, for example, a User Defined Attributes (UDA) value may have changed, but this has no effect on the evaluated geometry.
The CATMOD keyword on the other hand will return true for any change.
You can use the CATMOD keyword on any element. It will return ‘false’ if the element does not have a SPREF or CATREF reference pointing into the catalog database. It will return ‘true’ if the element has a SPREF or CATREF attribute and either (a) this reference attribute has itself changed in value or (b) the catalog element pointed at, or any catalog element owned by or pointed at by this element, either directly or indirectly, has changed in any way.
The exception is that elements pointed at by UDA’s are not compared, although the value of the UDA itself is checked. Thus if a reference valued UDA has been changed then this will count as a change, but if only the element pointed at has changed, then this will not count.
Any dimension of a primitive has changed
Any ppoint changes
Pos/ori change
The level information used to determine the geometry is set by the ‘REPRE MASS’ command. The ‘REPRE MASS’ command is also available in Isodraft.
Any dimension of a primitive has changed
Any dimension of a primitive has changed
Any ppoint changes
Any ppoint changes
Pos/ori change
The level information used to determine the geometry is set by the ‘REPRE MASS’ command. The ‘REPRE MASS’ command is also available in Isodraft.
Pos/ori change
Specification Reference (SPREF)
Changes to a Specific Component (SPCO) element
Changes to a Piping Component (COMP) element
Changes to any Pointset Element (PTSE), 3D Geomset Element (GMSE)
Changes to any dataset elements
Changes in DTEXT, Material Text elements (MTEXT) elements
Note that there is a subtle difference between CATMOD and the other two: the CATTEXT and GEOM keywords work on the evaluated values.
Specification Reference (SPREF)
Specification Reference (SPREF)
Changes to a Specific Component (SPCO) element
Changes to a Specific Component (SPCO) element
Changes to a Piping Component (COMP) element
Changes to a Piping Component (COMP) element
Changes to any Pointset Element (PTSE), 3D Geomset Element (GMSE)
Changes to any Pointset Element (PTSE), 3D Geomset Element (GMSE)
Changes to any dataset elements
Changes to any dataset elements
Changes in DTEXT, Material Text elements (MTEXT) elements
Note that there is a subtle difference between CATMOD and the other two: the CATTEXT and GEOM keywords work on the evaluated values.
Changes in DTEXT, Material Text elements (MTEXT) elements
pointed at |
Query Any Attribute at the Comparison Date | The ‘OLD’ syntax enables you to query any attribute at the comparison date.
You can use the syntax in front of any expression or attribute. The whole expression will then be evaluated at the comparison date. For example:
If a name is given, the name will be for the item at the comparison date, not now. Thus values of deleted items may be accessed. For example:
Where /OLDPIPE no longer exists.
The ‘OLD’ syntax may also be used after ‘VAR’. This includes collections. For example:
This would return a collection of all PIPES at the old version.
If the functions MODIFIED, CREATED, DELETED are used on the old version then the comparison is made with the current version.
For example to get a list of deleted pipes between the comparison date and now, then the following collection could be used. For example:
There is also a pseudo attribute, DSESS. that returns the session number when an element was deleted.That means having got the deleted PIPES from the previous query, we can now find out when they were deleted.
Q OLD XLEN
Q OLD REF OF /OLDPIPE
VAR !PIPES OLD COLLECT ALL PIPES
VAR !PIPES OLD COLLECT ALL PIPES WITH ( DELETED() )
|
Compare Database Changes | Information is provided on comparing database stats at different times and on model changes.
|
Compare Database States at Different Times | You can compare details of your current database settings with the corresponding settings at a specified earlier time and generate a report listing all differences. The types of change reported include:
DIFFERENCE SINCE
Lets you report all changes to one or more specified database elements since an earlier version of that database. The output is in the form of a report listing all elements and attributes which have changed, with their old and new values. The report can be sent to a file by using the ALPHA FILE or ALPHA LOG commands.
DIFFERENCE ALL BRANCH FOR /ATEST SINCE 21 JANUARY
DIFF CE SINCE 10:00
Assumes current day.
DIFF /ZONE
Compares current settings with those at your last SAVEWORK command.
DIFF SITE SINCE SESSION 66
Compares current settings with those at the end of session 66 of the current database.
Examples
DIFFERENCE ALL BRANCH FOR /ATEST SINCE 21 JANUARY
DIFF CE SINCE 10:00
Assumes current day.
DIFF /ZONE
Compares current settings with those at your last SAVEWORK command.
DIFF SITE SINCE SESSION 66
Compares current settings with those at the end of session 66 of the current database.
>- DIFFerence <selele> SINCE -+- <date/time> -+-----------------------.
| | |
|- LATEST ------| |
| | |
|--SESSION nn --| |
| | |
‘---------------+- EXTRACT -+- extname -|
| |
‘- extno ---+->
Creation and deletion of elements.
Changes to the attribute settings of elements.
Changes in the list order for BRANCH, POGON, DRAWI and BOUND elements.
Creation and deletion of elements.
Creation and deletion of elements.
Changes to the attribute settings of elements.
Changes to the attribute settings of elements.
Changes in the list order for BRANCH, POGON, DRAWI and BOUND elements.
Changes in the list order for BRANCH, POGON, DRAWI and BOUND elements.
Note:
The database states are compared between SAVEWORK operations. For example, if you last saved your design changes at 9:30 and ask for a comparison since 10:00, the current settings will be compared with those at 9:30.
Note
:
DIFFERENCE ALL BRANCH FOR /ATEST SINCE 21 JANUARY
DIFF CE SINCE 10:00
DIFF /ZONE
DIFF SITE SINCE SESSION 66 |
Model Changes | Model Changes provides a mechanism for exploring change and highlighting changed elements in the 3D Graphical View. On the Manage tab, in the History group, click Model Changes to display the Model Changes window.
The Model Changes window has two vertically split panes. The top pane contains a Model Explorer while the lower split contains the following tabs.
The Element History and Key panes are for information only while the Model Timeline and Stamps panes allow the selection of a session or stamp upon which to base the display of changes in the explorer pane, and optional highlighting of changed elements in the 3D graphical view. Once a session or stamp is selected changes can be highlighted by Refresh.
Model Timeline
Clicking Model Timeline displays every session for every Design database in the current MDB, ordered chronologically.
Stamps
Clicking Stamps lists details of every stamp that records session numbers for all of the Design databases in the Multiple Database (MDB).
Element History
Clicking Element History lists the details of every database session in which the selected Current Element (CE) has changed.
Key
Clicking Key displays a static tree control with images, colour and text explaining explorer annotations used to display changes in the explorer control.
Either of two modes of change reporting can be selected from the drop-down menu according to the current selection.
All Changes Since displays only changes that have been made in all databases in the MDB between, but not including, the selected session or stamp, and the current state of the model but does include any unsaved changes.
Only Changes At displays only the changes that were made when the highlighted session was created which, may have been a savework or as the result of an extract operation, such as a flush or refresh, as indicated by the Reason column in the Model Timeline table.
Note Highlighting in the explorer pane and in the 3D graphical view is always with reference to the current state of the model; it is possible that no changes from a previous session will be visible, for example if all changes were made to elements that have since been deleted.
When Refresh is clicked and the change analysis operation is complete the explorer tree is updated with annotations which highlight the changed elements in detail.
Clicking Highlight has an immediate effect on all 3D graphical views if changes are currently displayed in the explorer tree. Any changed elements that have graphical representation and are in the drawlist for any active view are highlighted in colour. This uses the same customizable colour used by the Highlight element function available via right-click menu in the standard Model Explorer. Unchecking Highlight returns the graphical display to normal coloring.
All panes of the Model Changes are updated and explorer annotations and 3D graphical highlighting are reset in the following circumstances:
Following any of these operations Refresh must be clicked again in order to update the change highlighting.
.
.
.
further element changes
savework, getwork, and refresh
user or MDB switch
further element changes
further element changes
savework, getwork, and refresh
savework, getwork, and refresh
user or MDB switch
user or MDB switch
Note: T
he previous DB Changes appware is now available on the Manage tab, in the History group, clicking DB Listing.
Note:
For large models this change analysis can take some time.
Model Changes
Manage
History
Model Changes
Model Changes
Note
:
DB Changes
Manage
History
DB Listing
Model Changes
Element History
Key
Model Timeline
Stamps
Refresh
Model Timeline
Model Timeline
Stamps
Stamps
Element History
Element History
Key
Key
All Changes Since
Note
:
Only Changes At
Refresh
Highlight
Highlight element
Highlight
Model Changes
Refresh |
Revert Elements | Revert allows you to directly Revert an element or hierarchy of elements to a previous state.
Where the <comparison> syntax is similar to that following the SINCE keyword in both of the existing DIFFERENCE and OUTPUT CHANGES commands.
If the BEFORE clause is used the elements will be reverted to the state they had before the session that is selected by the historical specification.
Examples of the Revert Command:
The revert command makes sure that every element creation, include, reorder and deletion, and every attribute change is allowed before proceeding. If any of these tests fail, for example due to legality checks, read-only databases or Data Access Controls (DACs), then the entire revert operation is cancelled and the following error is generated.
In this case a series of warning messages is written to the console indicating the causes of the error, for example:
Element locks do not prevent a revert operation if those elements were unlocked in the previous state.
>- REVert -+- ELEment ---.
| |
`- HIERarchy -+- <selele> -+- AT -----.
| |
`- BEFore -+- <comparison> ->
-->-+- <date/time> -+-----------------------.
| | |
|- LATEST ------| |
| | |
|---------------+- EXTRACT -+-----------|
| | |
| |- extno ---+
| | |
| '- extname -+
| |
`- STAMP - <name> ---------------------+->
REVERT HIER /EQUIP AT LATEST
REVERT HIER /EQUIP BEFORE LATEST
REVERT ELE /E1301 AT 20:16 26 / 3 / 2010
REVERT HIER /PIPES AT STAMP /StampMilestone7
REVERT HIER CE AT EXTRACT
(43,615) Cannot Revert elements. No changes have been made.
DAC prevents deletion of element /DELETE_UDET_B
DAC prevents creation of element =15752/1363
DAC prevents modification of attribute Built on element /MODIFY_B_VESS1
Note:
This command is not directly related to the REVERT <database name> command available in the Admin module. This command allows an entire database to be reverted to the state it had at a previous session.
>- REVert -+- ELEment ---.
| |
`- HIERarchy -+- <selele> -+- AT -----.
| |
`- BEFore -+- <comparison> ->
<comparison>
SINCE
DIFFERENCE
OUTPUT CHANGES
-->-+- <date/time> -+-----------------------.
| | |
|- LATEST ------| |
| | |
|---------------+- EXTRACT -+-----------|
| | |
| |- extno ---+
| | |
| '- extname -+
| |
`- STAMP - <name> ---------------------+->
BEFORE
/EQUIP
/EQUIP
/E1301
/PIPES
(43,615) Cannot Revert elements. No changes have been made.
DAC prevents deletion of element /DELETE_UDET_B
DAC prevents creation of element =15752/1363
DAC prevents modification of attribute Built on element /MODIFY_B_VESS1
Note
:
REVERT <database name> |
Project Queries | Information is provided on the multiple database mode, on how to check current user status and system status and on how to list project information and how query multiple database.
|
MDB Mode | The MDB command puts you into MDB Mode, where you can use a limited number of Monitor commands. This lets you change the current multiple database during a session without having to leave the Module and enter Monitor.
When you enter MDB mode, you can either update the current Multiple Database (MDB) to save your design changes, or ignore any changes made since your last SAVEWORK command, by specifying UPDATE or NOUPDATE.
When you are in MDB mode, you can give the following commands, which are the same as the corresponding Monitor commands. Refer to for further information.
MDB UPDATE
Save design changes and enter MDB Mode.
MDB NOUPDATE
Enter MDB Mode without saving design changes.
EXCHANGE
DEFER
CURRENT
Alter the databases in the current list of the current MDB
PROTECT
Temporarily alters your access rights to specified databases.
USER username
Changes the current user
PROJECT code
Changes the current project
LIST
Allows you to query:
Users, including the number of active users,
Teams including the set (current) Team,
Databases, including copied Databases,
MDBs, Macros and Variables
/PIPING
Change to MDB /PIPING.
/PIPING READONLY
Change to MDB /PIPING in read-only mode.
EXIT
Return to MODEL Mode.
Examples
MDB UPDATE
Save design changes and enter MDB Mode.
MDB NOUPDATE
Enter MDB Mode without saving design changes.
EXCHANGE
DEFER
CURRENT
Alter the databases in the current list of the current MDB
PROTECT
Temporarily alters your access rights to specified databases.
USER username
Changes the current user
PROJECT code
Changes the current project
LIST
Allows you to query:
Users, including the number of active users,
Teams including the set (current) Team,
Databases, including copied Databases,
MDBs, Macros and Variables
/PIPING
Change to MDB /PIPING.
/PIPING READONLY
Change to MDB /PIPING in read-only mode.
EXIT
Return to MODEL Mode.
>-- MDB --+-- UPdate ----.
| |
‘-- NOUPdate --+-->
MDB Mode
MDB UPDATE
MDB NOUPDATE
EXCHANGE
DEFER
CURRENT
PROTECT
USER username
PROJECT code
LIST
/PIPING
/PIPING READONLY
EXIT |
Check the Current User Status | Gives you information about your current status as a user and about the Databases (DBs) to which you have access.
A typical response to the STATUS command could be:
Project: XYZ
User: CSI (758)
Teams: B
MDB: /DESIGN
Current DBS:
1 PIPING/SITE RW
2 MASTER/CATLOG R
Deferred DBS:
3 STRUCT/STEEL
This indicates that the designer has identified himself as being AVEVA E3D Design user CSI, that he is logged in to the computer as user 758, that he is a member of team B, that he is accessing Project XYZ, and that he has selected an Multiple Database (MDB) called /MODEL.
If INFO is specified then a line of text explains the reason for the database access mode differing from expectation. For example:
Example
A typical response to the STATUS command could be:
Project: XYZ
User: CSI (758)
Teams: B
MDB: /DESIGN
Current DBS:
1 PIPING/SITE RW
2 MASTER/CATLOG R
Deferred DBS:
3 STRUCT/STEEL
>-- STATus -+---------------->
|
‘- INFOrmation -->
not integrated
current product has limited access
database not allocated to this location
not integrated
not integrated
current product has limited access
current product has limited access
database not allocated to this location
database not allocated to this location
Project: XYZ
User: CSI (758)
Teams: B
MDB: /DESIGN
Current DBS:
1 PIPING/SITE RW
2 MASTER/CATLOG R
Deferred DBS:
3 STRUCT/STEEL |
Check the Current System Status | The SYstem STATus command gives you information about the current active status of the project in which you are working. It lists all users who are currently accessing the project, the modules and databases which they are using, and whether they are examining (Read-only status) or modifying (Read/Write status) the database. It also gives the workstation identifier for each user.
A typical response to the SYSTAT command could be:
PROJECT XYZ
==============
USER SYSTEM (57b)
MODULE ADMIN
MDB ** UNSET **
USER HHJ (752)
MODULE DESIGN
MDB /STEEL
DB MODE
MASTER/AREA-A R
MASTER/AREA-B R
STRUC/AREA-C RW
This shows that two users are currently logged in and are using AVEVA E3D Design for work on Project XYZ. The Project Coordinator is using Admin but is not accessing any databases. User 752 is using Model. He is accessing the Multiple Database (MDB) named /STEEL, whose constituent Databases (DBs) are as listed. He has Read-only status for the DBs owned by the MASTER (System) team and Read/Write access to the DB STRUC/AREA-C.
Example
A typical response to the SYSTAT command could be:
PROJECT XYZ
==============
USER SYSTEM (57b)
MODULE ADMIN
MDB ** UNSET **
USER HHJ (752)
MODULE DESIGN
MDB /STEEL
DB MODE
MASTER/AREA-A R
MASTER/AREA-B R
STRUC/AREA-C RW
>-- SYStat -->
SY
STAT
PROJECT XYZ
==============
USER SYSTEM (57b)
MODULE ADMIN
MDB ** UNSET **
USER HHJ (752)
MODULE DESIGN
MDB /STEEL
DB MODE
MASTER/AREA-A R
MASTER/AREA-B R
STRUC/AREA-C RW |
List Project Information | Lets you list most of the project information held in the System Database, with the exception of confidential details such as other users’ passwords, which can only be listed by the System Administrator in AVEVA E3D Design Admin.
A typical response to the LIST MDB command could be:
List of MDBS for project XXX
==============================
MDB: /DESIGN
Current DBS:
1 PIPING/AREA-A DESI Exclusive
2 PIPING/AREA-C DESI Update
3 MASTER/AREA-D DESI Exclusive
Deferred DBS:
4 PIPING/AREA-B DESI Exclusive
5 MASTER/AREA-E DESI Update
MDB:/STEEL
Current DBS:
1 MASTER/AREA-A DESI Exclusive
2 MASTER/AREA-B DESI Exclusive
3 STRUCT/AREA-C DESI Exclusive
Deferred DBS:
**NONE**
MDB: /ANSI
Current DBS:
1 CATAL/AREA-E CATA Update
Deferred DBS:
**NONE**
A typical response to the LIST USERS command could be:
List of USERS for project ZZZ
===============================
SYSTEM (FREE)
TEAMS :MASTER STAB
Z (FREE)
TEAMS :***NONE**
GEN (GENERAL)
TEAMS :TEST
The information generated by the LIST command can either be displayed on screen or sent to a file.
Examples
A typical response to the LIST MDB command could be:
List of MDBS for project XXX
==============================
MDB: /DESIGN
Current DBS:
1 PIPING/AREA-A DESI Exclusive
2 PIPING/AREA-C DESI Update
3 MASTER/AREA-D DESI Exclusive
Deferred DBS:
4 PIPING/AREA-B DESI Exclusive
5 MASTER/AREA-E DESI Update
MDB:/STEEL
Current DBS:
1 MASTER/AREA-A DESI Exclusive
2 MASTER/AREA-B DESI Exclusive
3 STRUCT/AREA-C DESI Exclusive
Deferred DBS:
**NONE**
MDB: /ANSI
Current DBS:
1 CATAL/AREA-E CATA Update
Deferred DBS:
**NONE**
A typical response to the LIST USERS command could be:
List of USERS for project ZZZ
===============================
SYSTEM (FREE)
TEAMS :MASTER STAB
Z (FREE)
TEAMS :***NONE**
GEN (GENERAL)
TEAMS :TEST
.----<----.
/ |
>-- LIst --*-- USers --|
| |
|-- MDBs ---|
| |
|-- DBs ----|
| |
|-- TEams --’
|
‘-------------->
List of MDBS for project XXX
==============================
MDB: /DESIGN
Current DBS:
1 PIPING/AREA-A DESI Exclusive
2 PIPING/AREA-C DESI Update
3 MASTER/AREA-D DESI Exclusive
Deferred DBS:
4 PIPING/AREA-B DESI Exclusive
5 MASTER/AREA-E DESI Update
MDB:/STEEL
Current DBS:
1 MASTER/AREA-A DESI Exclusive
2 MASTER/AREA-B DESI Exclusive
3 STRUCT/AREA-C DESI Exclusive
Deferred DBS:
**NONE**
MDB: /ANSI
Current DBS:
1 CATAL/AREA-E CATA Update
Deferred DBS:
**NONE**
List of USERS for project ZZZ
===============================
SYSTEM (FREE)
TEAMS :MASTER STAB
Z (FREE)
TEAMS :***NONE**
GEN (GENERAL)
TEAMS :TEST |
Query MDB Information | Lets you query details of the current Multiple Database (MDB). This is a supplementary querying facility to the LIST command (List Project Information). It allows specific information about features of the project configuration to be interrogated.
>-- Query --+-- USer ---.
| |
|-- USer word ---|
| |
|-- TEam word ---|
| |
|-- DB dbname ---|
| |
‘-- MDB name ----+-->
List Project Information
List Project Information |
Query Individual Database Information | Lets you query details of the current DB for a given element.
Q DBNAME
Gives name of current DB
Q DBTYPE
Gives type of current DB
Q DBFNUMBER
Gives file number for current DB
Q DBFILE
Gives pathname for current DB file
Examples
Q DBNAME
Gives name of current DB
Q DBTYPE
Gives type of current DB
Q DBFNUMBER
Gives file number for current DB
Q DBFILE
Gives pathname for current DB file
>-- Query --+-- DBNAme -----.
| |
|-- DBTYpe -----|
| |
|-- DBFNumber --|
| |
‘-- DBFIle -----+-->
Q DBNAME
Q DBTYPE
Q DBFNUMBER
Q DBFILE |
Link Documents | The link documents mechanisms provide the ability to link external and internal documents to database objects. Every element in the database can be associated with a resource that is either another database element for example a drawing, or an external document such as a file, or a web page. External documents are not stored in the Dabacon database.
|
Overview | Each document or other resource, either external or internal, that can be linked to a database element is represented in the database as Link Descriptor. The Link Descriptor's main role is to carry information about the document it describes and a Uniform Resource Locator (URL).
It is possible for any other elements in the database to reference these Link Descriptors through a two-way mechanism enabling users to find all elements that reference a particular Link Descriptor and the opposite, find all documents referenced by an element.
It is also possible to assign classification information to each Link Descriptor. The classification information provides the facility of assigning multiple class information to a Link Descriptor so that a search for all elements that have references to documents with specific classification assigned can be made. For example, a search can be made for all Link Descriptors classified as "Installation"-class document or all pumps that do not reference any "Certificate" and "Security"-class documents.
The following figure shows a schematic overview of the possible linkage to external documents and internal drawings.
|
Data Structures | There are several element types used for organizing links and storing link information. All kinds of elements may be created using standard AVEVA E3D Design command syntax.
|
Link World (LINKWL) | All elements related to links are stored under Link World elements. To use links you have to create at least one Link World. It can store Link Folders, Link Classes and Link Descriptors which are covered in the following sections.
It is possible to assign Link Descriptors to elements in other databases. It is therefore recommended that LINKWL elements are created in a MODEL database of its own to which all relevant teams have read and write access.
|
Link Folder (LNFOLD) | Under Link Worlds it is possible to organize all elements into a tree structure. You can create Link Folders that can contain more Link Folders or Link Classes and Link Descriptors. This way it is possible to freely configure the hierarchy.
|
Link Descriptor (LNDESC) | A Link Descriptor (LNDESC) element holds a link to documents and external resources. Both external documents and draft drawing elements can be referenced using a LNDESC.
A Link Descriptor has the following attributes:
The following pseudo attributes may be queried:
NAME - user-defined name of the LNDESC element.
DESC - description of the element.
LNKURL - a string storing raw Uniform Resource Locator of the linked document.
NAME - user-defined name of the LNDESC element.
NAME - user-defined name of the LNDESC element.
DESC - description of the element.
DESC - description of the element.
LNKURL - a string storing raw Uniform Resource Locator of the linked document.
LNKURL - a string storing raw Uniform Resource Locator of the linked document.
LNKREF - if the Link Descriptor holds a reference to an internal database element,that means,. the LNKURL stores a "dabref://…" link, this attribute returns a reference to a database element linked through this descriptor. Otherwise, LNKREF returns a null reference. It is also possible to store an internal reference through this attribute.
URL - this attribute returns merely the value of LNKURL but its main purpose is that you can assign either an external URL or a string with reference number of a Dabacon element, which is automatically recognised and stored as an internal link.
LNKCLS - list of Link Class elements that classify this Link Descriptor.
LNKELE - list of elements that have this Link Descriptor assigned.
LNKREF - if the Link Descriptor holds a reference to an internal database element,that means,. the LNKURL stores a "dabref://…" link, this attribute returns a reference to a database element linked through this descriptor. Otherwise, LNKREF returns a null reference. It is also possible to store an internal reference through this attribute.
LNKREF - if the Link Descriptor holds a reference to an internal database element,that means,. the LNKURL stores a "dabref://…" link, this attribute returns a reference to a database element linked through this descriptor. Otherwise, LNKREF returns a null reference. It is also possible to store an internal reference through this attribute.
URL - this attribute returns merely the value of LNKURL but its main purpose is that you can assign either an external URL or a string with reference number of a Dabacon element, which is automatically recognised and stored as an internal link.
URL - this attribute returns merely the value of LNKURL but its main purpose is that you can assign either an external URL or a string with reference number of a Dabacon element, which is automatically recognised and stored as an internal link.
LNKCLS - list of Link Class elements that classify this Link Descriptor.
LNKCLS - list of Link Class elements that classify this Link Descriptor.
LNKELE - list of elements that have this Link Descriptor assigned.
LNKELE - list of elements that have this Link Descriptor assigned.
|
Link Class (LNCLAS) | Classification of documents is possible through use of Link Classes (LNCLAS). Each Link Descriptor (LNDESC) may be classified by multiple classes; in the diagram below see how each LNDESC is associated with more than one LNCLAS. A single Link Class may classify multiple Link Descriptors; in the diagram LNCLASI is associated with all three LNDESC.
A Link Class has the following attributes:
There is also a pseudo attribute available named LNKDOC that returns a list of LNDESC elements that are classified by this LNCLAS.
NAME - user-defined name of the LNCLAS element.
DESC - description of the element.
NAME - user-defined name of the LNCLAS element.
NAME - user-defined name of the LNCLAS element.
DESC - description of the element.
DESC - description of the element.
|
Command Window | Link Documents functionality is available through the command line. Standard AVEVA E3D Design command syntax can be used to create, delete or modify database elements and to query and set their attributes including pseudo attributes.
The following sections describe the typical scenarios connected with links including examples.
|
Configuring Links Hierarchy | Before it is possible to link documents to database elements it is necessary to create at least one Link World (LINKWL). You can organize Link Descriptors and Link Classes into a hierarchy of folders. An example hierarchy is shown below.
|
Link a Document to a Database Element | To add a link between an element and a document (or an external resource):
You can also link a document to an element using an existing Link Descriptor, because many database element can be linked to the same document:
The DLADD command can be used to add links from a document to one or more other elements. The command syntax is:
It is possible to create an association both by adding a link from a Link Descriptor to a database element and by adding a link from a database element to a Link Descriptor. Examples are given below.
If current element is a Hull Panel Element (HPAN) named /PANEL1 the following command assigns Link Descriptors /MYDOC1 and /MYDOC2 to /PANEL1:
If current element is a Link Descriptor (LNDESC) named /MYDOC1 the following command assigns this Link Descriptor to /PANEL1 and /PUMP1:
The whole process of linking a document to /PUMP1 might look like this:
>--- DLADD -------*-- <selatt> -----+------>
> DLADD /MYDOC1 /MYDOC2
> DLADD /PANEL1 /PUMP1
> NEW LNDESC /MYDOC
> URL 'http://aveva.com/all_about_vm12_link_documents.pdf'
> DLADD /PUMP1
|
Unlinking a Document from a Database Element | Once there is an association between an element and a Link Descriptor you can break the assignment by using the DLREMOVE command. The command syntax is:
It is possible to remove an association both by removing a link from a Link Descriptor to a database element or by removing a link from a database element to a Link Descriptor. For example:
If current element is a Hull Panel Element (HPAN) named /PANEL1 the following command removes link to document described by /MYDOC1 from /PANEL1:
If current element is a Link Descriptor (LNDESC) named /MYDOC1 the following command removes link to document described by this Link Descriptor to /PUMP1:
The following command removes all Link Descriptor associations from the current element:
The following command removes the first five Link Descriptor associations from the current element:
If the current element is a Link Descriptor you can retrieve or set the URL stored in this descriptor. To link to an external resource you should directly set the URL:
The Link Descriptor has a pseudo attribute LNKREF that returns a database reference if the descriptor links internally to Dabacon. If you set the URL to an external resource LNKREF returns a null reference:
You can use the LNKREF to set link to an internal database reference for example, a drawing:
----------------+
/ |
>--- DLREMove ----*-- <selatt> -----+------>
> DLREM /MYDOC1
> DLREM /PUMP1
> DLREM LINks
> DLREM LIN 1 TO 5
> URL 'file:///Docsys/MyDocument.doc'
> QUERY LNKREF
> LNKREF /DRAWING1
> QUERY LNKREF
Url DBRef / DRAWING1
|
Classify a Link | Each Link Descriptor can have a number of Link Classes assigned. To classify a link:
If current element is a Link Descriptor (LNDESC) named /MYDOC1 the following command classifies this Link Descriptor as a /MYCLASS1 and /MYCLASS2 document:
If current element is a Link Class (LNCLAS) named /MYCLASS1 the following command classifies a Link Descriptor named /MYDOC1 as a /MYCLASS1 document:
> DLADD /MYCLASS1 /MYCLASS2
> DLADD /MYDOC1
|
Unclassify a Link | To remove classification information from a Link Descriptor you can use the DLREMOVE command.
If current element is a Link Descriptor (LNDESC) named /MYDOC1 the following command removes /MYCLASS1 classification from the /MYDOC1 Link Descriptor:
If current element is a Link Class (LNCLAS) named /MYCLASS1 the following command removes /MYCLASS1 classification from the /MYDOC1 Link Descriptor:
The following command removes all Link Descriptor associations from the current Link Class:
The following command removes all classification information from the current Link Descriptor:
> DLREM /MYCLASS1
> DLREM /MYDOC1
> DLREM LINks
> DLREM CLAsses
|
Related Pseudo Attributes | A number of pseudo attributes allow retrieval of information on the relation between Link Descriptors (LNDESC), Link Classes (LNCLAS) and model elements:
|
Links Addin | The Link Addin is a customizable user form which simplifies much of the process of creating links.
The Links Addin uses the notion of link categories to treat different types of links differently.
By default the Links Addin comes with predefined link categories for: E-mail address, Web page, Existing file and Drawing. However, it gives the possibility to extend this set of link types and to create additional categories. For example, one could add a category that would accumulate links to documents or links to FTP resources if needed.
When creating a link the Links Addin gives the possibility to choose a link category and set options for the new link. An example link creation dialog is shown below.
Each link category has a name and an icon. The dialog provides the possibility to input the Name and Description for the link, depending on the type of link being created the form will prompt for an appropriate resource to link to. For example when created a link to a web page you are prompted to enter a valid Address such as http://www.aveva.com.
Clicking OK will open a new window prompting for a container for the new link.
On its first use, the ‘Select destination container’ window will appear empty. This is because a Link World and Link Folder hierarchy has not been created.
As discussed in the section ‘Configuring Link Hierarchy’ at least one Link World should be created.
In the ‘Select destination container’ window right click to create a ‘New world’. A ‘New folder’ must also be created below a world.
Click OK for the link to be created in the database hierarchy.
Once a link has been created it is possible to view the link attributes using the link list sub form, launched from the ‘Show Link’ button from the toolbar. This form displays the element the Link has been assigned to, the Link Name, Category, Description and Link URL.
The Link Addin can be customized through a set of API’s, refer to for further information.
OK
OK
|
Inter-DB Connection Macros | Access to a DB is usually controlled in such a way that only one user can modify the content of that Database (DB) at any one time; that is, only one user can have Write access to the DB. Other users may have simultaneous Read access, depending how access rights have been set up in the Admin module.
In a multi-disciplinary project, in which different teams of users work on different aspects of the design, an individual user will usually have Read/Write access to the DBs controlled by their own team and Read-only access to DBs controlled by other teams. This works well until a user needs to connect an item in their team’s DB to an item in another team’s DB; for example, a member of the Piping team may wish to connect a Branch in a Piping DB to a Nozzle in an Equipment DB (to which they have Read-only access). In such a case, the design changes needed in the Equipment DB are stored in a ‘buffer’ file known as an inter-DB connection macro. Only when this macro is run by a member of the Equipment team, with Write access to the Equipment DB, are the changes implemented.
The sequence of events which would occur is illustrated in the following example.
Assume that Project ABC has separate Piping and Equipment design teams. Assume that User P has Read/Write access to a Piping DB and Read-only access to an Equipment DB, while User E has Read/Write access to the Equipment DB and Read-only access to the Piping DB.
User P wishes to connect a Branch Tail in their Piping DB to a Nozzle in User E’s Equipment DB; that is, they wish to set the Branch’s TREF in their Piping DB to point to the CREF of the Nozzle (which they can do) and to set the CREF of the Nozzle to point to the Tail Reference (TREF) of their Branch (which they can not do), thus:
$M /%ABCMAC%/abc001.mac
DELETE MACRO 1
User P sets the TREF of their Branch to point to the CREF of the Nozzle in the Equipment DB.
When User P tries to set the Nozzle’s CREF, they receive a message telling them that they are trying to connect to a read-only DB and that an inter-DB connection macro is being created automatically. This macro, which stores the commands needed to set the CREF, is given a name with the format abc001.mac (where the macro number, 001 here, is allocated sequentially), and is held in the directory ABCMAC (or as defined by the project’s environmental variables).
When User E next enters MONITOR, they receive a message asking them to run the inter-DB connection macro abc001.mac and to delete it when they have done so.
User E enters MODEL and runs the inter-DB connection macro by giving the command
$M /%ABCMAC%/abc001.mac
This sets the CREF for the Nozzle to point to the TREF of the Branch and completes the link between the two DBs.
User E enters MONITOR (or ADMIN if they have sufficient access rights) and deletes the redundant macro by giving the command
DELETE MACRO 1
where 1 is the macro number. This command is valid in Model, Monitor and Admin.
User P sets the TREF of their Branch to point to the CREF of the Nozzle in the Equipment DB.
User P sets the TREF of their Branch to point to the CREF of the Nozzle in the Equipment DB.
When User P tries to set the Nozzle’s CREF, they receive a message telling them that they are trying to connect to a read-only DB and that an inter-DB connection macro is being created automatically. This macro, which stores the commands needed to set the CREF, is given a name with the format abc001.mac (where the macro number, 001 here, is allocated sequentially), and is held in the directory ABCMAC (or as defined by the project’s environmental variables).
When User P tries to set the Nozzle’s CREF, they receive a message telling them that they are trying to connect to a read-only DB and that an inter-DB connection macro is being created automatically. This macro, which stores the commands needed to set the CREF, is given a name with the format abc001.mac (where the macro number, 001 here, is allocated sequentially), and is held in the directory ABCMAC (or as defined by the project’s environmental variables).
When User E next enters MONITOR, they receive a message asking them to run the inter-DB connection macro abc001.mac and to delete it when they have done so.
When User E next enters MONITOR, they receive a message asking them to run the inter-DB connection macro abc001.mac and to delete it when they have done so.
User E enters MODEL and runs the inter-DB connection macro by giving the command
$M /%ABCMAC%/abc001.mac
This sets the CREF for the Nozzle to point to the TREF of the Branch and completes the link between the two DBs.
User E enters MODEL and runs the inter-DB connection macro by giving the command
User E enters MONITOR (or ADMIN if they have sufficient access rights) and deletes the redundant macro by giving the command
DELETE MACRO 1
where 1 is the macro number. This command is valid in Model, Monitor and Admin.
User E enters MONITOR (or ADMIN if they have sufficient access rights) and deletes the redundant macro by giving the command
Note:
If User P checks their DB for data consistency errors between Stages 2 and 4, when the macro has been created but not yet run, they will get an ‘incompatible connection reference’ message. They cannot finalize their design until User E has run the macro. Thus, the successful use of inter-DB connection macros relies on good co-operation between the teams involved.
Note:
Inter-DB connection macros are also created in multiwrite DBs if an attachment is claimed by another user.
one
Write
Read
inter-DB connection macro
Project ABC
User P
User E
not
abc001.mac
ABCMAC
Note
:
Note
: |
Sequence Number Generator | The Sequence Number Generator is useful to derive unique names in a concurrent application environment. The functionality is based on a set of methods that operates towards a separate overwrite type of database. This is storing the uniquely named sequences and also details about the respective sequence. Name sequence elements and their attributes are protected from being handled manually. One way to operate with name sequences is through PML NameSeq objects.
A unique item in a sequence is made up by the name of the sequence followed by a running number, for example, TEST123, where TEST is the name of the sequence and 123 is the running number.
|
Create a Name Sequence Database | A name sequence database, of the type NSEQ, is created by the Admin utility and selected to an Multiple Database (MDB) as any other ordinary type of database. The options given while creating this type of database is limited as the NSEQ type of the database is predestined to be of an overwrite type.
|
Enable Usage of Name Sequences from PML | import 'aveva.model.nameseq'
using namespace 'aveva.model.nameseq'
aveva.model.nameseq
aveva.model.nameseq |
NameSeq Object | NameSeq(string)
Bool
If not existing, creates a sequence of given name, otherwise brings back the name sequence available.
Next()
String
Get next composed name in sequence.
Remove()
Bool
Delete sequence.
SetStart(real)
Bool
Set first running number of sequence (default 0).
SetMax(real)
Bool
Set last running number of sequence.
SetStep(real)
Bool
Set increment (default 1).
SetWraparound()
Bool
Allow wraparound when maximum value is reached.
SetNoWraparound()
Bool
Disallow wraparound (error returned when maximum is reached).
GetMax()
Real
Get last running number of sequence (default 2147483647).
GetStep()
Real
Get increment.
GetCurrent()
Real
Get current running number.
GetName()
String
Get name of sequence.
IsWraparound()
Bool
Get wraparound status.
ReStart
Bool
Restarts a sequence from its first running number.
GetStart
Real
Get first running number
Name
Result
Description
NameSeq(string)
Bool
If not existing, creates a sequence of given name, otherwise brings back the name sequence available.
Next()
String
Get next composed name in sequence.
Remove()
Bool
Delete sequence.
SetStart(real)
Bool
Set first running number of sequence (default 0).
SetMax(real)
Bool
Set last running number of sequence.
SetStep(real)
Bool
Set increment (default 1).
SetWraparound()
Bool
Allow wraparound when maximum value is reached.
SetNoWraparound()
Bool
Disallow wraparound (error returned when maximum is reached).
GetMax()
Real
Get last running number of sequence (default 2147483647).
GetStep()
Real
Get increment.
GetCurrent()
Real
Get current running number.
GetName()
String
Get name of sequence.
IsWraparound()
Bool
Get wraparound status.
ReStart
Bool
Restarts a sequence from its first running number.
GetStart
Real
Get first running number
|
Typical Usage of Name Sequences | Following is an example showing how to define a sequence named TEST and let the sequence start from 1000. The method Next increments the running number and returns a name composed by the name of the sequence followed by the running number, for example,. TEST1001, TEST1002. Whenever needed it is possible to make a break-in in the sequence and change for example the increment to e.g. 20 instead of 1 as default. This will then generate composed names as TEST1022, TEST1042.
Next |
Name Sequences in Global Projects | Name sequence databases are local for each site and are not replicated among the different sites. However names generated by the name sequence mechanism can be used for naming of items included in the Global synchronisation. To maintain unique naming of items in a Global environment, the setup of name sequences must be considered. A proper method is to let each site have different starting numbers of their name sequences, for example,. SetStart() to a number different for each site.
|
Distributed Attributes | New functionality feature called Distributed attributes has been introduced to the database system. The fundamental concept of distributed attributes is about enabling objects to have groups of attributes distributed across hierarchies and potentially databases. As a result, a number of improvements can be used in the database system.
Improved Concurrency
Possibility to Distribute an Objects Attributes across Hierarchies and Databases
Simplified Access Control
Data Inclusion/Exclusion
User Extendibility on New and Existing Data
Automatic Attribute Management
Users may work on different sets of data of an object in parallel.
Support simultaneous multi-discipline update on same object.
Claim granularity, only claim relevant portions of an object.
Users may work on different sets of data of an object in parallel.
Users may work on different sets of data of an object in parallel.
Support simultaneous multi-discipline update on same object.
Support simultaneous multi-discipline update on same object.
Claim granularity, only claim relevant portions of an object.
Claim granularity, only claim relevant portions of an object.
Easy distribution over Global dividing distributed attribute over different primary locations.
Easy distribution over Global dividing distributed attribute over different primary locations.
Easy distribution over Global dividing distributed attribute over different primary locations.
Team owning databases provides both read/write and read-only levels of access within the same object.
Team owning databases provides both read/write and read-only levels of access within the same object.
Team owning databases provides both read/write and read-only levels of access within the same object.
Possible to hide select portions of an object.
Possible to hide select portions of an object.
Possible to hide select portions of an object.
In cases where it is hard to define User Defined Element Types (UDETs) this is an alternative way to extend existing objects with distributed attribute data.
In cases where it is hard to define User Defined Element Types (UDETs) this is an alternative way to extend existing objects with distributed attribute data.
In cases where it is hard to define User Defined Element Types (UDETs) this is an alternative way to extend existing objects with distributed attribute data.
The management (create/delete/referencing) of the distributed attributes.
While the concept itself is rather straightforward, it introduces new possibilities to applications.
An pictoral representation of how the concept might be used in an application, follows:
The management (create/delete/referencing) of the distributed attributes.
The management (create/delete/referencing) of the distributed attributes.
While the concept itself is rather straightforward, it introduces new possibilities to applications.
While the concept itself is rather straightforward, it introduces new possibilities to applications.
An pictoral representation of how the concept might be used in an application, follows:
An pictoral representation of how the concept might be used in an application, follows:
Improved Concurrency
Possibility to Distribute an Objects Attributes across Hierarchies and Databases
Simplified Access Control
Data Inclusion/Exclusion
User Extendibility on New and Existing Data
Automatic Attribute Management |
Terminology and Data | Distributed attributes are built on top of the well established functions and concepts of AVEVA E3D Design technology. The functionality of distributed attributes User Defined Attributes (UDAs) and User Defined Element Type (UDETs) behave as an integral part of the system.
A distributed attribute group is a UDET based on the XPITEM element type. The UDET itself works like any other UDET and may carry any number of attributes, whereas UDAs, which are defined by you.
An pictoral representation of how the components relate to each other is displayed below:
Term
Description
Binding element
The owner of distributed attributes groups.
Distributed element / attribute group
The container for distributed attributes these can be thought of as attribute groups. The distributed element is always a UDET based on the XPITEM element type.
Distributed attribute
The attributes, UDAs that a defined for an attribute group.
Default home
The location where the distributed elements are stored and managed.
Binding element
The owner of distributed attributes groups.
Distributed element / attribute group
The container for distributed attributes these can be thought of as attribute groups. The distributed element is always a UDET based on the XPITEM element type.
Distributed attribute
The attributes, UDAs that a defined for an attribute group.
Default home
The location where the distributed elements are stored and managed.
All definitions of Distributed Attributes are stored in dictionary databases and maintained by the Lexicon module.
Term
Description
Binding element
The owner of distributed attributes groups.
Distributed element / attribute group
The container for distributed attributes these can be thought of as attribute groups. The distributed element is always a UDET based on the XPITEM element type.
Distributed attribute
The attributes, UDAs that a defined for an attribute group.
Default home
The location where the distributed elements are stored and managed.
UDA
UDET
UDET
XPITEM
UDET
UDET
UDA
Binding element
Distributed element / attribute group
Distributed attribute
Default home |
Configuration | Distributed attributes are made up of User Defined Element Type (UDETs) which are associated with the binding element that they add attributes to. To configure distributed attributes:
Create UDETs to be used as distributed attribute groups.
Create the attributes to be included in the attribute groups.
Create distributed attribute schema associating elements with the distributed attribute group.
Create the default home definition the location where distributed attributes are to be created and managed.
Create actual default home top level elements where distributed attribute groups are created.
Create UDETs to be used as distributed attribute groups.
Create UDETs to be used as distributed attribute groups.
Create the attributes to be included in the attribute groups.
Create the attributes to be included in the attribute groups.
Create distributed attribute schema associating elements with the distributed attribute group.
Create distributed attribute schema associating elements with the distributed attribute group.
Create the default home definition the location where distributed attributes are to be created and managed.
Create the default home definition the location where distributed attributes are to be created and managed.
Create actual default home top level elements where distributed attribute groups are created.
Create actual default home top level elements where distributed attribute groups are created.
|
Create Distributed Attribute Group, the UDET | The task only differ from creating a regular User Defined Element Type (UDET) in one aspect, and that is that the UDET intended for use as a distributed attribute group must be based on the XPITEM element type.
You must create the UDETs to be used as distributed attribute groups, these UDETs needs to be defined with XPITEM as their basetype, then the attributes must be created.
|
Create the Attributes, as UDAs | The attributes can be defined as any regular User Defined Attribute (UDA), no special considerations need to be taken.
For example: the UDAs, to be included in the attribute groups.
|
Create Distributed Attributes Schema | The distributed attribute schema, associating elements with the distributed attribute group must then be created.
There are two administrative levels, Distributed Attribute Definition World (DSXWLD) and Distributed Attribute Group (DSXGRP) that is left without any specific explanation. They serve the same purpose of grouping things, that is schemas, UDAs together. Distributed attributes schemas are configured using the Distributed Attribute Schema (DSXSCH), Distributed Attribute Owner (DSXOWN) and Distributed Attribute Member (DSXMBR) objects in the lexicon application.
A distributed attribute schema is represented by the DSXSCH element, and consists of a name and an optional default home reference. The default home reference may be overridden at lower levels in the schema. At present, all schemas are treated as one unified schema; this functionality is subject to change.
You can define the element types that may be extended by distributed attributes. The definition contains an Element List (ELEL) which designates the element types. It also contains a default home reference that, if set override default home defined on schema level.
The last part of the distributed attributes schema definition is to associate the UDETs that form the distributed attributes for the owning elements specified in DSXOWN. The definition specifies which XPITEM based UDETs that can be used as distributed attributes for the specified owner. There is a cardinality definition available that defines the minimum and maximum number of each of the distributed attributes that may be created. A -1 in the maximum definition represents an infinite number. It also contains an allocation reference that might override anything defined at schema or owner level.
|
Default Home Definition | The location where distributed attributes are created and managed must now be defined, create the default and home definition.
Default home definition is a structure that is used by distributed attributes to figure out where to create and store the distributed part of the attributes. The DEFHOM ("Allocate" in the GUI) reference points to the allocation rule to use.
Each Default home definition is represented by a Distributed Attribute Default Home (DSXHOM) element the element must be referenced from distributed attributes, for example: Distributed Attribute Schema (DSXSCH) (where to store elements).
You must then create the actual default home. For example: create the top-level elements where the distributed attribute groups are created.
The default home destination contains a string or ID expression that evaluates the name or ID of the default home to be used. When used together with distributed attributes, the name must result in a XPIWLD element. The destination definition also evaluates a logical test that must yield true in order for it to be used.
Enables more elaborate tests, logical expressions can be defined and inserted between the Distributed Attribute Default Home (DSXHOM) and the final destination.
Note:
That the tests on the logical expressions has not yet implemented.
Note
:
Default Home |
Create the XPIWLD Home Elements | For each unique destination Distributed Attribute Destination (DSXDST) defined, the corresponding actual XPIWLD home‑element must be created. For example:
NEW XPIWLD /MyLineLists
XPIWLD |
Distributed Attributes, Configuration and Usage Details | The information that defines the available distributed attributes is defined in two separate hierarchies:
the structure of the attributes
where to physically create and store the data.
the structure of the attributes
the structure of the attributes
where to physically create and store the data.
where to physically create and store the data.
|
Distributed Attributes and Default Home Configuration | The distributed attributes definition is created in the Lexicon module and stored in a Dictionary (DICT) database. The detail information of each attribute relies on the existing definitions of User Defined Attributes (UDAs) and User Defined Element Type (UDETs). The definition of distributed attributes is to define what type of attribute groups (for example: UDETs) are allowed as distributed attributes to which element types, and their cardinality (further constrains definitions may follow).
|
DSX Hierarchy, Top Elements | The hierarchy where this information is stored is organized the following way:
The common DSX data structure that contains both distributed attributes and default home definition.
The Distributed Attribute Definition World (DSXWLD) is the top level element for storing distributed attribute schemas and default home selectors. It does not contain any attributes of particular interest to distributed attributes configuration. It can have Distributed Attribute Group (DSXGRP) as members.
NAME
Text
Standard
DESC
Text
Standard
The DSXGRP is a purely administrative level that aids in organizing distributed attribute schemas and default home selectors. It does not contain any attributes of particular interest to distributed attributes configuration. The DSXGRP element may have DSXSCH and DSXHOM members.
NAME
Text
Standard
DESC
Text
Standard
Attribute Name
Type
Usage
NAME
Text
Standard
DESC
Text
Standard
Attribute Name
Type
Usage
NAME
Text
Standard
DESC
Text
Standard
DSXWLD
DSXGRP
DSXGRP
DSXGRP
DSXSCH
DSXHOM |
Distributed Attributes Schema | A distributed attribute schema is headed with a Distributed Attribute Schema (DSXSCH) element. Currently there is no particular support or use of multiple schemas but to organize distributed attributes in groups of definitions.
The DSXSCH defines a distributed attribute schema the vital attribute is the Default Home (DEFHOM) that may contain a reference to a schema default Distributed Attribute Default Home (DSXHOM) element. The DSXSCH element can have DSXOWN as members.
NAME
Text
Standard
DESC
Text
Standard
DEFHOM
Ref to DSXHOM
Identifies the default home selector for this schema
The Distributed Attribute Owner (DSXOWN) defines the element types that may have the defined set of distributed attributes. One DSXOWN may define one or more element types as defined by the Element List (ELEL) attribute. It also contains an optional reference to a binder default DSXHOM element, that DSXHOM overrides any DSXHOM definition on the DSXSCH level. The DSXOWN element can have Distributed Attribute Member (DSXMBR) as members.
NAME
Text
Standard
DESC
Text
Standard
DEFHOM
Reference to DSXHOM
Identifies the default home selector for the binder. Overrides any definition on schema level.
ELEL
Element types list
Defines the element types that may have distributed attribute types bound to them
The DSXMBR defines the element types to be used as distributed attributes. One DSXMBR may define one or more element types as defined by the ELEL attribute. The element types must be User Defined Element Types (UDETs) based on the XPITEM element type. It also contains an optional reference to a distributed attribute default home DSXHOM element, that DSXHOM overrides any definition on the DSXOWN level.
NAME
Text
Standard
DESC
Text
Standard
DEFHOM
Reference to DSXHOM
Identifies the default home selector for the distributed element types defined in this definition
AUTCRE
Logical
Auto-create. The distributed element is automatically created if it doesn't exist at a modification operation.
ELEL
Element types list
Defines the element types that represents the distributed attribute types
CARD
Integer array [2]
Min and Max cardinality of the distributed attributes. (Note, only the Max Cardinality is currently effective)
Attribute Name
Type
Usage
NAME
Text
Standard
DESC
Text
Standard
DEFHOM
Ref to DSXHOM
Identifies the default home selector for this schema
Attribute Name
Type
Usage
NAME
Text
Standard
DESC
Text
Standard
DEFHOM
Reference to DSXHOM
Identifies the default home selector for the binder. Overrides any definition on schema level.
ELEL
Element types list
Defines the element types that may have distributed attribute types bound to them
Attribute Name
Type
Usage
NAME
Text
Standard
DESC
Text
Standard
DEFHOM
Reference to DSXHOM
Identifies the default home selector for the distributed element types defined in this definition
AUTCRE
Logical
Auto-create. The distributed element is automatically created if it doesn't exist at a modification operation.
ELEL
Element types list
Defines the element types that represents the distributed attribute types
CARD
Integer array [2]
Min and Max cardinality of the distributed attributes. (Note, only the Max Cardinality is currently effective)
DSXSCH
DSXSCH
DEFHOM
DSXHOM
DSXSCH
DSXOWN
DSXOWN
DSXOWN
ELEL)
DSXHOM
DSXHOM
DSXHOM
DSXSCH
DSXOWN
DSXMBR
DSXMBR
DSXMBR
ELEL
XPITEM
DSXHOM
DSXHOM
DSXOWN |
Default Home Selector | The default home is defined by a Distributed Attribute Default Home (DSXHOM) hierarchy, it is expected that a number of default home definitions are in use for distributed attributes.
The DSXHOM defines a default home selector, it contains no information vital to the Default home configuration and may have Distributed Attribute Test (DSXTST) and Distributed Attribute Destination (DSXDST) members.
NAME
Text
Standard
DESC
Text
Standard
The DSXTST defines a test that needs to yield true upon evaluation for considering using this default home, it contains a test expression defined in PML1. The expression operates on the current binding element.
NAME
Text
Standard
DESC
Text
Standard
DHTEST
PML1 expression
The test to evaluate to examine if this represents the requested default home.
The DSXDST denotes the default home value as a text string. It also contains a test that needs to yield true upon evaluation for considering this default home being valid.
NAME
Text
Standard
DESC
Text
Standard
DHTEST
PML1 expression
The test to evaluate to examine if this represents the requested default home.
DHTEXT
PML1 expression
An expression of string or ID type that should evaluate to an existing element at runtime. (For distributed attributes, this must resolve to a XPIWLD element).
Attribute Name
Type
Usage
NAME
Text
Standard
DESC
Text
Standard
Attribute Name
Type
Usage
NAME
Text
Standard
DESC
Text
Standard
DHTEST
PML1 expression
The test to evaluate to examine if this represents the requested default home.
Attribute Name
Type
Usage
NAME
Text
Standard
DESC
Text
Standard
DHTEST
PML1 expression
The test to evaluate to examine if this represents the requested default home.
DHTEXT
PML1 expression
An expression of string or ID type that should evaluate to an existing element at runtime. (For distributed attributes, this must resolve to a XPIWLD element).
DSXHOM
DSXHOM
DSXTST
DSXDST
DSXTST |
New Syntaxes | There are new syntaxes available to work with distributed attributes.
The creation/deletion of the distributed attributes member(s)
The manipulating of the individual values on the distributed attributes members.
The creation/deletion of the distributed attributes member(s)
The creation/deletion of the distributed attributes member(s)
The manipulating of the individual values on the distributed attributes members.
The manipulating of the individual values on the distributed attributes members.
|
New and Updated Syntax | There are also a small number of pseudo attributes available on elements that are associated with distributed attributes.
The NEW command creates a new distributed attribute and associates the CE/on element with it.
The example creates a new distributed attribute of type :PRESSURE and associates it with Current Element (CE).
DATT NEW
DATT NEW <type> [on <element>]
DATT NEW :PRESSURE
Syntax
Example |
DATT DELete | The DELete command removes distributed attributes from Current Element (CE)/from element
The example deletes the last distributed attribute member of type :PROCESS from /MyEquipment.
DATT DELete ALL [<type>] [from < element>]
DATT DELete [FIRST | LAST | <int>] <type> [from < element>]
DATT DEL LAST :PROCESS FROM /MyEquipment
Syntax
FIRST
Example |
Q ATT | The existing Q ATT have been extended to allow for querying distributed attributes.
The command displays all the values of the :PROCESS type associated with Current Element (CE).
Q ATT [AS ANY | <type>]
Q ATT AS :PROCESS
Syntax
Example |
Distributed Attributes and Attribute Syntax | Since more than one instance of a distributed element is handled [n] is used to qualify which instance you are interested in.
The syntax is used on both queries and manipulations of attributes, as well as in PML1 expressions.
-- Query the value of the :local\:process distributed attribute on Current Element (CE)
-- Set the value of distributed attribute :local\:process to false
-- Query all LNLIST elements where distributed attribute :local\:process equals true
-- Query the value of the second instance of distributed attribute :local\:process
-- Set the value of the second instance of distributed attribute :local\:process to false
-- Query all LNLIST elements where second instance of distributed attribute :local\:process equals true
:UDANAME\:UDETNAME
Q :LOCAL\:PROCESS
:local\process true
:LOCAL\:PROCESS false
Q ALL LNLIST WITH (:LOCAL\PROCESS EQ true)
Q :LOCAL\:PROCESS[2]
:local\process[2] true
:LOCAL\:PROCESS[2] false
Q ALL LNLIST WITH (:LOCAL\PROCESS[2] EQ true)
Syntax
Example |
PML2 Support | There is full PML2 support for distributed attributes. Constructs such as; !!ce.:local\:process = false works as could be expected. Also more complex things involving both arrays and multiple instances of distributed attributes work with the syntax that would be expected.
-- Set the third array element in the second instance of distributed attribute :myArray\:MyList to 12.345
!!ce.:myArray[3]\:myList[2] = 12.345
!!ce.:local\:process = false
Example
:myArray\:MyList to 12.345 |
Pseudo Attributes Associated with Distributed Attributes | There are a few number of pseudo attributes available to all elements that may have distributed attributes associated with them.
|
DLIST - Eligible Distributed Attributes Members | The attribute returns a list of all eligible distributed attribute types that may be associated with Current Element (CE). The list does not consider any constraints defined in the schema.
Q DLIST
DLIST :PROCESS :PRESSURE
Example |
XRLSTT - List Distributed Attributes Member Types Associated | This attribute returns a list of all distributed attribute types associated with current element.
Q XRLSTT
XRLSTT :PROCESS :PRESSURE
Example |
XRLIST - List Distributed Attributes Member Associated | The attribute returns a list of all distributed attribute members (elements) associated with current element. The attribute may take an optional qualifier on typename.
Q XRLIST
XRLIST
Q XRLIST (TYPENAME :PROCESS )
Example
Q XRLIST
Q XRLIST (TYPENAME :PROCESS ) |
XRQCNT - Count of Distributed Attributes Member Associated | The attribute returns the number of distributed attribute members (elements) associated with current element. The attribute may take an optional qualifier on typename.
Q XRQCNT
XRQCNT 2
Q XRQCNT (TYPENAME :PROCESS )
XRQCNT 1
Example
Q XRQCNT
Q XRQCNT (TYPENAME :PROCESS ) |