protected void FindNextAndPrevLabel() { TSM.Grid modelGrid = Extensions.SelectModelObject(_fatherGrid.ModelIdentifier.ID) as TSM.Grid; string gridLabelsX = modelGrid.LabelX; string gridLabelsY = modelGrid.LabelY; string[] labelsX = gridLabelsX.Split(null); string[] labelsY = gridLabelsY.Split(null); string nextLabel, prevLabel, curLabel; if (!String.IsNullOrEmpty(_relatedGridLine.StartLabel.GridLabelText)) { curLabel = _relatedGridLine.StartLabel.GridLabelText; } else { curLabel = _relatedGridLine.EndLabel.GridLabelText; } Extensions.FindNextAndPreviousLabelText(curLabel, labelsX, labelsY, out prevLabel, out nextLabel); _nextLabelText = nextLabel; _prevLabelText = prevLabel; }
protected void GetOrientation() { /* Поиск направления оси X гридлайна */ LineSegment gridLineAxisX = new LineSegment(_relatedGridLine.StartLabel.CenterPoint, _relatedGridLine.EndLabel.CenterPoint); TSM.Grid modelGrid = (TSM.Grid)Extensions.SelectModelObject(_fatherGrid.ModelIdentifier.ID); CoordinateSystem gridCS = modelGrid.GetCoordinateSystem(); Vector gridLineX = gridLineAxisX.GetDirectionVector(); Vector gridX = gridCS.AxisX; /* Определение параллельности оси X гридлайна оси грида */ if (Tekla.Structures.Geometry3d.Parallel.VectorToVector(gridLineX, gridX)) { _isParallelToX = true; } else { _isParallelToX = false; } }