I am writing an Microstation Interop program that needs a copy parallel capability.
I have tried the folling code:
private void btnDoIt_Click(object sender, EventArgs e) { CopyParallel(); } private void CopyParallel() { int outE = 0; BIM.ElementEnumerator ee = activeModelReference.GetSelectedElements(); ee.MoveNext(); int inE = ee.Current.MdlElementDescrP(false); BIM.Point3d p = uStaApp.Point3dZero(); double distance = 20; BIM.Point3d plane = new BIM.Point3d(); plane.X = 0; plane.Y = 0; plane.Z = 1; mdlElmdscr_copyParallel(ref outE, inE, ref p, distance, ref plane); } [DllImport(@"C:\Program Files (x86)\Bentley\MicroStation V8i (SELECTseries)\MicroStation\stdmdlbltin.dll", CallingConvention = CallingConvention.Cdecl)] public static extern int mdlElmdscr_copyParallel (ref int outElement, int inElement, ref BIM.Point3d p, double distance, ref BIM.Point3d plane);****************************************************When I run the program I get an exception:Attempted to read or write protected memory. This is often an indication that other memory is corrupt.Question is how to call the mdlElmdscr_copyParallel from the interop program.
Hi,willmartinpe,Is your problem solved? I have encountered the same problem now. Can I ask your solution?
Hi Alisa,
because the discussion is quite old, I recommend to post a new question. Please also follow best practices, because it's not clear what product, version and API do you use.
If you use MicroStation, I recommend to post your question (with e.g. link to this discussion) to MicroStation Programming forum and to don't use this quite general and not MicroStation-specific one.
With regards,
Jan
Bentley Accredited Developer: iTwin Platform - AssociateLabyrinth Technology | dev.notes() | cad.point