Hi,
I'm programing in C# (visualStudio) and microstation V8i and I trying to use a mdlIntersect_allBetweenElms function and when I execute my program, I can get a vertex that intersect between two elements, but only first intersection, not a list of intersections into same two elements
This is my code
[DllImport("stdmdlbltin.dll", CallingConvention = CallingConvention.Cdecl)] public static extern int mdlIntersect_allBetweenElms(ref BCOM.Point3d isPnt1, ref BCOM.Point3d isPnt2, int isPntSize, int edP1, int edP2, BCOM.Matrix3d rotMatrixP, double tolerance); public static Intersect_allBetweenElmsResult Intersect_allBetweenElms(BCOM.Element elem, BCOM.Element elemIntersect) { BCOM.Point3d pnts1 = new BCOM.Point3d(); BCOM.Point3d pnts2 = new BCOM.Point3d(); var nIntersections = mdl.mdlIntersect_allBetweenElms(ref pnts1, ref pnts2, 5, elem.MdlElementDescrP(false), elemIntersect.MdlElementDescrP(false), app.Matrix3dIdentity(), 0.001); if (nIntersections > 0) { .... } .... return nIntersections; }
so...
I try to use an array Point3d[] at first and second parameters of this function, but an error is generated and does not give me any information about why, simply generate an error
I try to follow the example indicated at this post but doesnt work,
That is my example code
[DllImport("stdmdlbltin.dll", CallingConvention = CallingConvention.Cdecl)] public static extern int mdlIntersect_allBetweenElms(ref BCOM.Point3d[] isPnt1, ref BCOM.Point3d[] isPnt2, int isPntSize, int edP1, int edP2, BCOM.Matrix3d rotMatrixP, double tolerance); public static int Intersect_allBetweenElms(BCOM.Element elem, BCOM.Element elemIntersect) { BCOM.Point3d[] pnts1 = new BCOM.Point3d[5]; BCOM.Point3d[] pnts2 = new BCOM.Point3d[5]; // IF THIS FUNCTION FIND INTERSECTIONS BETWEEN THIS ELEMENTS, ONLY CRASH MY EXECUTION var nIntersections = mdl.mdlIntersect_allBetweenElms(ref pnts1, ref pnts2, 5, elem.MdlElementDescrP(false), elemIntersect.MdlElementDescrP(false), app.Matrix3dIdentity(), 0.001); if (nIntersections > 0) { ..... } ..... return nIntersections; }
I dont know why this error, my visualStudio not show more information about this error
Thsnks....
Kala