WriteIsActive(Segment: ICubeSegment; Value: Boolean);
Segment. The segment, for which activity indicator should be changed.
Value. Segment activity value that should be set.
The WriteIsActive method changes activity indicator for the specified segment.
Active segment settings are applied during the work under the user who has permissions for these segments. New segments are always active by default. To change segment activity value and exclude its from the work, set the Value parameter to False. To restore activity, set the parameter to True.
Executing the example requires that the repository contains a standard cube with the STD_CUBE identifier. A segment container is connected to the cube.
Add links to the Cubes and Metabase system assemblies.
Sub UserProc;
Var
Mb: IMetabase;
Cube: IStandardCube;
SegContainer: ICubeSegmentContainer;
Segments: ICubeSegments;
Segment: ICubeSegment;
bActive: Boolean;
Begin
Mb := MetabaseClass.Active;
Cube := Mb.ItemById("STD_CUBE").Bind As IStandardCube;
// Get cube segment container
SegContainer := Cube.SegmentContainer;
// List of all segments
Segments := SegContainer.GetAllSegments;
Segment := Segments.Item(0);
// Get segment activity value
bActive := SegContainer.ReadIsActive(Segment);
Debug.WriteLine("Active: " + bActive.ToString);
// Change segment activity value
SegContainer.WriteIsActive(Segment, Not bActive);
End Sub UserProc;
After executing the example the first segment of the specified cube is obtained. The segment activity value is changed to the opposite one.
See also: