Skip to main content
Version: 20 R7 BETA

SVG Find element IDs by rect

SVG Find element IDs by rect ( {* ;} pictureObject ; x ; y ; width ; height ; arrIDs ) : Boolean

ParameterTypeDescription
*OperatorIf specified, pictureObject is an object name (string)
If omitted, pictureObject is a variable
pictureObjectPictureObject name (if * specified) or
Field or variable (if * omitted)
xIntegerHorizontal coordinate of top left corner of selection rectangle
yIntegerVertical coordinate of top left corner of selection rectangle
widthIntegerWidth of selection rectangle
heightIntegerHeight of selection rectangle
arrIDsText arrayIDs of elements whose bounding rectangle intersects with the selection rectangle
Function resultBooleanTrue = at least one element is found

Description

The SVG Find element IDs by rect command fills the Text or Alpha arrIDs array with the IDs ("id" or "xml:id" attribute) of the XML elements whose bounding rectangle intersects with the selection rectangle at the location specified by the x and y parameters.

The command returns True if at least one element is found (in other words if the arrIDs array is not empty), and False otherwise.

This command can be used in particular to manage interactive graphic interfaces.

If you pass the optional * parameter, you indicate that the pictureObject parameter is an object name (string). If you do not pass this parameter, you indicate that the pictureObject parameter is a field or a variable. In this case, you pass a field or variable reference (object field or variable only) instead of a string.

If you are working with a picture field or variable, the command uses the original picture, corresponding to the data source. However, if you are working with a form object, the command uses the current picture, that may have been modified via the SVG SET ATTRIBUTE command and that is kept with the properties of the form object.

The coordinates passed in the x and y parameters must be expressed in pixels in relation to the top left corner of the picture (0,0). You can use the values returned by the MouseX and MouseY System Variables. These variables are updated in the On Clicked and On Double Clicked form events as well as the in the On Mouse Enter and On Mouse Move form events.

Note: In the system of picture coordinates, [x;y] always specifies the same point, regardless of the picture display format, apart from the "Replicated" format.

All elements whose bounding rectangle intersects with the selection rectangle are taken into account, even those that are under other elements.

See also

SVG Find element ID by coordinates

Properties

Command number1109
Thread safe