Description
Parses the selection and returns a multi-columns array with data about each element in the selection, and also summary data as: total number of elements in the selection, the Z-order of the lowest object, and the index of the lowest object and other.
Note: the number of columns is 50 in older versions, 80 since v30 and 90 since v51. Since v31 it collects all Tool properties. Since v32 added GetRAY to ob(t,79) and GetRAH to ob(t,80); added page.selement.textformatid to ob(t,40); ob(t, 40) is checked for linked txt id to avoid to use current text. Since v33 it contains number of paragraphs in the ob(t,74). Since v34 it contains de_margins in ob(t,43-46). Since v35 added more summary data: 0,20=head;21=kicker;22=subhead;23=intro;24=pullquote;25=jumphead;26=body;27=photocaption;28=photo. Since v36, improved disable draw handling. Since v38 it returns the name of the logical group in the ob(t,47).
The number of returned rows in the array is 10 more than the number of selected elements. This allows to add elements to the existing array, e.g. when boxing elements. The number of non-null elements is in element 0,0.
Note: this function should be used on an ungrouped selection. If used on grouped selection, for all objects the same x,y,w, and h is returned. See remarks.
Syntax
Dim aObjs(,) As Object = PushSelectionEx([bDisableDraw])
|
bDisableDraw
an optional parameter. If True or skipped, the PushSelectionEx performs internal DisableDraw. If False, it does not.
Array values
Summary values
(0,0) | number of items in the selection; useful when enumerating; keep in mind the first item index is 1 and not 0. |
(0,1) | minZOrder, allows to identify the lowest element |
(0,2) | index of the element with the lowest Z-order |
(0,3) | index of the most right element |
(0,11-14) | x,y,w,h of overall selection |
(0,20-31) | idx of elements of given type in this array |
Values for each element
(t,0) | object id; use to reselect it, with Page.GetSelectedId |
(t,1-4) | x,y,w,h of element |
(t,5) | rotation angle, as Page.GetSelectedAngle |
(t,6) | object kind, as Page.GetSelectedKind |
(t,7) | object Z-order, as Page.GetSelectedZOrder |
(t,8) | border weight, as Page.ObjGetBorderWeight |
(t,9) | DE activation status (text wrap), from obj.DE_Active. |
(t,10) | object type as Page.ObjGetTypeId |
(t,11-14) | index of object neighbors (L,R,T,B), or empty string if no neighbor on given side. |
(t,15-18) | margin to the neighbors (L,R,T,B), or -1 if no neighbor on given side. |
(t,21-24) | new x,y,w,h, if object was moved/resized by an external process |
(t,25-28) | 25 = strBorderColor = Fred.GetObjColor(0) |
| 26 = strPaperColor = Fred.GetObjColor(1) |
| 27= strGradientColor = Fred.GetObjColor(2) |
| 28= strGradientType = Fred.GetObjColor(-1) |
(t,30) | element id (for text or image) |
(t,31) | image subtype, obtained by ImgSubType function |
(t,32) | index of the fullheight body frame |
(t,33) | is grouped (0-no, 1=yes), as Page.ObjTestGrouped |
(t,35) | article content pos ID 'v51 |
(t,36) | lg content pos ID 'v51 |
(t,37)
(t,39) | -1 by default, or y (used for bouncing) |
(t,40) | formatid, as Fred.GetActiveTxt.FormatId or as Page.SelElement.TextFormatId (only for frames) |
(t,41) | typename as Fred.GetTypeNameFromId(Page.ObjGetTypeId) |
(t,42) | TRUE if the frame contains local text, FALSE if not |
(t,47) | name of the logical group |
TOOL VALUES (for images and frames only)
(t,50) | -1 if default values, 1 if changed from default |
(t,72) | getRAY - new y-pos of the frame cut by runaround |
(t,73) | GetRAH - new total height of the frame cut by runaround |
(t,74) | Number of paragraphs in text |
Remarks
•Use PopSelection just reselects all, if you pass it the array returned by PushSelectionEx. PopSelectionEx reselects all but the specified element, or reselect all and re-activates text wrap status.
•If you have to use PushSelectionEx on a grouped selection, then you have to ungroup it first. Use ObjTestGrouped and ObjUngroupEx
if Page.ObjTestGrouped = 1 then Page.ObjUngroupEx (false)
dim aObjs = PushSelectionEx ' store selection
Examples of calls
Read items in a loop
For t As Integer = 1 To CInt(aobjs(0, 0))
...
next
Read various types
If CInt(aobjs(t, 6)) = POK.oFrame Then
If CStr(aobjs(t, 41)) <> photoname Then
If CBool(aobjs(t, 42)) = True Then