private static bool ninetycheck(Point3d pt1, Curve curve)
{
Editor MyEditor = Application.DocumentManager.MdiActiveDocument.Editor;
Matrix3d mat = MyEditor.CurrentUserCoordinateSystem;
Point3d basept = pt1.TransformBy(mat);
Point3d pt = curve.GetClosestPointTo(basept, false);
Vector3d v3d = basept.GetVectorTo(pt);
Vector3d derv3d = curve.GetFirstDerivative(pt);
if (v3d.IsPerpendicularTo(derv3d))
{
return true;
}