예제 #1
0
 public static bool IsPointInLineExtend(Line line, XYZ point)
 {
     if (GeomUtil.IsEqual(point, line.GetEndPoint(0)) || GeomUtil.IsEqual(point, line.GetEndPoint(1)))
     {
         return(true);
     }
     if (GeomUtil.IsSameDirection(GeomUtil.SubXYZ(point, line.GetEndPoint(0)), GeomUtil.SubXYZ(point, line.GetEndPoint(1))))
     {
         return(true);
     }
     return(false);
 }
예제 #2
0
        public static RebarHookOrientation GetHookOrient(Autodesk.Revit.DB.XYZ curveVec, Autodesk.Revit.DB.XYZ normal, Autodesk.Revit.DB.XYZ hookVec)
        {
            Autodesk.Revit.DB.XYZ tempVec = normal;

            for (int i = 0; i < 4; i++)
            {
                tempVec = GeomUtil.CrossMatrix(tempVec, curveVec);
                if (GeomUtil.IsSameDirection(tempVec, hookVec))
                {
                    if (i == 0)
                    {
                        return(RebarHookOrientation.Right);
                    }
                    else if (i == 2)
                    {
                        return(RebarHookOrientation.Left);
                    }
                }
            }

            throw new Exception("Can't find the hook orient according to hook direction.");
        }