Revit.SDK.Samples.Reinforcement.CS.BeamFramReinMaker.GetTopHookOrient C# (CSharp) Метод

GetTopHookOrient() приватный Метод

Get the hook orient of the top rebar
private GetTopHookOrient ( RebarGeometry geomInfo, TopRebarLocation location ) : RebarHookOrientation
geomInfo RebarGeometry the rebar geometry support information
location TopRebarLocation the location of top rebar
Результат RebarHookOrientation
        private RebarHookOrientation GetTopHookOrient(RebarGeometry geomInfo, TopRebarLocation location)
        {
            // Top center rebar doesn't need hook.
             if (TopRebarLocation.Center == location)
             {
            throw new Exception("Center top rebar doesn't have any hook.");
             }

             // Get the hook direction, rebar normal and rebar line
             Autodesk.Revit.DB.XYZ hookVec = m_geometry.GetDownDirection();
             Autodesk.Revit.DB.XYZ normal = geomInfo.Normal;
             Line rebarLine = geomInfo.Curves[0] as Line;

             // get the top start hook orient
             if (TopRebarLocation.Start == location)
             {
            Autodesk.Revit.DB.XYZ curveVec = GeomUtil.SubXYZ(rebarLine.get_EndPoint(1), rebarLine.get_EndPoint(0));
            return GeomUtil.GetHookOrient(curveVec, normal, hookVec);
             }
             else    // get the top end hook orient
             {
            Autodesk.Revit.DB.XYZ curveVec = GeomUtil.SubXYZ(rebarLine.get_EndPoint(0), rebarLine.get_EndPoint(1));
            return GeomUtil.GetHookOrient(curveVec, normal, hookVec);
             }
        }