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
- 396 UpFeed
- 18 Tutorials
- 13 RobotApps
- 297 PowerPacs
- 405 RobotStudio S4
- 1.8K Developer Tools
- 250 ScreenMaker
- 2.8K Robot Controller
- 316 IRC5
- 61 OmniCore
- 7 RCS (Realistic Controller Simulation)
- 798 RAPID Programming
- AppStudio
- 3 RobotStudio AR Viewer
- 18 Wizard Easy Programming
- 105 Collaborative Robots
- 5 Job listings