Monday, May 14, 2012

PDMS Syntax



In principle, any attribute can be set by specifying the attribute name and value you want it to take. The following are examples:

XLEN  200
HEIGHT  300
NAME  /FRED
ORI  Y  IS  N
DESC  'PLATE  GIRDER'
TEMP  120
PURP  EQUI
ORI  Y  IS  N  AND  Z  IS  U

 
Navigation
Commands for moving around the PDMS database.
/NAME
Move to an element by name
=23/506
Move to an element by its reference number
END
Move up the database hierarchy by 1 level
6
Move to the sixth element in the list of the current element
NEXT
Move to the next element in the list at the same level
NEXT 2
Move to the second element after the current element
NEXT ELBO
Move to the next elbo in the current list by passing any other elements
PREV
Move to the previous element in the list
PREV 4
Move four elements back from ce
SAME
Go to the previous current element
 
NOTE: NEXT and PREV commands work on the list according to the modes Forwards or Backwards. In backwards mode, the list is considered to be reversed so these commands have the effect of working from the opposite end of the list.
 
Query Commands
Q ATT
Query all the attributes of the current element
Q POS
Query the position of the current element
Q POS IN SITE (or Q POS WRT SITE)
Query the position of the current element relative to the site position
NOTE: Normally, the Q POS command gives the position relative to the element's owner.
Q NAME
Query the name of the current element. This may either begin with '/' character '/PIPING' or may be by a list position name (full name) such as:
ELBO 2 OF /P1/B1
Q REF
Query the database unique reference number i.e. = 234/702. This is the best way of ensuring that you get to the element you want. Names can change but reference numbers are fixed so you always get the same element.


 Positioning Commands (General)
At E300 N400 U500
Position an element explicitly at the coordinates given relative to the element's owner. To position relative to some other element, wrt can be added, as shown
At E3333 N6000 U50 WRT SITE
At N500W30U600 WRT WORLD
AT N400 U500 E300 IN ZONE                                                           
At N40 WRT /FRED
BY N500
Move the element north from it's current position by 500mm (This is relative movement.)
CONN P1 TO P2 OF PREV
Positions P1 at the specified point and orientates the element such that P1 is pointing in the opposite direction to the specified ppoint.
CONN IDP@ TO IDP@
Connect a picked Ppoint on the current primitive to a picked Ppoint of another
CONN P1 TO IDP@
Connect P1 of the current primitive to a picked Point of another primitive
 Move syntax
Position>Move>Distance
Moves the element’s origin by a given distance in a given direction.

Ex.       MOVE N DIST 10’                  MOVE S WRT /* DIST 5'                   MOVE E IN SITE DIST 5'

Position>Move>Through
Moves the origin of the element in a given direction through a Reference Plane perpendicular to the line of travel that is passing through a picked element, p-point, or coordinate.

Ex.       MOVE N THRO ID@ MOVE N THRO IDP@          MOVE N THRO N46’

Position>Move>Clearance
Moves the element’s origin, p-point, or obstruction in a given direction with a clearance from another item’s origin, p-point, or obstruction
.
Ex.  MOVE E DIST 10’ FROM /P-101                    MOVE E CLEARANCE 10’ FROM /P-101

The options INFRONT, BEHIND, ONTO, and UNDER refer to a picked or named item’s physical obstruction, while the TO and FROM options refer to the item’s origin.  INFRONT and TO refer to the near side while BEHIND and FROM refer to the far side of an item.

Position>Plane Move>Through
Moves the origin of the element in a given direction through a Reference Plane specified by the user that is passing through a picked element, p-point, or coordinate.

Ex.       MOVE ALONG E PLANE N45W THRO ID@

Positioning Commands (Piping)
NOTE: All the above commands can be used with piping components for exact positioning. The following commands are specific to piping because they use the implied direction of the previous component to determine the position. This implied direction is some times referred to as the constrained centreline and is simply a line drawn in the direction of the previous component. All of the following commands will move components along this line.
DIST 300
Position the current element 300mm away from the previous component. The direction is taken as the leave direction of the previous component.
CLEAR 400
Position the current element with a clearance of 400m between it and the previous element. For most types of component, this command gives a tube spool length equal to the clearance value. For some components such as level operated valves the clearance is likely to take the lever length as the obstruction length of the valve, so in this case the clearance might be more unpredictable.
THRO N500
TO N500
Position the origin of the CE along constrained centerline through N500 in ZONE coordinates.
THRO PT
Position the origin of the CE along constrained centerline at the point where it intersects a perpendicular plane positioned at  the branch tail.
CONNect
Position the arrive point at the leave point of the previous component and orientate the component to suit.

 
Orientation Commands (General)
ORI Y IS N AND Z IS U
This is the default orientation (wrt owner) for all elements that have an orientation attribute.
ORI Y IS E45N
Specify that the Y axis is pointing E45N. When only one axis is specified, the other tries to get to it's default, so in this case, Z will default to UP.
ORI P1 IS N
Rather than specifying an axis, this command specifies that a particular ppoint is to be orientated in the direction specified.

 
Orientation Commands (Piping)
ORI
This command orientates the arrive of the element in the opposite direction to the leave of the previous element. It does not change the position.
CONNECT
Perform an ORI, then position the arrive at the leave of previous.
DIR S
This is a special command which is allowed to change the angle of a component. It first performs an ori, then adjusts the angle to ensure that the leave direction is in the direction specified.
ORI AND P3 IS U
Used for valves, tees, etc., this command performs an ori and then points the ppoint in the required direction. It does not change the angle.
DIR AND P3 IS U
This is another special command which is only used on tees with variable angles. (Usually for sloping lines.) In this case, the tee is orientated and the angle adjusted to allow p3 to point in the direction specified.

 
Creating Elements
NEW  BOX
To create anything in PDMS, you need to be at the right level in the hierarchy and use the command NEW followed by the TYPE of element you want to create.
NEW  EQUI  /T-1101
Create EQUI element and set the name attribute
NEW ELBO CHOOSE
For piping components, you need to create the element and then link it to the catalogue via the spref attribute. The CHOOSE command allows you to select components from the specification by picking them from a displayed menu.
CHOOSE ALL
Allows you to see more detail about the component than CHOOSE on it's own.
 
Deleting Elements
DELETE ELBO
To delete an element, the syntax is DELETE followed by the TYPE of element you are deleting.
DELETE BRAN MEM
This deletes the members of an element (i.e. BRAN in this example) without deleting the element itself.
 
PSEUDO ATTRIBUTES
  In order to get specific information directly from the database, a number of keyword or pseudo attributes have been introduced. Pseudo attributes are not attributes as such, but they have the ability to extract data when queried. For Example
ELBO 1
Go to elbo 1 of the branch
Q PARAM
Query the parameters of the catref of the spref
Q DTXR
Query the rtext of the detref of the spref_ can also use dtxs or dtxt
Q MTXX
Query the xtext of the matref of the spref _ can also use mtxy or mtxz
Q PSATTS
Query the list of pseudo attributes available for the CE.
 
A few useful pseudo attributes appear below:
  General Queries
Q LIST
Query what you can create below the current element
Q OLIST
Query the type of elements which can own CE
Q ORDER
Query the list position
Q PROP DESC
Query the data element with the dkey equal to DESC in the component's dataset (Steelwork and Piping elements)
Q PRLS
Query the list of properties in the component's dataset
Q PURP XXX
Query the purpose attribute of the property XXX
  Piping Attributes
Q CHOICE
Query the answers of the selectors of the spref
Q CHOICE STYP
Query the styp used to select the component
Q PL BOP
Query the bottom of pipe elevation of the leave point
Q PA INSU
Query the insulation thickness at the arrive point
Q PGRAD 1
Query the slope at ppoint 1
Q ITLE
Query the length of implied tube (must navigate first by using 'IL TUBE' at a component)
Q LBOR
Query the leave bore
Q ABOR
Query the arrive bore
Q APOS
Query the arrive position
Q LPOS
Query the leave position
At Branch Level
Q TULEN
Query the length of tube in a branch
Q CLLEN
Query the centerline length through all components
  Steelwork 
Q ODESP
Query the design params of the joint owner
Q ADESP
Query the design params of the joint attached beam
Q DRPS
Query the derived position of the beam start
Q NWEI
Query the net weight (considering joint cut outs)
Q GWEI
Query the gross weight (beam before cutting)
Q NCOF
Query the net centre of gravity for the beam
Q NSRF
Query the net surface area
Q MIDP
Query the mid point
Q POS PPLINE TOS START WRT /*
Query TOS of current element (SCTN)
Q PPLINE TOS DIR
Query the direction of the TOS pline on a SCTN
 
The Construct Syntax
The construct syntax is described more fully in the Design reference manual and it is worth looking at it in more detail. CONST allows distances and angles to be calculated from the design data and is invaluable when you are writing applications. For example
Q CONST ANGLE N AND W
gives 90°
CONST A PIN1 TO PIN2 TO PIN3

Q CONST DIST FROM P1 to P2 TO P2 OF/BOX1
gives a distance
CONST DIST FROM PA TO PL OF PREV

  $S  QA=Q  ATT                   Create a synonym to query attributes
Q  EVAR  PDMSUSER        Query the operating system location of user file directory PDMSUSER
Reporting Syntax
You can create an array which includes a number of elements which all satisfy specific selection criteria, as defined by yourself. The syntax is:
VAR !Array COLLECT selection criteria
!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:
  • A class of elements or element types
  • A logical expression to be satisfied at all selected elements
  • A physical volume in whichall selected elements must lie
  • A point in the hierarchy below which all selected elements must lie
Eg VAR !PIPECOMPS COLLECT ALL BRANCH MEMBERS
This would create the array !PIPECOMPS and set it to contain the reference numbers of every piping component in the MDB. Logical expressions use the WITH and WHERE option; a volume is defined by the WITHIN keyword; and the hierarchy criteria is defined by the FOR keyword.
Eg VAR !ELBO COLL ALL ELBO WITH SPREF EQ /A300B/100
Evaluating Selected DB Elements
Using the facilities described here you can create an expression and have it evaluated for all elements which satisfy particular selection criteria. The results of the expression are then placed in a named array.
The command syntax is:
VAR !Array EVALUATE (Expression) FOR Select
!Array is the name of the array that will be created
(expression) is the expression that will be carried out for all elements that match the select criteria
Select is the selection criteria
Eg VAR !BOXES EVALUATE ( XLEN * YLEN ) FOR ALL BOXES
 
IF ALL ELSE FAILS!
 
As you can see, there are a lot of commands available to the PDMS user and the list above is only scratching the surface. Almost all of the command syntax is described in the reference manuals but in some cases you might find it difficult to compose the required command from these alone. In these cases, it might be necessary to build a command by using the query syntax itself, using $Q and $H syntax.
The command: $Q gives a list of all possible commands at any one time. On it's own, $Q gives a complete list of top level commands in any PDMS module. When applied in the middle of a command line, it lists the options available at that point.
E.G. the command:
SETUP FORM
Yields an error incomplete command line
SETUP FORM $Q
list_name as required
SETUP FORM _FRED $Q
lists a number of options including:
'BLOCK/ING' 'RESI/ZABLE' 'AT' 'SIZE' 'COPY' and Newline
 
Each of the words in quotes can be used at this point. There may be further options after these words and the same technique can be used to find the way through. The characters before the '/' indicate the minimum abbreviation which may be used for each part of the command. The presence of the Newline keyword without the quotes indicates that the return key may be pressed at this point and the command is executed.
Another form of syntax querying is the $H command. $H is a slightly more sophisticated form of $Q, which lists the available options numerically as the following example shows:
SETUP $H
1 <create a new form>
SETUP $H1
'FORM'
SETUP FORM $H
UNAME
And so on.

No comments:

Post a Comment