Message 1 of 13
ref SAFEARRAY(double)

Not applicable
05-05-2009
01:43 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello,
I have problem understanding how to pass arrays by ref from C#. I will illustrate using Point.GetPointData for simplicity.
The is working:
I have problem understanding how to pass arrays by ref from C#. I will illustrate using Point.GetPointData for simplicity.
The is working:
Point TestPoint = oApp.TransientGeometry.CreatePoint(0, 0, 0);
System.Array pointCoords1 = new double[3];
TestPoint.GetPointData(ref pointCoords1);
This will not compile because pointCoords2 is unassigned.
System.Array pointCoords2;
TestPoint.GetPointData(ref pointCoords2);
This will not compile either:
double[] pointCoords3;
TestPoint.GetPointData(ref pointCoords3);
TestPoint.GetPointData(ref (pointCoords3 as System.Array));
My questions are:
What is the preferred way of doing this?
Say I want to use SurfaceEvaluator.GetParamAtPoint, how do I know the dimension of the solutionNatures[] parameter?
/Johan