
Arrays Rank and dimensions

labu
✭✭
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;
}
}
}
}
}
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;
}
}
}
}
}
0
Categories
- All Categories
- 5.5K RobotStudio
- 398 UpFeed
- 19 Tutorials
- 13 RobotApps
- 299 PowerPacs
- 405 RobotStudio S4
- 1.8K Developer Tools
- 250 ScreenMaker
- 2.8K Robot Controller
- 324 IRC5
- 63 OmniCore
- 7 RCS (Realistic Controller Simulation)
- 813 RAPID Programming
- 5 AppStudio
- 3 RobotStudio AR Viewer
- 19 Wizard Easy Programming
- 105 Collaborative Robots
- 5 Job listings