- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi all,
I'm using AutoCAD 2013 x64 and VS2012 Express with ObjectARX 2013.
Now I want to calculate the (projected) intersection point of 2 (intersecting) lines in vb.net
After selecting the lines I have this code:
line1.IntersectWith(line2, Intersect.OnBothOperands, intpts, 0, 0)
In Visual studio express 2012 I get the following warning for the above line of code:
warning BC40000: 'Public Sub IntersectWith(entityPointer As Autodesk.AutoCAD.DatabaseServices.Entity, intersectType As Autodesk.AutoCAD.DatabaseServices.Intersect, points As Autodesk.AutoCAD.Geometry.Point3dCollection, thisGraphicSystemMarker As Long, otherGraphicSystemMarker As Long)' is obsolete: 'Use the overload taking IntPtr instead.'.
So, if I'm reading this correctly, this method is outdated and I should use an other method to calculate the intersection.
But I really don't know what 'Use the overload taking IntPtr instead' means.
I have searched on a lot of forums, but I can't seem to find an answer. All the answers I could find were essentially the same function.
One of the things I found is a function that contains this line of code:
Dim inters As Point3d = line1.IntersectWith(line2)(0)
This one looks almost the same, but doesn't give me the warning when I compile the code, but this method crashes AutoCAD when there is no intersection between the lines. This is despite a try catch block that surrounds the code.
Can anybody point me in the right direction?
For now I just want to use lines, but I need to expand the code so it will also work with circles, arcs and polylines.
Solved! Go to Solution.