.NET

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

a bug in IsEqualTo method

107 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 (107 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))
{
....
}
Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Announcements
Do you have 60 seconds to spare? The Autodesk Community Team is revamping our site ranking system and we want your feedback! Please click here to launch the 5 question survey. As always your input is greatly appreciated.