.NET

Reply
Valued Contributor
netcai
Posts: 66
Registered: ‎07-22-2004
Message 1 of 2 (100 Views)

a bug in IsEqualTo method

100 Views, 1 Replies
06-21-2005 08:29 PM
i want judge two points is same ,so I use the following code ,but result is always that two points is same. Even polyline(pol) just has two different points.

Point3d startPnt = pol.GetPoint3dAt(0);
Point3d endPnt = pol.GetPoint3dAt(pol.NumberOfVertices-1);
Tolerance tr = new Tolerance(0,0);
if (startPnt.IsEqualTo(endPnt))
{
....
}
*Albert Szilvasy
Message 2 of 2 (100 Views)

Re: a bug in IsEqualTo method

06-21-2005 09:30 PM in reply to: netcai
I can confirm that this is a bug. Use the == or != operators instead. The
following works as expected:
Point3d pt1 = new Point3d(1, 0, 0);

Point3d pt2 = new Point3d(2, 0, 0);

Point3d pt3 = new Point3d(1,0,0);

Debug.Assert(pt1 != pt2 );

Debug.Assert(pt1 == pt3 );

wrote in message news:4881410@discussion.autodesk.com...
i want judge two points is same ,so I use the following code ,but result is
always that two points is same. Even polyline(pol) just has two different
points.

Point3d startPnt = pol.GetPoint3dAt(0);
Point3d endPnt =
pol.GetPoint3dAt(pol.NumberOfVertices-1);
Tolerance tr = new Tolerance(0,0);
if (startPnt.IsEqualTo(endPnt))
{
....
}
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.