/// <summary> /// Iterates over all dimensions in this cube /// and stores them in the dimensions List /// </summary> public void setDimensions() { int nOfDims = getNumberOfDimensions(); for (int i = 1; i <= nOfDims; i++) { int hDim = TM1API.TM1ObjectListHandleByIndexGet(this.pool.handle, this.handle, TM1API.TM1CubeDimensions(), TM1API.TM1ValIndex(this.pool.handle, i)); //if (TM1API.IsError(this.server.user.handle, hDim)) // throw new Exception(); //int nameProp = TM1API.TM1ObjectPropertyGet(pool.handle, hDim, TM1API.TM1ObjectName()); // WORKS!!!!!! //string dimName = TM1API.intPtrToString(server.user.handle, nameProp); dimensions.Add(new Dimension(pool, server, hDim)); } }
/// <summary> /// Calculates the number of Dimensions in the cube /// </summary> /// <returns>Number of dimensions in this cube</returns> public int getNumberOfDimensions() { int viDimCount = TM1API.TM1ObjectListCountGet(this.pool.handle, this.handle, TM1API.TM1CubeDimensions()); int number = TM1API.TM1ValIndexGet(server.user.handle, viDimCount); return(number); }