Count : Integer;
The Count property returns the size of arrows collection.
Executing the example requires a regular report with the REPORT identifier with a map on the report sheet.
Add links to the Drawing, Map, Metabase, Report, and Tab system assemblies.
Sub UserProc;
Var
Metabase: IMetabase;
MetabaseObject: IMetabaseObject;
Report: IPrxReport;
Sheets: IPrxSheets;
SheetT: IPrxTable;
Map: IMap;
Arrows: IMapLayerArrows;
Arrow: IMapArrow;
Count: Integer;
Begin
Metabase := MetabaseClass.Active;
MetabaseObject := Metabase.ItemById("Report").Bind;
Report := MetabaseObject As IPrxReport;
Sheets := Report.Sheets;
SheetT := Sheets.Item(0) As IPrxTable;
Map := SheetT.TabSheet.Objects.Item(0).Extension As IMap;
Arrows := Map.Layers.FindByName("Regions").Arrows;
Count := Arrows.Count;
Debug.WriteLine(Count.ToString);
// Get arrow by index and change its color
Arrow := Arrows.Item(1);
Arrow.Pen := GxColor.FromName("Blue") As IGxPen;
End Sub UserProc;
After executing the example the number of map arrows is displayed in the console window. Color of the arrow with the 1 index will be changed to blue.
See also: