.NET
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic to the Top
- Bookmark
- Subscribe
- Printer Friendly Page
Curve.GetD istanceAt( Point3d) eInvalidIn put exception
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
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;
}
Re: Curve.GetD istanceAt( Point3d) eInvalidIn put exception
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
I don't think the pickpoint is necessarily on the actual polyline itself. You can find the closest point using the polyline's method GetClosestPointTo(pickedpoint, True)
-Mark
