Software Customisation
Reference Manual
Event Driven Graphics
:
Pick (edgPick)
: Examples
Examples
The following are examples show how to set the pick filter, the first example shows how the filter is set from the event packet level. All subsequent examples show what filter rules that can be applied.
Setting Filter from Event Packet
The Setting Filter from Event Packet example shows how the element filter can be set, so that only element beneath an equipment or sub-equipment can be picked.
-- Define event packet
!packet = object EDGPACKET()
-- Define standard element pick
!packet.elementPick('Pick Element')
-- Define Rule
!rule = 'TYPE of OWNER inset (|EQUI|,|SUBE|)'
-- Set the pick filter for element to only equip and subequip
!packet.pickPacket.picks[1].pick.input[3] = !rule
-- Set the modifiable flag, so that the rule is used
!packet.pickPacket.picks[1].pick.modifiable = false
-- Add event packet to the system
!!edgCntrl.add(!packet)
Note:
As only certain element types can be actually picked from the graphic canvases, e.g. primitives, tubing, etc. Then the rule MUST in this case check whether the parent of the element is either an equipment or sub-equipment.
Filter Plines for Structural Beams
The following example shows how a pick filter can be setup, so that only certain plines of structural sections (SCTN and GENSEC) flagged as a BEAM are allowed to be picked.
The example could be used to pick only the plines on beam section that are on the outer faces of flange or wed.
-- Define Element Rule
!element = 'TYPE of OWNER inset (|SCTN|,|GENSEC|) and $
GTYPE eq |BEAM|'
-- Define Pline Rule
!pline = 'PKEY inset (|TOS|,|BOS|,|NAR|,|NAL|)'
-- Set the pick filter for element to only equip and subequip
!packet.pickPacket.picks[1].pick.input[1] = !pline
!packet.pickPacket.picks[1].pick.input[3] = !element
-- Set the modifiable flag, so that the rule is used
!packet.pickPacket.picks[1].pick.modifiable = false
Note:
The pline rule relates to the attribute that is on the catalogue definition of the section profile.
Filter Tubing for Branches
The following example show how a pick filter can be defined to allow only vertical legs in a pipe branch which are have a tube length greater than a specific value.
This example might be used when trying to insert a check valve, of a given length, in the vertical leg of a pipe, which includes a clearance on either side of the valve.
-- Define Element Rule
!element = 'TYPE eq |TUBING|'
-- Element Length + Clearance
!length = !valveLength + !clearance * 2
-- Define Tubing Rule
!tubing = 'GRADIENT eq 100000 and ITLENGTH gt ' & !length
-- Set pick filters
!packet.pickPacket.picks[1].pick.input[3] = !element
!packet.pickPacket.picks[1].pick.input[5] = !tubing
-- Set the modifiable flag, so that the rule is used
!packet.pickPacket.picks[1].pick.modifiable = false
Note:
The rule (expression) must always be defined as a string.
1974 to current year.
AVEVA Solutions Limited and its subsidiaries. All rights reserved.