Raading a matrix

Questions regarding the use of the .NET SDK 2.0 for Server or Client development or integration into customer products ...

Moderator: uasdknet

Post Reply
moff
Full Member
Full Member
Posts: 7
Joined: 13 Sep 2016, 12:32

Raading a matrix

Post by moff »

Hi,

How can I read a two dimensional variant matrix?

Many Thanks

moff
Full Member
Full Member
Posts: 7
Joined: 13 Sep 2016, 12:32

Re: Raading a matrix

Post by moff »

Hi, I found the solution: cast to Matrix and use ToArray:

var uaMatrix = m_DataValue.Value as Matrix;
var data = uaMatrix.ToArray();

Then iterate and GetValue:

for (var i = 0; i < uaMatrix.Dimensions[0]; i++)
{
for (var j = 0; j < uaMatrix.Dimensions[1]; j++)
{
var uaValue = (Variant)data.GetValue(i, j);
..
:-)

Post Reply