# Arrays Rank and dimensions

**URL:** <https://tech-community.robotics.abb.com/t/arrays-rank-and-dimensions/535>\
**Category:** Developer Tools\
**Created:** [November 15, 2005, 8:42pm UTC](https://tech-community.robotics.abb.com/t/arrays-rank-and-dimensions/535 "2005-11-15T20:42:02Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![labu](https://avatars.discourse-cdn.com/v4/letter/l/a8b319/32.png) [@labu](https://tech-community.robotics.abb.com/u/labu)\
**Post date:** [November 15, 2005, 8:42pm UTC](https://tech-community.robotics.abb.com/t/arrays-rank-and-dimensions/535/1 "2005-11-15T20:42:02Z")

</div>

Hi,

I know the question has already been placed by Antoine but without any answer.

When a rapiddata returns IsArray, is there a way to know the rank and size of each dimensions.

there is a not too dirty solution with try/catch to get the number of dimensions (copied hereunder) but I do not see an acceptable workaround for the sizes.

As this information is available under the debug window via the dimensions int it should be possible to reach it from the application.

Any help warmly welcomed.

BR

Laurent

Note: Code to find an array number of dimensions

static int NbDim(RapidData d)  
{  
string s;

try  
{  
s=d.ReadItem(1).ToString();  
return 1;  
}  
catch  
{  
try  
{  
s=d.ReadItem(1,1).ToString();  
return 2;  
}  
catch  
{  
try  
{  
s=d.ReadItem(1,1,1).ToString();  
return 3;  
}  
catch  
{  
try  
{  
s=d.ReadItem(1,1,1,1).ToString();  
return 4;  
}  
catch  
{  
return -1;  
}  
}  
}  
}  
}
