Software Customisation
Reference Manual
Event Driven Graphics
:
Pick Packet (edgPickPacket)
: Examples (Defining Pick Sequences)
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'
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')
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.
1974 to current year.
AVEVA Solutions Limited and its subsidiaries. All rights reserved.