• No results found

Setting Attributes

2 Database Navigation and Query Syntax

3.6 Setting Attributes

3.6.1 Standard Syntax

Attribute values can be set in two ways:

1. By assigning a value via a PML variable e.g. !!CE.XLEN = 99

Note: There must be a space between the ‘=’ and a digit. “!!CE.XLEN =99” would not be valid.

2. Use the attribute name to assign a value to the CE e.g. XLEN 99 The following general rules must be followed:

• The value assigned must be the correct type for the attribute type (see examples below)

• PML variables can not be directly used if using method (2). The PML variable must be expanded using the late evaluation syntax, i.e. ‘XLEN !A’ is invalid but ‘XLEN $!A’ is OK. This also applies to any PML variables within expressions.

The behaviour for each attribute type is described below:

FLNM STRING(700) Full name of the element

FLNN STRING(700) Full name of the element (without leading slash)

ISNAMED BOOL True if element is named

NAMESQ STRING(700) Type. sequence number and name of element NAMETY STRING(700) Type and name of the element

NAMN STRING(500) Name of the element (without leading slash) NAMTYP STRING(700) Type and full name of element

Attribute Name

Data Type Qualifier Description

ACTTYPE WORD Type of element, truncating non UDETs to 4 or 6 characters

AHLIS WORD(200) List of actual types in owning hierarchy OSTYPE WORD Short cut for "Type of owner"

TYPE WORD Type of the element, ignoring UDET, truncated

to 4 or 6 characters Attribute

Name

Data Type Qualifier Description

REAL attribute - allows an int, real or real expression

INTEGER attribute - allows an int, a real or real expression. The result will be rounded to the nearest integer.

e.g.

!!CE.AREA = 99.6

Q AREA – will now return 100

TEXT attribute - allows a text value, a text expression, or UNSET. Assigning UNSET will result in a zero length string.

e.g.

!A = ‘Some text ‘

!!CE.DESC = ‘My description’

!!CE.DESC = (!A + ‘extra text’) DESC UNSET

LOGICAL attribute - allows FALSE, TRUE or logical expression.

e.g.

REF attribute - allows a name, refno , ID expression, or UNSET, NULREF keywords. The UNSET and NULREF keywords both result in a null reference (=0/0) being assigned.

CREF =123/456 CREF /MYBRAN CREF UNSET CREF NULREF

!!CE.CREF (FIRST MEMBER OF /PIPE1 )

Note: There must be a space between the name and the ‘)’

WORD attribute - If assigning to a PML variable, then allows a text value or text expression.

e.g.

!A = ‘FLG’

!!CE.TCON = !A + ‘D’

If assigning via the attribute name, then it must be a word.

e.g. TCON FLGD

POSITION attribute - allows a position or position expression.

HPOS N 100 U 100

!!CE.POS = (N 100 from /MYEQUIP ) AT N 100 from /MYEQUIP

Note: The POS attribute can not be set by name, use AT syntax instead.

Do not use brackets if setting by attribute name.

DIRECTION attribute - Allows a direction or direction expression HDIR N 45 U

HDIR TOWARDS /MYEQUIP

!!CE.HDIR = (TOWARDS /MYEQUIP )

Note: Do not use brackets if setting by attribute name.

ORIENTATION attribute - Allows an orientation or an orientation expression ORI N IS U

!!CE.ORI = (N IS E WRT /VESS1 )

Note: Do not use brackets if setting by attribute name.

3.6.2 Setting a UDA Back to a Default

A UDA may be set back to it’s default by using the DEFAULT keyword.

e.g. :MYUDA DEFAULT

3.6.3 Setting an Array

If assigning via a PML variable, an array attribute must be assigned from a PML array object.

e.g. !!CE.DESP = !MYARRAY

If assigning via the attribute name, then a list of values must be given.

e.g. DESP 1 2 3 4 5

3.6.4 Single Value of an Array

If assigning via a PML variable, an index number may be specified in square brackets.

e.g. !!CE.DESP[2] = 99

If assigning via the attribute name, a single value of an array may be set using the NUMB keyword. The NUMB keyword follows the attribute name, and is followed by the index number.

e.g. DESP NUMB 2 99

This sets the 2nd value of the array to 99.

The NUMB command actually specifies the start point for a list of values.

e.g. DESP NUM 3 99 100 101

This would set the 3rd value to 99, the 4th to 100 and the 5th to 101.

The new values may go off the end of the existing array, but the start point must not be more than one beyond the existing end point.

e.g.

DESP 1 2 3 - set up initial values DESP NUMB 4 99 - OK, as at end

DESP NUMB 6 100 - Error, as would leave a gap

3.6.5 Special Syntax for Names

Naming Design Elements

All elements except the WORLD can be named. Although Design elements are often given suitable names while being created, later name changes can be made by giving a new name or by removing the old name. The name of any element must be unique; that is, not already used for another currently accessible element.

Command Syntax:

>-- NAMe --+-- ALL name name --.

| |

‘-- name ---+-->

>-- UNName -->

Renaming Elements and Their Offspring

The name of the current element and offspring can be modified where a standard name part occurs.

Command Syntax:

>-- REName --+-- ALL name name --.

| |

‘-- name ---+-->

Examples:

NAME /ZONE5D

The current element is given the specified name provided it has not been used elsewhere.

UNN

The current element loses its name (it is still identifiable by its automatically allocated reference number).

Example:

REN ALL /Z1 /Z2

All occurrences of /Z1 in the names of the current element and its offspring will be changed to /Z2.

3.6.6 Special Syntax for LOCK

Locking Elements Against Alteration and Deletion

Locking a design element prevents it from being modified or deleted. The LOCK command allows either a single element to be controlled, or all its offspring too. (A complete Site can be locked if required.) This provides you with personal security control over your area of work. (General security restrictions affecting the whole Project are established in the ADMINISTRATION module of PDMS.)

Command Syntax:

>--+-- LOCK ----.

| |

‘-- UNLOck --+-- ALL --.

| |

‘---+-- <snoun> --.

| |

‘---+-->

3.6.7 Related Pseudo Attributes

Examples:

LOCK ALL

The current element and all its offspring are locked.

UNLOCK

The current element is unlocked.

Attribute Name

Data Type Qualifier Description

DACMOD BOOL ATTR True if DAC allows attribute of element to be modified

MODATT BOOL ATTR True if attribute of element can be modified MODERR STRING(120) ATTR Returns the error text that would occur if

attribute was modified

Related documents