Remove(Index: Integer; [Count: Integer = 1]);
Index - collection color index that will be a start point for the removal.
Count - number of the colors being removed starting from the color with the specified index. One color is removed by default.
The Remove method removes the specified number of colors from the collection. In case the Count parameter is not specified, one color is removed by the specified index.
Sub main;
Var
Metabase : IMetabase;
MetabaseObject: IMetabaseObject;
Report: IPrxReport;
Map : IMap;
BarVisual : IMapBarVisual;
Collection : IMapColorCollection;
Begin
Metabase := MetabaseClass.Active;
MetabaseObject := Metabase.ItemById("MAP_ARROW").Edit;
Report := MetabaseObject As IPrxReport;
Map := Report.ActiveSheet.Table.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 main;
After executing the example the three colors are removed from the color set starting from the color, which index equals to 1.
See also: