Revit.SDK.Samples.CurtainWallGrid.CS.GridDrawing.SelectSegment C# (CSharp) Method

SelectSegment() public method

pick up a segment
public SelectSegment ( System mousePosition ) : void
mousePosition System /// the location of the mouse cursor ///
return void
        public void SelectSegment(System.Drawing.Point mousePosition)
        {
            bool mouseInGrid = VerifyMouseLocation(mousePosition);
             // mouse is outside the curtain grid boundary
             if (false == mouseInGrid)
             {
            return;
             }

             // select a segment of the U grid line
             SelectUSegment(mousePosition);

             // necessary
             // supposing the mouse hovers on the cross point of a U line and a V line, just handle
             // the U line, skip the V line
             // otherwise it allows users to select "2" cross lines at one time
             if (-1 != m_selectedUIndex)
             {
            return;
             }

             // select a segment of the V grid line
             SelectVSegment(mousePosition);
        }