VB.NET Intersectwith in R2010
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi,
I trying to use the Intersectwith method to identify the crossing of a Ray with a closed linear object such as a circle, ellipse, polyline and spline and thereby determine if the point is inside the closed object.
objRay.IntersectWith(pPolyline, Intersect.OnBothOperands, cc, hIntersectionPoints, IntPtr.Zero, IntPtr.Zero) ' The line of code above is in a called function 'IsPointInPolyLine', but the program stops at the calling line below unless I comment this line out. Dim bTest As Boolean = IsPointInPolyLine(myPLine, Pt)
However when I try to run the code I get a report that:
"System.MissingMethodException was unhandled by user code
Message="Method not found: 'Void Autodesk.AutoCAD.DatabaseServices.Entity.IntersectWith(Autodesk.AutoCAD.DatabaseServices.Entity, Autodesk.AutoCAD.DatabaseServices.Intersect, Autodesk.AutoCAD.Geometry.Plane, Autodesk.AutoCAD.Geometry.Point3dCollection, Int64, Int64)'."
Source="Laurie"
StackTrace:
at Laurie.Test.IsPointInPolyLine(Polyline2d pPolyline, Point3d pPoint)
at Laurie.Test.TestBoolean() in D:\Documents\Visual Studio 2005\Projects\Laurie\Laurie\Test.vb:line 454
at Autodesk.AutoCAD.Runtime.CommandClass.InvokeWorker(MethodInfo mi, Object commandObject, Boolean bLispFunction)
at Autodesk.AutoCAD.Runtime.CommandClass.InvokeWorkerWithExceptionFilter(MethodInfo mi, Object commandObject, Boolean bLispFunction)
at Autodesk.AutoCAD.Runtime.PerDocumentCommandClass.Invoke(MethodInfo mi, Boolean bLispFunction)
at Autodesk.AutoCAD.Runtime.CommandClass.CommandThunk.Invoke()"
This is using Visual Studio 2005 on a 64 bit Win 7 O/S.
There have been previous reports of the this error, but despite searching the newsgroup and google I cannot find one wher a solution is actually offered.
A further point at issue, is that once I get the method to work, is that I'm unclear on what an "AutoCAD.Geometry.Plane" is and how one should be defined in order to use it in the "IntersectWith" method.
Using Auo-complete to create my code I had simply used a line:
"Dim objPlane as New Autodesk.AutoCAD.Geometry.Plane"
If I'm stuck with having to "roll my own" to get around this problem, it easy enough for Polylines and circles, but splines and ellipses would seem to be an issue. Has anyone tried to do this?
Regards,
Laurie Comerford