IntersectWith

IntersectWith

Anonymous
Not applicable
4,060 Views
3 Replies
Message 1 of 4

IntersectWith

Anonymous
Not applicable

Does IntersectWith work with 2011?  If not what is the fix?  Apparently I cannot find the apparent intersection point of two lines.

 

If I try to use IntersectWith, I get an error that it is obsolete.

0 Likes
4,061 Views
3 Replies
Replies (3)
Message 2 of 4

Anonymous
Not applicable

it's not an error, it's just a warning, as far as i know

 

Public Sub IntersectWith(ByVal entityPointer As Autodesk.AutoCAD.DatabaseServices.Entity, ByVal intersectType As Autodesk.AutoCAD.DatabaseServices.Intersect, ByVal points As Autodesk.AutoCAD.Geometry.Point3dCollection, ByVal thisGraphicSystemMarker As System.IntPtr, ByVal otherGraphicSystemMarker As System.IntPtr)

 

if you use integers as the last 2 parameters, you get the obsolete warning, use System.IntPtr instead

Message 3 of 4

Anonymous
Not applicable

Thanks this worked for me.

 

        'Setup 3d plane and point collection
        Dim myPlaneWCS As Plane = New Plane(New Point3d(0, 0, 0), New Vector3d(0, 0, 1))
        Dim myIntPntCol As Point3dCollection = New Point3dCollection()
        Dim myintptr01 As IntPtr = New IntPtr()
        Dim myintptr02 As IntPtr = New IntPtr()

 

        'Get intersecting point collection
        objFirstLine.IntersectWith(objSecondLine, Intersect.ExtendBoth, myPlaneWCS, myIntPntCol, myintptr01, myintptr02)

 

        Dim pntIntPnt As Point3d
        'Check if number of intersecting points is one
        If myIntPntCol.Count = 1 Then
            'Create a new point from intersecting point
            pntIntPnt = New Point3d(myIntPntCol(0).X, myIntPntCol(0).Y, 0)
        Else
            MsgBox("Intersecting error.", MsgBoxStyle.Critical, "")
            Exit Sub
        End If

Message 4 of 4

Anonymous
Not applicable

Thanks for posting this information it helped me out tremendously.

 

 

 

0 Likes