CreateByIDs(OriginID: Integer; DestID: Integer): IMapArrow;
OriginID. Identifier of the territory being the arrow start point.
DestID. Identifier of the territory being the arrow end point.
The CreateByIDs method adds an arrow to the collection based on the specified identifiers of connected territories.
Executing the example requires a regular report with the REPORT identifier with a map on the report sheet.
Add links to the Map, Metabase, Report, Tab system assemblies.
Sub UserProc;
Var
Metabase: IMetabase;
MetabaseObject: IMetabaseObject;
Report: IPrxReport;
Sheets: IPrxSheets;
SheetT: IPrxTable;
Map: IMap;
Arrows: IMapLayerArrows;
Begin
Metabase := MetabaseClass.Active;
MetabaseObject := Metabase.ItemById("Report").Edit;
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;
// Add an arrow to the collection by specified identifiers of connected territories
Arrows.CreateByIDs(98,46);
// Add an arrow to the collection by specified names of connected territories
Arrows.CreateByNames("Amur region","Moscow region");
Report.MetabaseObject.Save;
End Sub UserProc;
After executing the example, arrows are created and added to the collection based on the specified identifiers and names of connected territories. These arrows are displayed on the map.
See also: