Remove(Index: Integer; [Count: Integer = 1]);
Index. Index of the color in the collection, which is removed the first.
Count. The number of removed colors starting from the color, which index is specified. One color is removed by default.
The Remove method removes the specified number of colors from the collection. If the Count parameter is not specified, one color is removed by the specified index.
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;
BarVisual : IMapBarVisual;
Collection : IMapColorCollection;
Begin
Metabase := MetabaseClass.Active;
MetabaseObject := Metabase.ItemById("REPORT").Edit;
Report := MetabaseObject As IPrxReport;
Sheets := PrxReport.ActiveReport.Sheets;
SheetT := Sheets.Item(0) As IPrxTable;
Map := SheetT.TabSheet.Objects.Item(0).Extension As IMap;
BarVisual := Map.Layers.FindByName("Regions").Visuals.Item(0) As IMapBarVisual;
Collection := BarVisual.Color.Values;
Collection.Remove(1,3);
MetabaseObject.Save;
End Sub UserProc;
After executing the example the three colors are removed from the color set starting from the color, which index equals to 1.
See also: