0% found this document useful (0 votes)
9 views66 pages

Event Driven Graphics

Uploaded by

Pinghua Sheng
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views66 pages

Event Driven Graphics

Uploaded by

Pinghua Sheng
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 66

Software Customisation Reference Manual

Event Driven Graphics

3 Event Driven Graphics

Event Driven Graphics (EDG) describes the AppWare implemented EDG interface, which is
used as the interface between most applications/utilities requiring graphics interaction and
the graphic canvas.
It describes the Public methods and members of the objects used within the system and
how they interact with each other. Also it describes how the AppWare developer can use the
system, write their own handlers, etc. etc.
The EDG interface has been developed to allow a common interface for the AppWare
developer to setup the graphic canvas in an EDG mode, which is relatively simple and
easily extendible. This will allow the developer to concentrate on the development of their
own application without the need to know the underlying mechanism (core implementation)
of the EDG interaction handlers and system.
The system handles all the underlying maintenance of the current events stacked e.g.
associated forms, initialisation sequences, close sequences, etc.
The current implementation of the system has mainly been developed for interaction with
the 3D graphic views in the Outfitting Design module. However, the interface can be used
with any of the modules that use the same executable and the standard 3D graphic views.

Note: EDG does not form part of the formal definition of PDMS and is subject to change.
There is no AVEVA commitment to keep or maintain this interface in subsequent
versions of PDMS.

3.1 Overview
The EDG interface has been developed using the basic core functionality available in the
Forms and Menus system.
Even though the underlying core commands are very powerful allowing the developer great
flexibility and control of graphical picking, they only relate to a single view gadget, and so
would require the developer to write their own code to encapsulate the commands and
maintain the graphical views the event is to be applied to.

3.2 Purpose
What the EDG system does, is to control the event handlers in a more global sense, so that
the same pick sequence is applied to all current graphical design views.
It also handles the stacking of EDG events, allowing the user to temporary suspend one
event with another, then return to the previous, without the lost of data, etc.

© Copyright 1974 to current year. 3:1 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Software Customisation Reference Manual
Event Driven Graphics

3.3 Scope
The current implementation has been developed mainly for the Outfitting Design module
using the standard 3D Graphical Design views. The system can be used in any of the
modules using the "des" executable and the standard 3D Graphical Design views, e.g.
IsoSpool, PARAGON, etc. The current implementation it is not available in Outfitting Draft.
Only the interfaces described can be classed as being supported in any form or manner.

3.4 Definitions
The following are abbreviations, acronyms and "buzz words" that may be used within this
document:
• EDG - Event Driven Graphics, this allow the application writer supply their own method
for interpreting the pick from the view gadget.
• Event Handlers - these are core defined handler that are used define the interaction
with the view gadget.
• Geometry Calculator - set of core functions, objects or methods used to derive
positional, angular, linear or directional data.
• GUI - Graphical User Interface, the forms and menus the user interacts with.
• Super Applications - these are applications/utilities, that are used for creating
elements, (sections, panels, etc.) or moving items, etc.
• Sub Applications - these are applications/utilities, used to derived data that may be
required when using the positioning tool kit, measure, construction aids, etc.
• edgCntrl - this is the global control object for the EDG system, the global variable for
the system within Outfitting is !!edgCntrl.
• Packet - this is an object that defines a complete definition of an application/utility that
is to be placed into the event system.
• PickPacket - this is a definition of the pick sequence and types that are used by an
application packet.
• PickType - this is a definition of how an actual pick is interpreted, e.g. if a database
element is picked, is it decomposed into a basic graphical entity, point, line, arc or
plane or is it returned as a pointer to the database element.
• Pick - this is the definition of the pick on the graphical canvas, it is a stylised version of
the core event handlers.
• Public Members & Methods - these are the members and the methods that the
AppWare developer should use when defining objects within the system.

3.5 Target Users


EDG is intended for any user who wishes to write an application/utility that requires
interaction with the graphics design canvas (as supplied with the standard product).
It is assumed that the user wanting to use the EDG interface is familiar with both the
concepts of an Object Orientated language and PML II.

3.6 Superseded Functionality


The concept of event driven graphics is intended to replace the old suspend macro and pick
commands, i.e. the @ operator used with ID, IDP and IDPL and VAR <varid> PICK used to

© Copyright 1974 to current year. 3:2 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Software Customisation Reference Manual
Event Driven Graphics

return the picked element and pick vector. Bring the PML language up to date with other OO
languages and GUI tool kits.
However, the old suspend macro command are still available, but should not be used for
any new development, as it is intended to deprecate these commands at some later version.

3.7 Components
There are several components that the EDG system uses; each component of the system
usually has an equivalent object definition. Its members and methods, defining the data
required and actions that are pertinent to that component.
Several of components within the system can be loosely defined as being a type of object
factory; these allow new components to be added into the system, without the need to
modify the base EDG system objects.
There are two main types of components that the system uses, these are:

3.7.1 Main Components


Main components are used to define and control the actual EDG system and should only be
used in conjunction with the system.
The following table lists the main component names and gives a basic description of their
function within the system:

Object Description
edgCntrl Controls and contains all currently active events that are
registered in the system.
edgPacket Defines a application/utility that requires graphical picks.
edgPickPacket Defines the pick sequences and types of pick a packet
requires.
edgPickType Defines how a pick is to be interpreted.
edgPick Defines the basic graphic pick, cursor style, filter, etc.
edgPosCntrl Object for controlling all graphical position picks settings and
active working planes/grids.

There are several other components that the system uses. However, these are to be
classed as being private to the EDG system, therefore the AppWare developer should never
access the directory.

3.7.2 Secondary Components


Secondary components are used by the EDG system to derive information and in many
cases can be used independently of the system.

© Copyright 1974 to current year. 3:3 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Software Customisation Reference Manual
Event Driven Graphics

The following table lists the secondary components and object that are used by the system:

Object Description
edgTypes Object factory for defined "edg" database type object, the
interpreting how a database element is decomposed into
their basic geometrical type, point, line, arc or plane.
appMathLib Object factory for graphical application mathematical objects,
used to derive information about basic geometrical objects,
i.e. proportion, distance, etc.
edgPickData Return data from a graphical pick.
edgPositionData A processed version of the edgPickData object that is used
to extract position and basic geometrical data from a picked
element.

The system access many more components, either directly or indirectly, the above shows
only those that are extensively used in the interpretation of data.

3.8 Concepts
There are several concepts that need to be understood by the AppWare developer, to
understand why the system is written the way it has and how best to use the system.

3.8.1 Event Driven Graphics


Unlike the old style of graphical picking used by Outfitting, which suspended the running of a
macro until a graphical element had been picked. EDG is a state in which the graphical view
gadget is put into, which defines criteria about how and what can be picked and how the
picked item is interpreted. When an item is picked, an action is carried out, i.e. a macro,
function or method is executed, similar to the callback on other gadgets types. What does
not happen, as with the old macro suspended mechanism, is that all other forms and
gadgets within the application, are still active.
What this means to the AppWare developer is that when writing a utility that uses the EDG
system, the action carried out when a pick happens, can only be completed once all the pick
information has been ascertained. Therefore, where an action requires two or more picks or
the picked information was incorrect, the action routine must either cache the information
until it has all the required pick information or it must instigate another event that setups the
system for the subsequent picks.
The AppWare developer should now consider the graphic view gadget as any other gadget,
i.e. on left-mouse-button up, the callback of the gadget will be actions.
What EDG allows from the user point of view, is that they can have the graphics view in a
EDG state, but they can still interact with any other form before they have completed the
actual pick task. Whereas, pre-EDG they would have to complete all the picks for a utility,
before anything else could be done.

3.8.2 Picking
Previous to the implementation of the EDG functionality, picking within the graphics view
had a limited scope, in that it was a means to navigate to an element in the database or a

© Copyright 1974 to current year. 3:4 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Software Customisation Reference Manual
Event Driven Graphics

way of identifying and returning some key features on an item in the graphics, i.e. ppoints or
plines.
What EDG allows now is a richer set of functions that allow the user to specify the type of
pick the user can perform, which can have predefined criteria applied to them and richer set
of return information that the user can use without having to derive the information within
their own application code.

3.8.3 Pick Sequence


When picking information from the canvas, a single pick cannot always describe what the
developer requires. Many instances require a standard and predictable sequence of picks to
define some sensible interaction. A simple example of this is a line created between two
points in space.
A more complex, but still a predefined sequence of picks, could involve different types of
picks, e.g. where a pick sequence requires a user to identify an item then pick a new
position where that item is to be positioned.
In some instances, what could be perceived as being a simple single pick sequence can
actually require several. The most obvious of these is a positioning picks, a simple position
at the origin of an item is only one pick, but a position at an intersection could be either two
or three picks depending on the items picked. In these cases, the numbers of picks are
handled from within the edgPickType object.

3.8.4 Event Packet


One of the underlying principles of the system is the event packet, this is a packet of
information that is used to define an operation in its entirety. These packets are self
contained, holding all the information about associated forms, operation criteria, actions
carried out on picking, etc. etc.
Once a packet has been defined and submitted to the system, then there should be no
requirement from external sources required for that packet to complete its task. Where
packets required run time data, the method for ascertaining this information should defined
within the packet. As event packets are run autonomously, all expected exceptions (errors)
must be handled internally.

3.8.5 Event Flow


The event system works such that at each level within the system, it is possible for an action
to be performed on the returned data. This data is automatically passed from the lower
routines up through the system, carrying out any predefined action on the data, then
passing it up to the next level. Only when all picks and actions are carried out is the data
passed to the user action routines within the event packet.

© Copyright 1974 to current year. 3:5 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Software Customisation Reference Manual
Event Driven Graphics

3.9 Event Control System (edgCntrl)


The control system is managed by the edgCntrl object; this contains and controls all the
data pertaining to the AppWare implementation of the EDG system. There are three main
components to the control system, these are:
• Active event - this is the currently active event that is applied to all the Design graphic
views the system knows about.
• Stacked events - these are all the events that are currently inactive but the system
knows about. Once the currently active event is completed or removed, the last event
to be added onto the stack will be made current.
• Design Graphic views - this is a register of all the graphic views that have been
registered for being maintained by the EDG system. Each time an event is added or
changed, all the view in the stack will be updated with the same data.
There is a single global instance of the edgCntrl object !!edgCntrl, this controls and
contains all data for the standard Outfitting Design applications.

© Copyright 1974 to current year. 3:6 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Software Customisation Reference Manual
Event Driven Graphics

3.9.1 Published Interface


The main components to the event control system that are available to the AppWare
developer can be split into three main sections:

Adding/Removing Events
Methods for adding and removing event packets to and from the event system:

Name Result Action


.add(EDGPACKET) BOOLEAN Add the passed event packet to the system,
making it active.
.remove(STRING) Removes the first event packets with the
passed event packet description from the
system.

Modifying Active/Stacked Events


Methods used to modify event packets within the event system:

Name Result Action


.setPrompt(STRING) Sets the primary prompt of the currently
active event.
.setPrompt(STRING, Sets the primary and secondary prompt of
STRING) the currently active event.
setStackPrompt(STRIN Sets the primary prompt of the stacked event
G, STRING) with the passed description.

© Copyright 1974 to current year. 3:7 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Software Customisation Reference Manual
Event Driven Graphics

Viewing Stack Contents


Methods used to view the current contents for the event system:

Name Result Action


.viewStack() Displays the currently active and stacked
event in the system.
.viewStack(REAL) Display the event at the specified stack
position, zero will display the currently active
event.

All members and methods NOT defined within the table should be classed as being private
to the control object. Therefore, AppWare developer should never use them when writing
applications.

3.9.2 Add Packet


Before an event can be used, the event packet must be defined in its entirety. When an
event is added to the system, several tasks are performed:
• Remove equivalent packets from the system (prompts on major packets)
• Makes previous event packet's forms inactive
• Move currently active event packet onto the stack
• Applies currently defined picking filters to picks (where applicable)
• Applies new packet event handlers to all registered graphical views
If an event fails for any reason when it is added to the system, the .add method will return
false.
The AppWare developer should handle failures and inform the user why the event was not
added to the system. Where a packet does fail, the developer should pass any error
messages that they wish to use back via the public_error object !!error.
The following example is a simple adding of an event packet object edgPacket into the
event system:

-- Define Event Packet


!packet = object EDGPACKET()
!packet….
-- Add Packet to event system
if(!!edgCntrl.add(!packet).not()) then
!!alert.warning('Failed loading event packet (' & !!error.text
& ').')
endif
-- End
return

Any code in the macro, function or method which is after the event has been added into the
system, will be completed before the event is available to the user.

Note: Code after the .add method, SHOULD NOT modify any element of the packet
definition, i.e. forms, global variable, etc. as it will only modify the local definition, not
the one that has been added on the EDG system.

© Copyright 1974 to current year. 3:8 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Software Customisation Reference Manual
Event Driven Graphics

3.9.3 Remove Packet


The .remove method will remove the first event in the EDG system that has the passed
description. Where a utility has more than one event, then a remove must be used for each
event added into the system.
An event can be removed from the system in one of two ways, either forcibly by using the
.remove method, giving the event packet description or automatically as defined in the
event packet definition (see below).
When an event is removed from to the system, several tasks are performed:
• The .close method of event packet is executed
• Removes any associated forms declared against the packet's definition
• Reinstates the event from the top of the stack, making it the active event
If the event description passed to the remove methods does not exist in the event control
system, no error is produced.
The following is a closing method for a form that uses an event packet to perform some form
of picking from the graphic view:

-- Define Close Method


define method .close()
-- Remove event
!edgCntrl.remove('<packet description>')
-- Hide the form
!this.hide()
-- End
endmethod

Note: Where there is a form associated with an event packet, the form will automatically be
removed by the event system, when the packet is removed from the system.

3.9.4 Change Prompts


In several instances it may be necessary to change the prompt of an event, which is already
within the event system.
There are two methods available to change the currently active event prompt(s). These can
be used to change either only the primary prompt or the primary and secondary prompts of
the event (see below for definition of primary and secondary prompts).
The modifying of prompts should only be necessary where an event packet is recursive, i.e.
it reinstates itself into the system, and subsequent picks require a different prompt from the
first pick.
A typical example of this type of use is the creation of a SCTN (section), the first pick is the
"start" of the section, the second is the "end". After the first pick, the event pick data is
cached, on completion of the second pick, the section if created.
The following is an example of where a packet's action (a method on a controlling form)
requires the subsequent prompts to be indexed until 4 picks have been made:

© Copyright 1974 to current year. 3:9 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Software Customisation Reference Manual
Event Driven Graphics

-- Check if there are less than 4 elements in the cache


if(!this.cache.size() lt 4) then

-- Increment the prompt of the next pick


!!edgCntrl.setPrompt('Primary prompt',
!this.cache.size().string())

-- If there are 4 pick, process the data


else

-- Process the pick data


!this.processData()

-- Initialise Data
!this.cache.clear()

-- Redefine first prompt


!!edgCntrl.setPrompt('Primary prompt', 'pick first point')

endif

Note: Several of the predefined event packets, maintain the prompts in a more direct
manner, these mechanisms MUST NOT be copied by the developer, as they are
maintained by the standard product and could potentially change without notification.

A third method of the event system, allows a stacked events primary prompt to be changed.
This will mean that when the event is reinstated as the active event, the prompt will be
different, than when it was added to the stack.
This is basically the same as the setting of the primary prompt of the currently active event,
but changes the event by description. This is regardless of whether the event is active or
stacked.

3.9.5 View the Stack


There are two methods available to view the current state of the stack. These are only
intended for use whilst developing AppWare and should only be used via the command line.
The outputs are directly written to the command request window, and look something like:

© Copyright 1974 to current year. 3:10 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Software Customisation Reference Manual
Event Driven Graphics

!!edgCntrl.viewStack()

Currently Active EDG Packet

Description : Define a linear dimension


Key : editDimension
Type : measure
Priority : 1
Initialisation : None
Action : !!gphMeasure.setMeasure(!this.return[1])
Form : GPHMEASURE
Remove : false
Input Data : None

Pick Packet
Description : Standard Distance Measure

EDG Packet - Stack position [1]

Description : Standard Navigate


Key : stdNavigate
Type : navi
Priority : 10
Initialisation : None
Action : !this.moveToDBRef()
Form : None
Remove : false
Input Data : None

Pick Packet
Description : Standard Element Pick

3.9.6 Limitations and Restrictions


AppWare developers MUST always access the control object by only Published Interface
methods. All members and methods of the object not within this document are classed as
being private and MUST NOT be used by developer writing applications.

3.10 Event Packet (edgPacket)


The main controlling component of the event system, is the Event Packet. The Event Packet
is used to define an event in its entirety, from the actions carried out when the object is
added to the stack to the action carried out when it is removed from the stack.
The Packet should be considered as being the complete definition of the utility that requires
a sequence of picks, when fully defined it can then be added to the event control system.
Once the Packet is in the system, as the active event, it will then run autonomously until it
has completed the pick sequence or removed from the system, forcible.
The Event Packet object can be broken down into several components, these basically are:
• Administration data
• Actions

© Copyright 1974 to current year. 3:11 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Software Customisation Reference Manual
Event Driven Graphics

• Pick sequence definition


• Input Data
• Output Data
Currently the main interface into the object is via members, however, there are several
methods available for defining the most common pick sequences.

Administration Data
There are several administration members available within the event object.
Currently the only members that have any relevance and are used by the system are:

.description Description of the event packet which is used when adding or


removing the packet into/from the edg system.

All packets relating to the same utility should have the same
description. This makes the removing and maintenance of the
system a lot simpler.

.priority Defines the priority within in the edg system of the packet, with
respects to other packets of the same description.

The priority is a real number, zero being the highest priority. Where
a primary packet (priority = 0) is added to the system and there is
already another primary packet in the system. The user will be
prompted to whether they want to replace the one currently in the
system with the one being added.

Only major utilities should be flagged as being primary packets, e.g.


creating a section, element, etc. Subsequent packets relating to the
same utility (having the same description) should have a lower
priority.

Note: Only packets of the same priority are removed from the
system, lower priorities DO NOT get removed when a higher
one is added.

.remove Defines whether the event packet is automatically removed from


the system when all the picks within the pick sequences and
actions of the packet have been executed.

The member is a Boolean, true if the packet is to be removed false


if the packet is to be reinstated into the system.

Note: Where a packet fails, it will be removed from the system if


true, the system DOES NOT return to the beginning of the
event pick sequence.

.form Contains a pointer to the form that is to be shown when the event is
added into the system.

As the member is of "form" data type, the form MUST exist before it
is assigned.

© Copyright 1974 to current year. 3:12 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Software Customisation Reference Manual
Event Driven Graphics

When the event packet is added to the system, the form will
automatically be shown and any initialisation for the form will be run
as normal. The form will be shown at the right hand side of the
screen, slightly offset from the top. This allows any low level
controlling forms (especially the positioning control form) to be
positioned above the form.

When the event packet is removed from the system, the form will
automatically be removed from the system and any low level control
forms that the packet may require.

When another event is placed on the stack, the form will still be
active, however, the event picks will relate to the event packet at the
top of the stack. Any low-level forms that are not required by the
new event packet, will be left on the screen, but made inactive. This
shows that they are still required be a currently stacked event, but
does not allow the modification of the event packet until the event
has been reinstated at the top of the stack.

Actions
All actions within the event packet object are defined as strings, however, they MUST
represent either a standard command, PML function or PML object/form method. Old style
macros MUST NOT be used within the actions of the object.
The main actions that a packet can have are:

.initialisation The action that is carried out when the event packet is initially
added to the edg system.

When an event packet is reinstated into the system (this is where


the .remove members is false). The action will NOT be executed.

.action An action which is carried out when all the picks within the pick
sequence object (edgPickPacket) have been successfully
completed.

All data derived from picking in the sequence object are returned
through the system via the local variable !this.return (refer to
Output Data).

.close An action which is carried out just prior to the event packet being
removed from the edg system, whether after a successful
completion of the .action, forcibly by another action of the same
priority/type or using the escape key, when in the graphics canvas.

The action is carried out within the event packet object, therefore,
arguments that refer to !this relate to the members of the event
packet object itself.

Where a packet has a form associated with the packet (using the
.form member) then the close action should not attempt to hide the
form, as the system will automatically remove the form.

© Copyright 1974 to current year. 3:13 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Software Customisation Reference Manual
Event Driven Graphics

.continue An action which is carried out after the event packet has been
removed from the edg system, whether after a successful
completion of the .action or forcibly by another action of the same
priority.

As the action is carried out external to the event packet object, it is


not possible to access any data from the event packet, unless this
has been stored via other means, i.e. a global variable or form.

Note: This action member is NOT run if the event packet is


removed using the <esc> key on the Design graphics
canvas is used.

.escape An action which works the same as the .continue member,


however it is only carried out if the event has been removed from
the using the <esc> key, from the Design graphic canvas.

Pick Definition
The Pick Definition defines the number and types of picks required for the event packet
(refer to Pick Packet (edgPickPacket).
There are several predefined methods that allow the most commonly used event pick
sequences to be declared without the need to define them explicitly. Where a predefined
pick sequence does not exactly give the required picks, they can be used as a basis, then
modified to suite the requirements.
Where there is no event packet method defined that gives the required pick sequences and
pick types, then the developer will have to define the pick packet from first principles.
However, it is hoped that the currently available methods for defining the pick sequences
are adequate for most.
See below for a full list of the available methods (refer to Pick Sequence Methods).

Input Data
Where data is to be passed to an event packet, that is used either on initialisation or whilst it
is running, the data has to be stored in the objects .input member. This means the event
packet can run autonomously without the need to access data from external variables or
forms.
The input member is an ARRAY type, allowing any variable data type to be passed to the
system. Setting the input data is the same as defining any other array element:

-- Define input data for packet


!packet[1] = 'String'
!packet[2] = 20
!packet[3] = !!ce.position
!packet.append(10)
!packet.insert(1, !!ce)
.
.

When using the input data, the developer MUST make sure that they know the positions
and data type of the element of the array they are using.

© Copyright 1974 to current year. 3:14 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Software Customisation Reference Manual
Event Driven Graphics

As input member can only be accessed directly from within the system by the action
routines associated with the action members of the event object. The input variable must be
refereed to thus !this.input:

-- Initialisation Action (using first element of input)


!packet.initialisation = '!!form.eventInit(!this.input[1])
-- Action routine (using all input array and return pick data)
!packet.action = '!!form.eventAction(!this.input, !this.return)
-- Close action (using first element of input)
!packet.close = '!!form.eventClose(!this.input[1])

Note: Variables are passed by reference, therefore, changing the variable associated to the
input variable, will change the input variable.

Where a pick sequence requires multiple picked and the lower objects do not process the
pick data, then the return array will contain multiple entries, one for each pick.

Output Data
All the objects within the event picking mechanism have a .return members, this is used to
pass the data between the objects within the system. All the objects are of an ARRAY type,
as this allows any data type to be assigned to the elements.
When a pick sequence has completed, all the derived data ascertained from the picking, will
be returned into the .return member of the pick event object. Therefore, all .action routines
requiring the pick data MUST use the variable.
Similar to the input variable, the return variable can only be accessed directly from within the
system, and therefore must be declared in the argument list of the actions as !this.return.

-- Action routine
_!packet.action = '!!form.eventAction(!this.return)

In most instances, only the first element of the return array will be populated. This could be
either with another array or a specific object type. In these cases, the developer may want
only to pass the relevant element to the action routine:

-- Action routine
_!packet.action = '!!form.eventAction(!this.return[1])

Note: Variables are passed by reference, therefore, changing the variable associated to the
return variable, will change the input variable.

3.10.1 Published Interface


The main components of the object that the developer can use, can be broken into two
sections:

© Copyright 1974 to current year. 3:15 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Software Customisation Reference Manual
Event Driven Graphics

Members
These are the published members for the object that the developer can used to define the
event packet object:

Name Type Action


.description STRING Description of the event packet.
.priority REAL Priority of event within the event packets of the
same description.
.initialisation STRING Action carried out when event packet is initially
added to the event system.
.close STRING Action carried out just before the event packet
is removed from the event system.
.action STRING Action carried out when all picks within the pick
sequence has been completed.
.continue STRING Action carried out after the event packet has
been removed from the event system.
.escape STRING Action carried out when the event packet is
removed from the system using the <esc> key
in the design graphic canvas.
.form FORM Form to be show when event packet is added
to the event system.
.pickPacket EDGPICKPACKET Definition of pick sequence and types required
for the event packet.
.remove BOOLEAN True if event is automatically removed when
the pick sequence has been completed.
False if event is to be reinstated, without the
.initialisation action being carried out.
.input ARRAY Contains information to be held local to the
event packet, which can be used during its
execution.

Pick Sequence Methods


There are several methods that define standard pick sequences, the following are the ones
currently supported:

Name Action
.navigate() Standard navigate pick.
.elementPick(<prompt>) Standard database element pick.
.plinePick(<prompt>) Standard pline pick.
.anyPick(<prompt>) Standard "any" pick.
.aidPick(<prompt>) Standard graphical aid pick.

© Copyright 1974 to current year. 3:16 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Software Customisation Reference Manual
Event Driven Graphics

.definePosition(<prompt>) Define basic positioning pick packet.


.defineCircle(<option>) Define circle definition pick packet.
.definePoint(<option>) Define point definition pick packet.
.defineLine(<option>) Define line definition pick packet.
.definePlane(<option>) Define plane definition pick packet.
.defineMeasure(<option>) Define a pick sequence for performing a measure.

The following are the standard available pick sequence methods and the event packet
settings that can be modified by the developer. Members not shown in the list, but which are
available for the developer, should be left as defined by the method, so that the pick
sequence works correctly:

Method Name Description


.navigate() Standard navigation pick, this will reposition the user at the
element picked.
Arguments Description

Packet Members Settings


.description Standard Navigate.
.priority 10.
.remove True.
.input
Return Array Description
None None.

Method Name Description


.elementPick(<prompt>) Standard element pick, allows a database element to be
picked from the design canvas.
Arguments Description
<prompt> Primary display prompt shown in the views information field.
Packet Members Settings
.description Standard Element Pick.
.priority 0.
.remove False.
.input

© Copyright 1974 to current year. 3:17 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Software Customisation Reference Manual
Event Driven Graphics

Return Array Description


[1] edgPickData Standard event pick return object.

Method Name Description


.plinePick(<prompt>) Standard structural element pline pick.
Arguments Description
<prompt> Primary display prompt shown in the views information field.
Packet Members Settings
.description Standard Pline Pick.
.priority 0.
.remove False.
.input
Return Array Description
[1] edgPickData Standard event pick return object.

Method Name Description


.anyPick(<prompt>) Standard "any" pick, allows element, pline, ppoint or
graphical aid to be picked.
Arguments Description
<prompt> Primary display prompt shown in the views information field.
Packet Members Settings.
.description Standard ANy Pick.
.priority 0.
.remove False.
.input
Return Array Description
[1] edgPickData Standard event pick return object.

Method Name Description


.aidPick(<prompt>) Standard graphical aid element pick.
Arguments Description
<prompt> Primary display prompt shown in the views information field.

© Copyright 1974 to current year. 3:18 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Software Customisation Reference Manual
Event Driven Graphics

Packet Members Settings


.description Standard Aid Pick.
.priority 0.
.remove False.
.input
Return Array Description
[1] edgPickData Standard event pick return object.

Method Name Description


.definePosition(<prompt>) Standard position pick, display position control form used to
define pick type selection and derive position filter.
Arguments Description
<prompt> Primary display prompt shown in the views information field.
Packet Members Settings
.description Basic Position.
.priority 0.
.remove False.
.input
Return Array Description
[1] edgPositionData Event picked position return object, contains all pick data and
derived position from the pick.

Method Name Description


.defineCircle(<option>) Method for defining a pick sequence to define a arc object
using the graphics.
Argument (Option) Description
3pnt Derives an arc passing through 3 position picks.
diameter3D Derives an arc whose diameter and X axes is through the
first two positional picks. The third positional pick defines the
relative Y axes of the arc definition.
radius3D Derives an arc which is centred about the first positional pick,
the second positional pick defines the radius and X-axes.
The third positional pick defines the relative Y axes of the arc
definition.

© Copyright 1974 to current year. 3:19 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Software Customisation Reference Manual
Event Driven Graphics

fixedRadius3D Defines an arc centred on the first position pick, where the
second and third positional pick defines the X and Y axes
respectively. Radius is specified via the automatically
displays input form.
fixedDiameter3D Defines an arc centred on the first position pick, where the
second and third positional pick defines the X and Y axes
respectively. Diameter is specified via the automatically
displays input form.
diameter2D Derives an arc lying on the active working plane, where the
diameter and X axes is through the two positional picks.
radius2D Derives an arc lying on the active working plane, centred
about the first positional pick, the second positional pick
defines the radius and X-axes.
fixedRadius2D Defines an arc lying on the active working plane, centred
about the positional pick. Radius is specified via the
automatically displays input form.
fixedDiameter2D Defines an arc lying on the active working plane, centred
about the positional pick. Diameter is specified via the
automatically displays input form.
fillet Defines an arc of radius specified via the automatically
displays input form, that lies tangentially to the two picked
lines.
tanTan Defines an arc of radius specified via the automatically
displays input form, that is tangential to the two picked arc
elements. The third pick (positional) define the centre side of
the arc.
pntTan Defines an arc centred on the first pick (positional) which is
tangential to the second pick (curved element).
fixedRadiusPntTan Defines an arc with radius supplied by the automatically
displayed input form, which lies on the line between the first
pick (positional) and the picked curved element.
fixedRadiusPntPnt Defines an arc centred on the first positional pick which is
tangential to the second pick on a curved element.
derive Derives an arc from the picked element.
tan3Lines Derives an arc which fits between the three lines picked.
Packet Members Settings
.description Defined by option.
.priority 0.
.remove True.
.input
Return Array Description
[1] arc Standard arc object.

© Copyright 1974 to current year. 3:20 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Software Customisation Reference Manual
Event Driven Graphics

Method Name Description


.definePoint(<option>) Method for defining a pick sequence to define a pure position
object definition.
Argument (Option) Description
pnt Derives an position at the derived positional.
Packet Members Settings
.description Defined by option.
.priority 0.
.remove True.
.input
Return Array Description
[1] position Standard position object.

Method Name Description


.defineLine(<option>) Method for defining a pick sequence to define a line object
definition.
Argument (Option) Description
pntPnt Defines a line between the two positional picks.
angle Defines a line based on the first pick (line element), which
angled by value supplied via the input form the line towards
the second pick (positional). The third pick (positional)
defines the start of the line definition.
derive Defines a line derived from the picked element.
pntTan Defines a line from the first pick (positional) to the nearest
tangent point of the second pick (curve element).
tanTan Defines a line to the nearest tangent points on the two curves
picked.
bisect Defines a line that bisect the two lines picked, line is based
on the first line picked.
twoPlanes Defines a line that is at the intersection of the two picked
plane elements.
shortest Defies a line that is between the two closest points of the
graphical entities picked. Where the two items are parallel,
then the line is from the first picked position onto the second.
Where two items converge and the line is zero length, then
an unset line is returned.

© Copyright 1974 to current year. 3:21 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Software Customisation Reference Manual
Event Driven Graphics

Packet Members Settings


.description Defined by option.
.priority 0.
.remove True.
.input
Return Array Description
[1] line Standard line object.

Method Name Description


.definePlane(<option>) Method for defining a pick sequence to define a plane object
definition.
Argument (Option) Description
3pnt Derives a plane passing through the three positional picks.
The first two define the centre and the X-axes, the third
defines the relative Y-axes.
Packet Members Settings
.description Defined by option.
.priority 0.
.remove True.
.input
Return Array Description
[1] plane Standard plane object.

Method Name Description


.defineMeasure(<option>) Method for defining a pick sequence to derive a
measurement.
Argument (Option) Description
distance Defines a line object that equates to the distance between
the two positional picks.
shortest Defines a line object that equates to the shortest distance
between the to graphical entities picked.
angle Defines an arc that represents the angle between the three
positional picks. The first pick defines the point about which
the angle is, the second and third, the points through which
the start and end of the angle passes.

© Copyright 1974 to current year. 3:22 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Software Customisation Reference Manual
Event Driven Graphics

lineAngle Defines a real that relates to the angle between the two
linear items picked.
Packet Members Settings
.description Defined by option.
.priority 0.
.remove True.
.input
Return Array Description
[1] line (distance) Standard line object.
[1] line (shortest) Standard line object.
[1] arc (angle) Standard arc object (radius is unit length of 1000mm).
[1] real (lineAngle) Real.

Note: When defining event packets using the above methods, the method should be
applied to the object before any other member is set, as the methods will overwrite
several of the event packet members.

3.10.2 Examples
The following are several examples and descriptions for setting up some basic packets
using the standard pick sequence methods.

Single Element Pick


The Single Element Pick defines an event packet that is totally self contained, it uses no
controlling form or action macros in its definition.
The packet definition is defined so that it remembers the element the user is at when the
packet is placed in the event system. For each pick of an element in the graphics view, the
user will be navigated to the picked element, when packet is removed from the event
system (using <esc> or being forced from the system by another event) the user will be
returned to the original element:

© Copyright 1974 to current year. 3:23 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Software Customisation Reference Manual
Event Driven Graphics

-- Define event packet


!packet = object EDGPACKET()

-- Define standard element pick


!packet.elementPick('Pick Element')

-- Remember the element when the packet was first place in the
-- event system
!packet.initialisation = '!this.input[1] = !!ce'

-- Move to the element picked


!packet.action = '!!ce = !this.return[1].item'

-- Set the close sequence, so that the user returns to the original
-- element
!packet.close = '!!ce = !this.input[1]

-- Add event packet to the system


!!edgCntrl.add(!packet)

Repeat Element Pick


The Repeat Element Pick defines an event packet that will keep picking elements, storing
the picked element in the input member of the packet. Then, when <esc> button is pressed,
the closing action will display all the elements in the input array.

-- Define event packet


!packet = object EDGPACKET()

-- Define standard element pick


!packet.elementPick('Pick Element <esc> to finish')

-- Retain the element picked in the input member


!packet.action = '!this.input.append(!this.return[1].item)'

-- Display the selected element on <esc>


!packet.close = 'q var !this.input'

-- Add event packet to the system


!!edgCntrl.add(!packet)

Again, this packet does not use other objects, functions or forms in its running. However, it
could be adapted to use objects, functions or forms when running. This could allow the
elements picked twice to be removed from the list, then some special action carried out on
all elements selected on the close of the packet.

© Copyright 1974 to current year. 3:24 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Software Customisation Reference Manual
Event Driven Graphics

The following is an example of a packet definition that will run functions that store the picked
element (in a global variable), then on completion, enhance all the elements selected.
When the event is placed into the event system, it will automatically initialise the global
variable that is used to store the picked elements:

Event Packet Definition

-- Define event packet


!packet = object EDGPACKET()

-- Define standard element pick


!packet.elementPick('Pick Element <esc> to finish')

-- Initialise the global store


!packet.initialisation = '!!xxxGlobalStore = ARRAY()'

-- Retain the element picked in the input member


!packet.action = '!!xxxStoreElement(!this.return[1].item)'

-- Tag the selected element on <esc> with their names


!packet.close = '!!xxxTagElements(|NAME|)'

-- Add event packet to the system


!!edgCntrl.add(!packet)

The following is the function definition that stores the picked element in a global variable,
enhancing the picked element. If the same element is picked twice, then it will be removed
from the list and un-enhance it:

© Copyright 1974 to current year. 3:25 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Software Customisation Reference Manual
Event Driven Graphics

Store Element Function

-- Function Definition
define function !!xxxStoreElement(!element is DBREF)

-- Check if element exist in the global variable


!index = !!xxxGlobalStore.findFirst(!element)

-- Element already is in the store


if(!index.set()) then

-- Remove element from the list and un-enhance


!!xxxGlobalStore.remove(!index)
UNENHANCE $!<element>

-- Add element to the list and enhance


else
!!xxxGlobalStore.append(!element)
ENHANCE $!<element> COLOUR RED
endif

-- End of definition
endfunction

The following functions definition is used to tag "MARK" all the elements that are in the
global variable:

Store Element Function

-- Function Definition
define function !!xxxTagElements()

-- Loop through elements


do !i indices !!xxxGlobalStore

-- Tag Item
MARK $!!<xxxGlobalStore[$!<i>]>

-- Unenhance element
UNENHANCE $!!<xxxGlobalStore[$!<i>]>

enddo

-- End of definition
endfunction

© Copyright 1974 to current year. 3:26 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Software Customisation Reference Manual
Event Driven Graphics

Simple Standard Position Pick (using only position data)


The Simple Standard Position Pick defines an event packet that uses the standard
positioning pick sequence. In this example, the packet definition has a controlling form (the
detail of the form is irrelevant) that the derived picked position writes it data to after each
pick.
When associating a form with an event packet, the developer MUST ALWAYS make sure
that the form has been build. This is because the form is passed by reference.
When the event packet is added to the edg system, the form will automatically be shown in
the top right hand corner of the screen (there is no control over this). In the case of the
positioning pick sequence, the positioning control form will also be displayed above the
event packets form.

-- Define event packet


!packet = object EDGPACKET()

-- Define standard element pick


!packet.definePosition('Pick Position')

-- Retain the element picked in the input member


!packet.action = '!!xxxForm.position(!this.return[1].position)'

-- Build form if required


if(undefined(!!xxxForm)) then
pml reload form !!xxxForm
endif

-- Associate form
!packet.form = !!xxxForm

-- Execute the forms tidy method on completion


!packet.close = '!!xxxForm.tidy()'

-- Add event packet to the system


!!edgCntrl.add(!packet)

It should be noted that there are several ways in which the event packet form can be closed:
• Form gadget, OK/Cancel/Dismiss button or Close on pull-down
• Close from the forms pull-down, top-left-hand corner of the form
• Using the <esc> key when in a design graphics canvas
When closing the event from the from (one of the first two methods) then the event packet
MUST be removed using the event systems .remove method, supplying the same
description that event packet was placed onto the system with:
!!edgCntrl.remove(<event packet description>)
When using the <esc> in the design canvas, then only the relevant tidy-up sequence of the
form should to be used. The developer MUST NOT use a method that has the event
systems .remove method in, this could cause problems.

© Copyright 1974 to current year. 3:27 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Software Customisation Reference Manual
Event Driven Graphics

Equivalents to "VAR !<id> PICK" commands


The following are examples of the old style PML 1 commands used to suspend the currently
active macro with a pick from the graphics canvas:
The following example equates to the old style "pick an element":

VAR !<varid> PICK

-- Define event packet


!packet = object EDGPACKET()

-- Define standard element pick


-- Equates to old PROMPT OFF
-- PROMPT LOAD ESCAPE '<prompt>'
!packet.elementPick ('Identify element')

-- Defines action on completion of the pick, passing complete


-- pick data
!packet.action ='!action(!this.return[1])'

-- Add event packet to the system


-- Equate to old VAR !varID PICK
!!edgCntrl.add(!packet)

The following example equates to the old style "pick a pline of a section":

VAR !<varid> PICK PLINE

-- Define event packet


!packet = object EDGPACKET()

-- Define standard element pick


-- Equates to old PROMPT OFF
-- PROMPT LOAD ESCAPE '<prompt>'
!packet. plinePick ('Identify pline of section)

-- Defines action on completion of the pick, passing complete


-- pick data
!packet.action ='!action(!this.return[1])'

-- Add event packet to the system


-- Equate to old VAR !varID PICK PLINE
!!edgCntrl.add(!packet)

The following example equates to the old style "pick a ppoint of an element":

© Copyright 1974 to current year. 3:28 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Software Customisation Reference Manual
Event Driven Graphics

VAR !<varid> PICK PLINE

-- Define event packet


!packet = object EDGPACKET()

-- Define standard element pick


-- Equates to old PROMPT OFF
-- PROMPT LOAD ESCAPE '<prompt>'
!packet. plinePick ('Identify element ppoint)

-- Defines action on completion of the pick, passing complete


-- pick data
!packet.action ='!action(!this.return[1])'

-- Add event packet to the system


-- Equate to old VAR !varID PICK POINT
!!edgCntrl.add(!packet)

Notes:
1. With the EDG system, it is not possible to instigate an event and suspend the currently
active macro then return to the same point in the macro, once the pick is completed. If
the developer wants to simulate the suspension of a macro, i.e. wait for the pick on the
graphics canvas. Then, the invocation of the event packet MUST be the last command
within the file and the action to be carried out after the pick, MUST be in the function/
method defined in the .action member.
Command defined after the invocation of an event packet within the same macro,
MUST NOT rely on the pick data of the event. Also it should be noted that any changes
to the packet definition WILL NOT have any effect on the event packet that has been
added to the system.
2. All of the above will automatically use the standard filters set via the filter utility within
the application. If an event packet is required that has a specific type of pick filter and
the standard filters are to be ignored, see below.

3.10.3 Limitations and Restrictions


Currently there are no methods on the event packet object for passing data down into the
lower level objects used by the system. This means that if there are requirement for a pick
sequence, pick type or actual pick to act differently than those defined by the currently
available pick sequence methods, the developer will have to define their own object
definition for the event packet in full.
It should also be noted that once an event is placed on the event stack, modifying the packet
that was originally passed to the system WILL NOT change the packet that is held within the
event system.
It is not possible to define an event packet, which comprises of a single specific type of pick,
followed by an unspecified one of the same type of pick.
It is not possible to define an event packet that triggers a subsequent event packet off, on
the completion of another, i.e. don't have an !!edgCntrl.add(<edgPacket>) within the
.close action of the first packet. As adding a new packet in the close sequence, will actually

© Copyright 1974 to current year. 3:29 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Software Customisation Reference Manual
Event Driven Graphics

stack the packet that is running, only removing it from the system, once the subsequent
packet has finished.

3.11 Pick Packet (edgPickPacket)


Whereas the event packet edgPacket defines what happens before and after a pick or
picks have been performed, the pick packet defines the actual pick sequence and types of
pick that are to be performed before the action of the event packet is executed.
A pick packet can be defined simple as a single basic pick, pick element, pline, ppoint, etc.
etc. Or it can be used to define several consecutive picks, either of the same time or of
different types.
Only when all picks within a pick packet have been performed, will the system return control
to the owning event packet. This allows the developer to define a standard set of picks
required for an interaction, without the need to handle every graphic canvas pick in the utility
they are writing.
Similar to the event packet, the pick packet object can be broken down into several
components, these are:
• Administration data
• Actions
• Pick sequence definitions
• Input Data
• Output Data
Currently the main interface into the object is via members, however, there are several
methods available for defining the most common pick types.

Administration Data
Unlike the administrative members of the event object, these members of this object are
only for interrogation by the developer and do not perform or define any characteristics of
the pick packet, they are only for information.

Actions
There is only one action member of the pick packet object .action this defines the action
that is carried out once all the picks within the pick packet definition have been completed.
Where a developer wish to define an action that is triggered on the completion of all picks,
then refer to the event packet action section, as the same principles apply to the definition of
the pick packet action.

Pick Sequence Definitions


For each pick required by the pick packet, the sequence definition array .picks, must
contain one or more pick type objects edgPickType, which define the pick to be carried out
by the system. This means that where a pick packet requires two pick, then the sequence
definition array .picks will contain two entries.
There are several predefined methods available to the object that allows commonly required
pick sequences to be defined. The defined methods describe the pick packet object in their
entirety and should not require any modification.

© Copyright 1974 to current year. 3:30 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Software Customisation Reference Manual
Event Driven Graphics

In most instances the predefined methods within the object can be used via a method on the
event packet object edgPacket (refer to Pick Sequence Methods). Therefore, in most cases
the use of the pick packet predefined methods should not be required.

Input Data
The input data mechanism is identical to that of the event packet input mechanism, i.e. if
data is to be passed about within the pick packet definition, then it should be via the .input
array (refer to Input Data).
Even though the input member has been included in the system, it currently has not been
used within any of the EDG developed so far. Therefore, even though the mechanism is
available it has not been extensively tested.

Output Data
The output data mechanism is identical to that of the event packet object (refer to Output
Data).

3.11.1 Published Interface


There are two main components to the pick packet object, these are the member and
methods.

Members
The following are published member interface into the object, members not defined within
this table are internal to the object and should never be set by the developer.

Name Type Action


.description STRING Description of the event packet.
.key STRING Single word identifier.
.prompt STRING Primary prompt (shown at the beginning of the prompt
status line.
.picks ARRAY Picks types edgPickType defining the pick sequence.
.action STRING Action carried out after all the picks within the pick
sequence have been completed.
.input ARRAY Contains information to be held local to the pick packet,
which can be used during it execution.

Methods
There are several methods that can be used to define a standard pick packet, the following
are the ones currently supported:

Name Action
.stdGphWindow(<prompt>) Standard graphical window pick (only screen position
used).
.stdScreen(<prompt>) Standard screen pick.
.stdView(<prompt>) Standard screen pick.

© Copyright 1974 to current year. 3:31 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Software Customisation Reference Manual
Event Driven Graphics

.stdElement(<prompt>) Standard element pick.


.stdAny(<prompt>) Standard element pick.
.stdPpoint(<prompt>) Standard ppoint pick.
.stdPline(<prompt>) Standard pline pick.
.stdAid(<prompt>) Standard aid element pick.
.stdGraphic(<prompt>) Standard graphical pick.
.direction(<prompt>) Standard derive direction pick.
.measureDistance() Standard distance measure.
.measureAngle() Standard angle measure between three point.
.measureLineAngle() Standard angle measure between two lines.
.stdPosition(<prompt>) Standard 3D single position pick.
.circle3pnts() Circle through 3 points.
.circleDia3d() Circle through 2 Positions (diameter defined) 3D.
.circleRad3D() Circle define centre and radius + control point 3D.
.circleFixRad3D(<any>) Circle centred of defined radius 3D.
.circleFixDia3D(<any>) Circle centred of defined diameter 3D.
.circleDia2D(<any>) Circle through 2 Positions (diameter defined) 2D.
.circleRad2D(<any>) Circle define centre and radius + control point 2D.
.circleFixRad2D(<any>, Circle define centre and radius + control point 2D.
<any>)
.circleFixDia2D(<any>, Circle centred of defined diameter 2D.
<any>)
.circleFillet(<any>) Fillet circle of defined radius.
.circleTan3Lines() Circle tangential to 3 lines.
.circleTanTan(<any>) Circle tangential to two other circles.
.circlePntTan() Circle, centred and tangential to another circles.
.circleFRadPntTan(<any>) Circle, centred and tangential to another circles of fixed
radius.
.circleFRadPntPnt(<any>) Circle going through two points + polar control point.
.circleDerive() Derive a circle from a DB element.
.pointPnt() Define working point in 3D space.
.linePntPnt() Define a line.
.lineAngle(<any>) Line offset by an angle from the picked line, towards the
second pick.
.lineDerive() Derive a line from a db element.

© Copyright 1974 to current year. 3:32 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Software Customisation Reference Manual
Event Driven Graphics

.linePntTan() Line between point an tangent of arc.


.lineTanTan() Line between tangent points of two arcs.
.lineBisect() Line bisecting two other lines (smallest angle side).
.lineTwoPlanes() Line at intersection of two planes.
.lineShortest() Shortest Line between to picked items.
.plane3pnts() Define a plane through 3 Positions.
.plane2pnts(<position>) Define a plane through 3 Positions.
.planeDerive() Derive a plane from a db element.

Note: Where pick packet definitions are supplied with arguments with a specific data type,
then these values have to be supplied before the event packet is placed in the event
system. However, where pick packets have an <any> argument type, the can be
supplied as a pointer (expression) that evaluates into the correct data type when the
action of the pick is evaluated.

The following are the standard available methods and their default settings that can be
modified or used by the developer. Members not shown in the list, but which are available
for the developer, should be left as defined by the method.

Method Name Description


.stdGphWindow(<prompt>) Standard graphical window pick.
Arguments Description
<prompt> Primary display prompt.
Picks Types Description.
[1] stdScreen Pick a position on the graphics canvas (First point).
[2] stdScreen Pick a position on the graphics canvas (Second point).
Pick Packet Members Settings
.description Standard Graphical window pick.
.key StdGphWindow.
.input
Return Array Description
[1] ARC Arc defining the plane of view and extremities of the pick.

Method Name Description


.stdScreen(<prompt>) Standard graphical canvas pick, used to derive position in
the selected view.
Arguments Description
<prompt> Primary display prompt.

© Copyright 1974 to current year. 3:33 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Software Customisation Reference Manual
Event Driven Graphics

Picks Types Description.


[1] stdScreen Pick a point on the graphical canvas.
Pick Packet Members Settings
.description Standard Screen Pick.
.key StdScreen.
.input
Return Array Description
[1] POINTVECTOR Contains direction of the view picked and the position on the
view plane (normal to direction of view, through the centre of
view limits).

Method Name Description


.stdView(<prompt>) Standard view pick, used to determine graphic view picked.
Arguments Description
<prompt> Primary display prompt.
Picks Types Description
[1] stdView Pick view gadget.
Pick Packet Members Settings
.description Standard View Pick.
.key stdView.
.input
Return Array Description
[1] GADGET Pointer to view gadget picked.

Method Name Description


.stdElement(<prompt>) Standard element pick, picks database element form
graphical view.
Arguments Description
<prompt> Primary display prompt.
Picks Types Description.
[1] stdElement Pick database element.
Pick Packet Members Settings
.description Standard Element Pick.

© Copyright 1974 to current year. 3:34 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Software Customisation Reference Manual
Event Driven Graphics

.key stdElement.
.input
Return Array Description
[1] edgPickData Standard event pick return object.

Method Name Description


.stdAny(<prompt>) Pick any element displayed in the graphical view.
Arguments Description
<prompt> Primary display prompt.
Picks Types Description
[1] stdAny Pick any graphical element type.
Pick Packet Members Settings
.description Standard Any Pick.
.key stdAny.
.input
Return Array Description
[1] edgPickData Standard event pick return object.

Method Name Description


.stdPpoint(<prompt>) Pick a ppoint of an element in the graphical view.
Arguments Description
<prompt> Primary display prompt.
Picks Types Description
[1] stdPpoint Pick a ppoint.
Pick Packet Members Settings
.description Standard Ppoint Pick.
.key stdPpoint.
.input
Return Array Description
[1] edgPickData Standard event pick return object.

© Copyright 1974 to current year. 3:35 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Software Customisation Reference Manual
Event Driven Graphics

Method Name Description


.stdPline(<prompt>) Pick a pline of an element in the graphical view.
Arguments Description
<prompt> Primary display prompt.
Picks Types Description
[1] stdPline Pick a structural pline.
Pick Packet Members Settings
.description Standard pline Pick.
.key stdPline.
.input
Return Array Description
[1] edgPickData Standard event pick return object.

Method Name Description


.stdAid(<prompt>) Pick a registered graphical aid element from the graphical
view.
Arguments Description
<prompt> Primary display prompt.
Picks Types Description
[1] stdAid Pick graphical aid.
Pick Packet Members Settings
.description Standard Aid Element Pick.
.key stdAid.
.input
Return Array Description
[1] edgPickData Standard event pick return object.

Method Name Description


.stdGraphic(<prompt>) Pick graphical component of any element in the graphical
view, i.e. point, line or plane.
Arguments Description
<prompt> Primary display prompt.

© Copyright 1974 to current year. 3:36 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Software Customisation Reference Manual
Event Driven Graphics

Picks Types Description


[1] stdGraphics Pick graphical entity.
Pick Packet Members Settings
.description Standard Graphic Pick.
.key stdGraphic.
.input
Return Array Description
[1] edgPickData Standard event pick return object.

Method Name Description


.direction(<prompt>) Derive direction from graphical entity picked in the view.
Arguments Description
<prompt> Primary display prompt.
Picks Types Description.
[1] stdGraphics Pick graphical entity.
Pick Packet Members Settings
.description Standard Derive Direction Pick.
.key direction.
.input
Return Array Description
[1] DIRECTION Standard direction object containing the direction of graphical
item picked.

Method Name Description


.measureDistance() Standard linear measure of to derived positions.
Picks Types Description
[1] stdPosition Positional pick, start of measure.
[2] stdPosition Positional pick, end of measure.
Pick Packet Members Settings
.description Standard Distance Measure.
.key measureDistance.
.prompt Measure distance.
.input

© Copyright 1974 to current year. 3:37 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Software Customisation Reference Manual
Event Driven Graphics

Return Array Description


[1] LINE Standard line object, contains the start point and end point.
To extract the distance .length() is used on the element.

Method Name Description


.measureAngle() Standard measure of an angle between three position in
space.
Picks Types Description
[1] stdPosition Positional pick, root of angle.
[2] stdPosition Positional pick, first point.
[3] stdPosition Positional pick, second pick.
Pick Packet Members Settings
.description Standard Angle Measure.
.key measureAngle.
.prompt Measure angle.
.input
Return Array Description
[1] ARC Standard arc object, centred on the root of the angle. To
extract the angle .angle() is used on the element.

Method Name Description


.measureLineAngle() Standard measure of an angle between two graphical line.
Picks Types Description
[1] stdGraphics Pick graphical line entity, first line.
[2] stdGraphics Pick graphical line entity, second line.
Pick Packet Members Settings
.description Standard Line Angle Measure.
.key measureLineAngle.
.prompt Measure angle between lines.
.input
Return Array Description
[1] REAL Angle between the two picked lines.

© Copyright 1974 to current year. 3:38 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Software Customisation Reference Manual
Event Driven Graphics

Method Name Description


.stdPosition(<prompt>) Standard derive position from graphical pick.
Arguments Description
<prompt> Primary display prompt.
Picks Types Description
[1] stdPosition Positional pick.
Pick Packet Members Settings
.description Standard single position Pick.
.key stdPosition.
.input
Return Array Description
[1] edgPositionData Event picked position return object, contains all pick data and
derived position from the pick.

Method Name Description


.circle3Pnts() Define a circle (arc) through point in 3D space
Picks Types Description
[1] stdPosition Positional pick, first point (start of arc).
[2] stdPosition Positional pick, second point (point on circumference).
[3] stdPosition Positional pick, third point (end of arc).
Pick Packet Members Settings
.description Circle through 3 Points.
.key circle3Pnts.
.prompt Circle (three points).
.input
Return Array Description
[1] ARC Standard arc object.

Method Name Description


.circleDia3D() Define a circle (arc) of diameter between two picks in a plane
defined by a third.
Picks Types Description

© Copyright 1974 to current year. 3:39 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Software Customisation Reference Manual
Event Driven Graphics

[1] stdPosition Positional pick, first point (start of arc).


[2] stdPosition Positional pick, second point (diameter).
[3] stdPosition Positional pick, control point (Y).
Pick Packet Members Settings
.description Circle derive diameter.
.key circleDia3D.
.prompt Circle (derive diameter).
.input
Return Array Description
[1] ARC Standard arc object.

Method Name Description


.circleRad3D() Define a circle (arc) of radius between two picks in a plane
defined by a third.
Picks Types Description
[1] stdPosition Positional pick, centre.
[2] stdPosition Positional pick, radius through point (X axes).
[3] stdPosition Positional pick, control point (Y).
Pick Packet Members Settings
.description Circle centred, derived radius.
.key circleRad3D.
.prompt Circle (derive radius).
.input
Return Array Description
[1] ARC Standard arc object.

Method Name Description


.circleFixRad3D(<any>) Define a circle (arc) with supplied radius centred on the first
point, orientated by the second and third points.
Arguments Description
<any> Any data type that must equate to a real value (radius).
Picks Types Description
[1] stdPosition Positional pick, centre.

© Copyright 1974 to current year. 3:40 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Software Customisation Reference Manual
Event Driven Graphics

[2] stdPosition Positional pick, first control point (X).


[3] stdPosition Positional pick, second control point (Y).
Pick Packet Members Settings
.description Circle Centre, defined radius.
.key circleFixRad3D.
.prompt Circle (defined radius).
.input
Return Array Description
[1] ARC Standard arc object.

Method Name Description


.circleFixDia3D(<any>) Define a circle (arc) with supplied diameter centred on the
first point, orientated by the second and third points.
Arguments Description
<any> Any data type that must equate to a real value (diameter).
Picks Types Description
[1] stdPosition Positional pick, centre.
[2] stdPosition Positional pick, first control point (X).
[3] stdPosition Positional pick, second control point (Y).
Pick Packet Members Settings
.description Circle Centre, defined diameter.
.key circleFixDia3D.
.prompt Circle (defined diameter).
.input
Return Array Description
[1] ARC Standard arc object.

Method Name Description


.circleDia2D(<any>) Define a circle (arc) with diameter between the two picked
positions, mapped onto the passed plane.
Arguments Description
<any> Any data type that must equate to a plane object.
Picks Types Description.

© Copyright 1974 to current year. 3:41 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Software Customisation Reference Manual
Event Driven Graphics

[1] stdPosition Positional pick, first point (start & X axes).


[2] stdPosition Positional pick, second point (diameter).
Pick Packet Members Settings
.description Circle derived diameter.
.key circleDia2D.
.prompt Circle (derived diameter).
.input
Return Array Description
[1] ARC Standard arc object.

Method Name Description


.circleRad2D(<any>) Derive a circle (arc) with radius between the two picked
positions, mapped onto the passed plane.
Arguments Description
<any> Any data type that must equate to a plane object.
Picks Types Description
[1] stdPosition Positional pick, centre.
[2] stdPosition Positional pick, radius through point (X axes).
Pick Packet Members Settings
.description Circle centred, derived radius.
.key circleRad2D.
.prompt Circle (derived radius).
.input
Return Array Description
[1] ARC Standard arc object.

Method Name Description


.circleFixRad2D(<any>,<a Derive a circle (arc) with specified radius centred on the
ny>) picked positions, mapped onto the passed plane.
Arguments Description
<any> Any data type that must equate to a plane object.
<any> Any data type that must equate to a real (radius).
Picks Types Description

© Copyright 1974 to current year. 3:42 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Software Customisation Reference Manual
Event Driven Graphics

[1] stdPosition Positional pick, centre.


Pick Packet Members Settings
.description Circle Centre, defined radius.
.key circleFixRad2D.
.prompt Circle (defined radius).
.input
Return Array Description
[1] ARC Standard arc object.

Method Name Description


.circleFixDia2D(<any>,<an Derive a circle (arc) with specified diameter centred on the
y>) picked positions, mapped onto the passed plane.
Arguments Description
<any> Any data type that must equate to a plane object.
<any> Any data type that must equate to a real (diameter).
Picks Types Description
[1] stdPosition Positional pick, centre.
Pick Packet Members Settings
.description Circle Centre, defined diameter.
.key circleFixDia2D.
.prompt Circle (defined diameter).
.input
Return Array Description
[1] ARC Standard arc object.

Method Name Description


.circleFillet(<any>) Derive a circle (arc) of supplied radius between two picked
lines.
Arguments Description
<any> Any data type that must equate to a real (diameter).
Picks Types Description
[1] positionLinear Pick linear items and position on it, first line.
[2] positionLinear Pick linear items and position on it, second line

© Copyright 1974 to current year. 3:43 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Software Customisation Reference Manual
Event Driven Graphics

Pick Packet Members Settings


.description Fillet Circle of defined radius.
.key circleFillet.
.prompt Circle (Fillet).
.input
Return Array Description
[1] ARC Standard arc object.

Method Name Description


.circleTan3Lines() Derive a circle (arc) which is tangential to the three picked
graphical lines.
Picks Types Description
[1] positionLinear Pick linear items and position on it, first line.
[2] positionLinear Pick linear items and position on it, second line.
[3] positionLinear Pick linear items and position on it, third line.
Pick Packet Members Settings
.description Circle tangential to 3 lines.
.key circleTan3Lines.
.prompt Circle (Tan. To 3 lines).
.input
Return Array Description
[1] ARC Standard arc object.

Method Name Description


.circleTanTan(<any>) Derive a circle (arc) of supplied radius which is tangential to
the two circular elements picked, with centre towards the
third positional pick.
Arguments Description
<any> Any data type that must equate to a real (radius).
Picks Types Description
[1] positionArc Pick arc items and position on it, first circle.
[2] positionArc Pick arc items and position on it, second circle.
[3] stdPosition Position pick, centre side.

© Copyright 1974 to current year. 3:44 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Software Customisation Reference Manual
Event Driven Graphics

Pick Packet Members Settings


.description Circle tangential to two other circles.
.key circleTanTan.
.prompt Circle (tangential).
.input
Return Array Description
[1] ARC Standard arc object.

Method Name Description


.circlePntTan() Derive a circle (arc) with radius from first positional pick to
nearest tangent on picked circular element.
Picks Types Description
[1] stdPosition Position pick, centre.
[2] positionArc Pick arc items and position on it, circle.
Pick Packet Members Settings
.description Circle, centred and tangential to another circle.
.key circlePntTan.
.prompt Circle (point - tangent).
.input
Return Array Description
[1] ARC Standard arc object.

Method Name Description


.circleFRadPntTan(<any>) Derive a circle (arc) of specified radius which lies on the line
from the first positional pick to the centre of arc of the second
pick.
Arguments Description
<any> Any data type that must equate to a real (radius).
Picks Types Description
[1] stdPosition Position pick, control point.
[2] positionArc Pick arc items and position on it, circle.
Pick Packet Members Settings
.description Circle, centred and tangential to another circle of fixed
radius.

© Copyright 1974 to current year. 3:45 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Software Customisation Reference Manual
Event Driven Graphics

.key circleFRadPntTan.
.prompt Circle (point - tangent).
.input
Return Array Description
[1] ARC Standard arc object.

Method Name Description


.circleFRadPntPnt(<any>) Derive a circle (arc) of specified radius that passes through
the first two positional picks, the third defines the direction of
the "bulge".
Arguments Description
<any> Any data type that must equate to a real (radius).
Picks Types Description
[1] stdPosition Position pick, start point.
[2] stdPosition Position pick, end point.
[3] stdPosition Position pick, polar control point.
Pick Packet Members Settings
.description Circle, through 2 points + polar control point.
.key circleFRadPntPnt.
.prompt Circle (through 2 points).
.input
Return Array Description
[1] ARC Standard arc object.

Method Name Description


.circleDerive() Derive a circle (arc) from the picked database element.
Picks Types Description
[1] dbCircle Pick database element that can be interpreted as an arc.
Pick Packet Members Settings
.description Derive a Circle from a db Element.
.key circleDerive.
.prompt Circle (derived).
.input

© Copyright 1974 to current year. 3:46 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Software Customisation Reference Manual
Event Driven Graphics

Return Array Description


[1] ARC Standard arc object.

Method Name Description


.pointPnt() Derive a point in space.
Picks Types Description
[1] stdPosition Position pick.
Pick Packet Members Settings
.description Define Working Point.
.key pointPnt.
.prompt Working Point (position).
.input
Return Array Description
[1] POSITION Standard position object.

Method Name Description


.linePntPnt() Derive a line between two points in space.
Picks Types Description
[1] stdPosition Position pick, start.
[2] stdPosition Position pick, end.
Pick Packet Members Settings
.description Line between two points.
.key linePntPnt.
.prompt Line.
.input
Return Array Description
[1] LINE Standard line object.

Method Name Description


.lineAngle(<any>) Derive a line offset by the supplied angle (towards the first
positional pick) starting at the second positional pick.
Arguments Description

© Copyright 1974 to current year. 3:47 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Software Customisation Reference Manual
Event Driven Graphics

<any> Any data type that must equate to a real (angle).


Picks Types Description
[1] positionLinear Pick linear items and position on it, line to be copied.
[2] stdPosition Position pick, position angle is towards (wrt to original).
[2] stdPosition Position pick, start position (copied line).
Pick Packet Members Settings
.description Line offset by angle from another.
.key lineAngle.
.prompt Line (offset angle).
.input
Return Array Description
[1] LINE Standard line object.

Method Name Description


.lineDerive() Derive a line from the picked database element.
Picks Types Description
[1] dbLine Pick database element that can be interpreted as an line.
Pick Packet Members Settings
.description Derive a line from a db element.
.key lineDerive.
.prompt Line (derive).
.input
Return Array Description
[1] LINE Standard line object.

Method Name Description


.linePntTan() Derive a line between a point and the nearest tangent point
on a picked arc.
Picks Types Description
[1] stdPosition Position pick, start.
[2] positionArc Pick arc items and position on it, circle/arc.
Pick Packet Members Settings
.description Line between point and tangent of arc.

© Copyright 1974 to current year. 3:48 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Software Customisation Reference Manual
Event Driven Graphics

.key linePntTan.
.prompt Line (point - tangent).
.input
Return Array Description
[1] LINE Standard line object.

Method Name Description


.lineTanTan() Derive a line between the nearest tangent points on the arcs
pick.
Picks Types Description
[1] positionArc Pick arc items and position on it, first circle/arc.
[2] positionArc Pick arc items and position on it, second circle/arc.
Pick Packet Members Settings
.description Line between tangents of two arcs.
.key .lineTanTan.
.prompt Line (tangent - tangent).
.input
Return Array Description
[1] LINE Standard line object.

Method Name Description


.lineBisect() Derive a line that bisects the two lines picked.
Picks Types Description
[1] positionLinear Pick linear items and position on it, first line.
[2] positionLinear Pick linear items and position on it, second line.
Pick Packet Members Settings
.description Line bisection two lines.
.key .lineBisect.
.prompt Line (bisect).
.input
Return Array Description
[1] LINE Standard line object.

© Copyright 1974 to current year. 3:49 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Software Customisation Reference Manual
Event Driven Graphics

Method Name Description


.lineTwoPlanes() Derive a line at the intersection of the two picked plane.
Picks Types Description
[1] positionPlane Pick planar items and position on it, first plane.
[2] positionPlane Pick planar items and position on it, second plane.
Pick Packet Members Settings
.description Line at intersection of 2 planes.
.key lineTwoPlanes.
.prompt Line (2 planes).
.input
Return Array Description
[1] LINE Standard line object.

Method Name Description


.lineShortest() Derive the shortest line between two graphical entities,
parallel items will start at the position of the first pick.
Picks Types Description
[1] stdGraphics Pick graphical entity, from.
[2] stdGraphics Pick graphical entity, to.
Pick Packet Members Settings
.description Standard Parallel Distance Measure.
.key .lineShortest.
.prompt Measure distance.
.input
Return Array Description
[1] LINE Standard line object.

Method Name Description


.plane3Pnts() Derive a plane that passes through the three positions
picked.
Picks Types Description
[1] stdPosition Position pick, first point (centre of the plane).

© Copyright 1974 to current year. 3:50 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Software Customisation Reference Manual
Event Driven Graphics

[2 stdPosition Position pick, second point (X axes).


[3 stdPosition Position pick, third point (Y axes).
Pick Packet Members Settings
.description Plane through 3 Positions.
.key plane3Pnts.
.prompt Plane (three points).
.input
Return Array Description
[1] PLANE Standard plane object.

Method Name Description


.plane2Pnts(<position>) Derive a plane that is centred on the passed position and
orientated to the two positional picks.
Arguments Description
<position> Position of plane origin.
Picks Types Description.
[1] stdPosition Position pick, X through point.
[2] stdPosition Position pick, Y through point.
Pick Packet Members Settings
.description Plane through 2 Positions (supplied position is centre).
.key plane2Pnts.
.prompt Plane (two points).
.input
Return Array Description
[1] PLANE Standard plane object.

Method Name Description


.planeDerive() Derive a plane from the picked database element.
Picks Types Description
[1] dbPlane Pick database element that can be interpreted as an plane.
Pick Packet Members Settings
.description Derive a plane from a db element.
.key derivePlane.

© Copyright 1974 to current year. 3:51 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Software Customisation Reference Manual
Event Driven Graphics

.prompt Derive plane.


.input
Return Array Description
[1] PLANE Standard plane object.

Note: When defining pick packets using the above methods, the method should be applied
to the object before any of the other members are set, as the methods will overwrite
several of the pick packet members.

3.11.2 Examples (Defining Pick Sequences)


The following are some examples and description of using some of the basic pick packet
methods and defining event pick sequences that are not catered for by the standard
methods.

Note: The definitions of the event packets that the pick packet is to be applied to are not
shown. See below for how the pick packet can be defined with respect to an event
packet (refer to Examples (Using Pick Packets).

Standard Element Method


The Standard Element Method example shows how to use the standard element pick
sequence, the same sequence can be applied to any of the other standard events.

-- Define pick packet


!pickPacket = object EDGPICKPACKET()

-- Define line between two points


!pickPacket. stdElement ('Pick element')

Standard Line between two point Method


The Standard Line between two point Method example shows how to define a pick that
derive a line between two points within 3D space, the resultant line can then be used for any
linear based item, SCTN, line, distance measurement. In this example we've change the
prompt so that we are asking to defined a linear measurement, this is basically the same as
the standard .measureDistance() method is defined.

-- Define pick packet


!pickPacket = object EDGPICKPACKET()

-- Define line between two points


!pickPacket.linePntPnt()

-- Modify the prompt


!this.prompt = 'Measure distance'

© Copyright 1974 to current year. 3:52 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Software Customisation Reference Manual
Event Driven Graphics

Element-Position Picking
The Element-Position Picking example shows how the developer can define a pick
sequence that firstly asks for an element to be picked, then for a derived position to be
picked.
This type of pick sequence can be used to identify an element, then reposition it in a new
place.

-- Define pick packet


!pickPacket = object EDGPICKPACKET()

-- Define information
!pickPacket.key = 'element-position'
!pickPacket.description = 'Pick an element then a positions'

-- Define primary prompt


!pickPacket.prompt = 'Move element'

-- Declare first pick (element)


!pickPacket.picks[1] = object EDGPICKTYPE()
!pickPacket.picks[1].stdElement('(Pick element to move)')

-- Declare second pick (position)


!pickPacket.picks[2] = object EDGPICKTYPE()
!pickPacket.picks[2].stdPosition('(New position)')

Note: No action is carried out within the pick packet, therefore, all the data will be returned
from each of the pick and will be passed back up the event system to the event
packet unmodified.

Defining Fixed Radius Circle


The Defining Fixed Radius Circle example shows how a fixed radius circle can be defined
so that the radius can be defined via an input gadget of a form, even after the event packet
has been placed on the event system.

-- Check to make sure controlling form has been defined


if(undefined(!!xxxRadius)) then
pml reload form !!xxxRadius
endif

-- Define pick packet, passing pointer to value of the text


-- input gadget of the controlling form
!packet.pickPacket.circleFixRad3d('!!xxxRadius.radius.val')

© Copyright 1974 to current year. 3:53 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Software Customisation Reference Manual
Event Driven Graphics

Note: If the pointer to the gadget was unquoted, i.e. passed as a REAL value. The current
value of the form gadget would be used and changing the value on the form would
have no effect when the pick packet action is executed.

Whereas, passing the pointer to the form gadget as a string, take the string and
evaluate it at the action time.

3.11.3 Examples (Using Pick Packets)


The following examples show how a pick packet can be either defined directly to an event
packet (edgPacket) or defined as a method against an object or form to be applied to an
event packet within a utility.

Applied to an Event Packet


The Applied to an Event Packet example shows how a standard pick packet can be defined
while defining an event packet.

-- Define event packet


!packet = object EDGPACKET()

-- Set Members
!packet.description = 'Test Packet'
!packet.key = 'testPacket'
!packet.priority =1

-- Defines action on completion of the pick


!packet.action ='!action(!this.return[1])'

-- Define pick sequence


!packet.pickPacket.stdElement('Pick Element')

-- Add event packet to the system


!!edgCntrl.add(!packet)

The pick packet definition can be either done using a standard method on the object (as
above) or defined fully, where there is no standard method.

Method Definition
The Method Definition example is where an object/form has a method(s) that defines a pick
packet sequence that can be applied to a standard event packet within the object/form.
The following is the definition of the method that defines the pick packet:
Method Definition

© Copyright 1974 to current year. 3:54 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Software Customisation Reference Manual
Event Driven Graphics

-- Define Method
define method .elementMove() is EDGPICKPACKET

-- Define pick packet


!pickPacket = object EDGPICKPACKET()

-- Define information
!pickPacket.key = 'element-position'
!pickPacket.description = 'Pick an element then a positions'

-- Define primary prompt


!pickPacket.prompt = 'Move element'

-- Declare first pick (element)


!pickPacket.picks[1] = object EDGPICKTYPE()
!pickPacket.picks[1].stdElement('(Pick element to move)')

-- Declare second pick (position)


!pickPacket.picks[2] = object EDGPICKTYPE()
!pickPacket.picks[2].stdPosition('(New position)')

-- Return
return !pickPacket

-- End method definition


endmethod

The following is an extract on how the above method would be used within the owning
object/form:

© Copyright 1974 to current year. 3:55 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Software Customisation Reference Manual
Event Driven Graphics

-- Define Packet
!packet = object EDGPACKET()
.
.
.

-- Test for method


if(!option eq 'MOVE") then
!packet.pickPacket = !this.elementMove()
else
!packet.pickPacket = !this.elementBY()
endif

-- Add event to the system


!!edgCntrl.add(!packet)
-

3.11.4 Limitations and Restrictions


The current event packet object only contains a basic set of pick sequence definitions, but it
is thought that these should allow the developer a broad set that they can use with little or
no modification
Currently many of the utilities within the standard AppWare use these methods in their
interaction with, e.g. 3D Construction Aids, Measurement utilities, etc.
Similar to the event packet, modifying the original definition of a pick packet WILL NOT
update the definition, once it has been placed on the event stack.

3.12 Pick Type (edgPickType)


The pick type object defines the basic types of picks that can be performed by the system.
Whereas the pick packet defines how many and what types of pick are required for a pick
sequence.
There are two main objects the pick type object returns to the calling objects, these are:
• edgPickData this object contains all the information about the pick on the graphical
canvas, without the data being post processed to derive a position, etc.
• edgPositionData this object is basically the same data as the edgPickData but the
data has been processed either by the edg positioning control object, to determine the
derived position of the picked item or the position picked on the items has been derived
using some basic rules.
In some instances, certain pick type methods return only a basic object, e.g.
POINTVECTOR, etc.
This section of the document DOES NOT give a detailed explanation of the members and
principles of this object. As in most cases, changing any of the members will seriously affect
the workings of the object.

© Copyright 1974 to current year. 3:56 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Software Customisation Reference Manual
Event Driven Graphics

3.12.1 Published Interface


The following are the main basic types of method interface into the pick type object.
All "<prompts>" are secondary prompts, these are displayed on the prompt line of the
graphic views after the primary prompt which is defined in the pick packet object. These are
used to signify which prompt within the prompt sequence the user is up to.

Position Picking
The following methods are used to define a specific type of filtered pick which returns an
edgPositionData object, the position member of the return object is populated:

Name Action
stdPosition(<prompt>) Standard positioning pick type, derives the position from
the graphical pick (pick type and method are controlled by
the positioning control form).
The initial position derived, will then be mapped against the
active working plane (when set) then the currently defined
offset method will be applied to the position.
positionLinear(<prompt>) Positioning pick for linear elements, converts picked item
into a linear element, then derives the position on the linear
item.
positionArc(<prompt>) Positioning pick for arc elements, converts the picked item
into an arc, then derives the position on the arc.
positionPlane(<prompt>) Positioning pick for plane elements, converts the picked
item into a plane, then derives the position onto the plane.

General Item Picking


The following methods are used to define a specific type of filtered pick which returns an
edgPickData object.

Name Action
stdElement(<prompt>) Standard element pick type, this will only pick database
element in the graphic views.
By default the standard element filters will be applied to the
pick, only allowing those elements that conform to the define
rule for the filter.
stdAny(<prompt>) Standard any pick type, this will allow elements, plines,
ppoints and graphical aids to be in the graphic views.
By default all the standard filters will be applied to the pick.
stdPpoint(<prompt>) Standard element pick type, this will only allow elements
containing ppoints or design points to be picked in the
graphic views.
By default the standard ppoint filters will be applied to the
pick.

© Copyright 1974 to current year. 3:57 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Software Customisation Reference Manual
Event Driven Graphics

stdPline(<prompt>) Standard element pline type, this will allow only elements that
have plines to be picked from in the graphic views.
By default the standard pline rules will be applied.
stdAid(<prompt>) Standard Aid element pick type, this will allow all graphical
aids to be picked from the graphical views. However, graphic
aids not registered within the "Construction Aid" utility will
return an error.
stdScreen(<prompt>) Standard screen pick, this will allow a pick anywhere within
the graphical view to be performed. This can considered as a
2D pick within the 3D view.
stdGraphics(<prompt>) Standard graphics pick, this will allow any graphical entity to
be picked within the graphics view, i.e. database element,
graphical aid, ppoint or pline. All elements, will be
decomposed into one of three basic types:
vertex single point at the convergence of edges
edge boundary between facets
facet planar surface of an item

Database Element Interpretation


The following methods are used to define a specific type of filtered pick which returns an
edgPositionData object, however, the position member of the return object is NOT
populated:

Name Action
dbLine(STRING) Setup for picking a linear db item, this will always try and
convert the picked database element into a line. The method
will try and populate the .line member of the return object.
dbCircle(STRING) Setup for picking a circular db item, this will always try and
convert the picked database element into an arc. The
method will try and populate the .arc member of the return
object.
dbPlane(STRING) Setup for picking a plane db item, this will always try and
convert the picked database element into a plane. The
method will try and populate the .plane member of the return
object.

Miscellaneous
The following methods are used to define a specific type of filtered pick which returns an
edgPositionData object, however, the position member of the return object is NOT
populated:

Name Action
stdView(STRING) Standard view pick, this returns the view gadget the pick is
performed in.

© Copyright 1974 to current year. 3:58 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Software Customisation Reference Manual
Event Driven Graphics

3.12.2 Examples
As there is not member that should be defined by the developer, the example for the
definition of pick packets will suffice as on how to use the pick type methods. Refer to
Examples (Defining Pick Sequences).

3.12.3 Limitations and Restrictions


The current pick type object contains only the basic pick types. Other pick types of more
complexity will be required for better interaction, however, this will only be possible with
enhancements to the underlying core facilities.

3.13 Pick (edgPick)


The event pick is the lowest component of the event system, this object maps directly onto
the underlying core event handlers.
The majority of the members and methods are private to the object and the event system,
and should never need to modify by the developer. However, there are two members that
the developer may wish to change for special types of picking, these are to control the
filtering of the picks.

3.13.1 Pick Filtering


There are two members that are used to control the pick filtering:

.input This is an array member, containing the qualifiers used to define the
filtering when picking from the graphics view. Each element of the
array relate to a specific type of item, which can be picked, these
are:

[1] Pline, filter applied to display only plines of structural elements


that conform to the defined rule.

[2] Ppoint, filter applied to display only ppoint of elements that


conform to the defined rule.

[3] Element, filter applied to only allow elements that conform to the
defined rule to be picked.

[4] Design Aid, filter applied to only allow design aids that conform
to the defined rule to be picked.

[5] Tubing, filter applied to only allow implied tubing conforming to


the defined rule to be picked.

[6] Graphical Entity, allow only the graphical entities defined in the
member to be pick, these are, VERTEX, EDGE or FACET. If no
entry is defined, then all graphical entities are pickable.

Note: The filtering rules are evaluated as the cursor passed the
item in the graphic view.

© Copyright 1974 to current year. 3:59 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Software Customisation Reference Manual
Event Driven Graphics

Rules for design elements and tubing are evaluated on only the
design element that can be picked, primitive, piping component,
SCTN, etc. Whereas the rules for ppoints and plines are evaluated
at the point of definition, i.e. on the catalogue definition of them, this
means that information pertaining to the ppoint or pline when in the
design space CAN NOT BE USED.

Element rules are always evaluated before the ppoint and pline
rules, therefore, if an element rule excludes anything that has a
pline, e.g. TYPE eq 'BOX', then the user will not be able to select a
element to pick.

.modifiable If this member is set to true this applies the standard filter to the pick
when the pick becomes active. When false, the currently defined
local rules within the .input member are used.

Note: If you have defined some input rule, this member MUST BE
set to false, otherwise the rules defined within the standard
filtering utility will over-ride the settings when the pick
becomes active.

3.13.2 Rule Combination


The following table show the rules can be used together:

Pline Ppoint Element Aid Tubing Graphics


Pline yes yes
Ppoint yes yes
Element yes yes yes yes
Aid yes
Tubing yes yes
Graphics yes yes yes yes yes

Even though some combination of rules are permissible, the actual usefulness of the
combination is limited.

Note: Dependent on the underlying pick method used, some of the rules will have no effect,
e.g. setting a graphic pick filter when using the pick elements handler, has not
meaning.

© Copyright 1974 to current year. 3:60 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Software Customisation Reference Manual
Event Driven Graphics

3.13.3 Published Interface


The following are the two members of the pick object used to control the pick filtering:

Name Type Action


.input ARRAY Picking qualifiers to restrict the data that can be
graphically picked.
.modifiable BOOLEAN True if the standard filtering utilities are to be
applied to the pick when it is active or added
onto the pick stack.

3.13.4 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.

© Copyright 1974 to current year. 3:61 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Software Customisation Reference Manual
Event Driven Graphics

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.

© Copyright 1974 to current year. 3:62 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Software Customisation Reference Manual
Event Driven Graphics

-- 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.

3.13.5 Limitations and Restrictions


Currently there is no interface to set the filter rules from any other level within the system,
e.g. from event packet, pick packet or pick type objects. The filter has to be set using all the
variable parentage.

3.14 Pick Data (edgPickData)


The pick data object basically maps on the return data object of the underlying core event
handler. Whereas the underlying system returns the pick data via an array, the pick data
object assigns the data to members with some meaningful names.

3.14.1 Published Interface


The pick data object can be classed as being only a read-only objects, as setting the
members within the object will have no effect on the operation of the event picking.

Method
The pick data object only has one method, this returns the pick data object as a picked
position object.

Name Result Action


.positionData() edgPositionData Converts the pick data into a standard event
position data object.

© Copyright 1974 to current year. 3:63 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Software Customisation Reference Manual
Event Driven Graphics

Members (General Picks)


The following are the definition of the members that are common to all the available picking
types:

Name Type Action


.type STRING Basic type of pick on the graphics canvas, e.g.
ELEMENT, PLINE, PPOINT, etc., etc.
.tubing STRING Tube type adjacent to the .item member, i.e. HEAD or
LEAVE.
.item DBREF Database element picked.
.point REAL Ppoint or graphical aid number picked.
.pline STRING Structural pline picked.
.aidType STRING Basic graphical aid type picked, e.g. LINE,
CYLINDER, etc.
.pickLine POINT- Pick vector when picking an item, i.e. direction of view
VECTOR and the position of the direction on the viewing plane.

Members (Graphic Entity Picks)


The following are the definition of the members that are only populated by the graphical
entity picks, these members define the basic graphical components of the item under the
pick cursor:

Name Type Action


.vertexCount REAL Number of vertices, usually only 1, zero if a graphical
edge or facet is picked.
.vertices ARRAY Position of vertex picked.
.lineCount REAL Number of edges/lines at the vertex point, 1 if only a
graphical edge is picked, zero if a facet is picked.
.lines ARRAY Paired positions defining each edge/line.
.facetCount REAL Number of facets bounding the picked line or vertex,
1 if only a facet is picked.
.facets ARRAY Positions of each of the corners of the facets, four per
facet.

3.15 Picked Position Data (edgPositionData)


The Pick Position Data object basically maps on the return data object of the underlying
core event handler. Whereas the underlying system returns the pick data via an array, the
pick data object assigns the data to members with some meaningful names.

© Copyright 1974 to current year. 3:64 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Software Customisation Reference Manual
Event Driven Graphics

3.15.1 Published Interface


Similar to the pick data object, this object can be classed as being only a read-only objects,
as setting the members within the object will have no effect on the operation of the event
picking.

Members
The following are the definition of the members:

Name Type Action


.type STRING The is normally the same as the original type, but
in certain instances the can be changed by some
secondary process.
.originalType STRING Basic type of pick on the graphics canvas, e.g.
ELEMENT, PLINE, PPOINT, etc., etc.
.position POSITION Derived position.
.direction DIRECTION Derived direction.
.pointVector POINTVECTOR Pick vector when picking an item, i.e. direction of
view and the position of the direction on the
viewing plane.
.line LINE Picked element interpreted as a line.
.plane PLANE Picked element interpreted as a plane.
.arc ARC Picked element interpreted as a arc.
.item DBREF Item picked, in case of multiple pick the last item.
.items ARRAY All items picked in the pick.
.ppoint REAL Ppoint or graphical aid number picked.
.pline STRING Structural pline picked.
.tubing STRING Tube type adjacent to the .item member, i.e.
HEAD or LEAVE.

Methods
There are several methods avail these are:

Name Result Action


.line() MODIFIES Evaluate line definition for current data.
.arc() MODIFIES Evaluate arc definition for current data.
.plane() MODIFIES Evaluate plane definition for current data.
.getline() LINE Return evaluated line definition for current data,
without modifying the member.

© Copyright 1974 to current year. 3:65 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Software Customisation Reference Manual
Event Driven Graphics

.getarc() ARC Return evaluated arc definition for current data,


without modifying the member.
.getplane() PLANE Return evaluated plane definition for current data,
without modifying the member.

© Copyright 1974 to current year. 3:66 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.

You might also like