.NET

Reply
Distinguished Contributor
JanetDavidson
Posts: 139
Registered: ‎08-23-2011
Message 1 of 7 (1,002 Views)
Accepted Solution

IntersectWith became obsolete in 2012

1002 Views, 6 Replies
08-23-2011 11:03 AM

Hello everybody.

I had this piece of code in 2010. Now when I re-reference the dll to 2012 . I get a warning message showing:

 

Public Sub IntersectWith( blah blah blah ) is obsolete. "Use the overload taking IntPrt instead.".  I don't know how . Anybody can help me with this ?

Already appreciated .

 

Janet,

 

 

Here is code.

 

Dim intpts As New Point3dCollection()

List_Entities(I).IntersectWith(List_Entities(I + 1), Intersect.OnBothOperands, intpts, 0, 0)

 

 

 

Using your code example, changing the function call to this should work:

 

List_Entities(I).IntersectWith(List_Entities(I + 1), Intersect.OnBothOperands, intpts, IntPtr.Zero, IntPtr.Zero)

 

*Expert Elite*
chiefbraincloud
Posts: 753
Registered: ‎02-13-2008
Message 2 of 7 (987 Views)

Re: IntersectWith became obsolete in 2012

08-23-2011 12:48 PM in reply to: JanetDavidson

I had the same thing come up, and while the "obsolete" version still works for now, it eventually won't.  As it turned out , the function where I had this warning come up was not being used, so my fix has not been tested.

 

Anyway, seeing that you were just passing zero (as I was) I think you just want to pass New IntPtr(0).

Dave O.                                                                  Sig-Logos32.png
Distinguished Contributor
JanetDavidson
Posts: 139
Registered: ‎08-23-2011
Message 3 of 7 (981 Views)

Re: Intersections became obsolete in 2012

08-23-2011 01:40 PM in reply to: chiefbraincloud

Thanks for Reply ,Chief.

What I need is just finding all intersections of objects Not only intpts(0). Is there anything wrong with the Zero I assigned for

thisGraphicSystemMarker  and otherGraphicSystemMarker ?. Is that what you referring to ?

Maybe this will clear my intention better.

 

 Dim intpts As New Point3dCollection()
                List_Entities(I).IntersectWith(List_Entities(I + 1), Intersect.OnBothOperands, intpts, 0, 0)
                If intpts.Count = 1 Then
                    ' Do this
else
   ' do something else.
end if.

 

*Expert Elite*
chiefbraincloud
Posts: 753
Registered: ‎02-13-2008
Message 4 of 7 (978 Views)

Re: Intersections became obsolete in 2012

08-23-2011 01:47 PM in reply to: JanetDavidson

My reply says New IntPtr (0), not intpts(0)...

 

I mean to pass New IntPtr(0) for the graphics system markers, but like I said, it doesn't give any compile errors, but I have not tested it to make sure that it works as expected.

Dave O.                                                                  Sig-Logos32.png
Board Manager
StephenPreston
Posts: 380
Registered: ‎05-22-2006
Message 5 of 7 (975 Views)

Re: Intersections became obsolete in 2012

08-23-2011 02:08 PM in reply to: JanetDavidson

Using your code example, changing the function call to this should work:

 

List_Entities(I).IntersectWith(List_Entities(I + 1), Intersect.OnBothOperands, intpts, IntPtr.Zero, IntPtr.Zero)

 

Cheers,

Stephen Preston
Autodesk Developer Network
Distinguished Contributor
JanetDavidson
Posts: 139
Registered: ‎08-23-2011
Message 6 of 7 (949 Views)

Re: Intersections became obsolete in 2012

08-23-2011 07:27 PM in reply to: StephenPreston

Stephen, Thanks. That was the trick.

It is hard for a girl to understand these things.

Regards,

Janet.

 

Contributor
Jozi68
Posts: 25
Registered: ‎07-23-2009
Message 7 of 7 (278 Views)

Re: Intersections became obsolete in 2012

01-23-2014 10:20 PM in reply to: JanetDavidson

I get the same error with the following code:

For i = 1 To NrV
                            Dim colI As New Point3dCollection
                            Dim colIT As New Point3dCollection
                            myLine.IntersectWith(pollie, Intersect.OnBothOperands, colI, 1, i)
                            myTempLine.IntersectWith(pollie, Intersect.OnBothOperands, colIT, 1, i)
                            If colI.Count > 0 And colIT.Count > 0 Then
                                For j = 0 To colI.Count - 1
                                    colIntersection.Add(colI(j))
                                Next j
                                For j = 0 To colIT.Count - 1
                                    colIntersectionT.Add(colIT(j))
                                Next j
                            End If
                        Next i

 Can someone please help me?

Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.
Need installation help?

Start with some of our most frequented solutions or visit the Installation and Licensing Forum to get help installing your software.