Message 1 of 2
Curve.GetDistanceAt(Point3d) eInvalidInput exception
Not applicable
03-14-2012
07:01 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi,
I'm trying to get the distance of a PLINE pickpoint from the start of the PLINE. I'm trying to us the Curve.GetDistanceAt(Point3d) method to accompliche the job (see code below). The code throws an eInvalidInput exception. Why?
Any thoughts?
The Poit3d argument is the pickpoint of the PLINE.
private double CurvePickPointDistance(ObjectId objectId, Point3d point3d)
{
double distance = 0;
using (Transaction transaction = Acad.Transaction)
{
try
{
using (Curve polyLine = (Curve) transaction.GetObject(objectId, OpenMode.ForRead))
{
distance = polyLine.GetDistAtPoint(point3d);
}
}
catch (Exception e) {}
}
return distance;
}