コード例 #1
0
        public void CDS_CreateRandomPointsAtSpecifiedNumberByFactor()
        {
            PromptIntegerResult result = _editor.GetInteger(
                "\nEnter number of points to generate: ");

            if (result.Status != PromptStatus.OK)
            {
                return;
            }
            int numberOfPoints = result.Value;

            result = _editor.GetInteger(
                "\nEnter base number for first point: ");
            if (result.Status != PromptStatus.OK)
            {
                return;
            }
            uint basePoint = (uint)result.Value;

            ObjectIdCollection createdIds = createPoints(numberOfPoints);
            uint firstCreatedPointNumber  = getPointNumberFor(createdIds[0]);
            int  additiveFactor           = (int)(basePoint - firstCreatedPointNumber);
            CogoPointCollection points    = _civildoc.CogoPoints;

            points.SetPointNumber(ToEnumerable(createdIds), additiveFactor);
        }
コード例 #2
0
        public void CDS_RenumberPoint()
        {
            PromptIntegerResult result = _editor.GetInteger(
                "\nEnter point to renumber:");

            if (result.Status != PromptStatus.OK)
            {
                return;
            }
            uint currentPointNumber = (uint)result.Value;

            result = _editor.GetInteger("\nEnter new point number (hint):");
            if (result.Status != PromptStatus.OK)
            {
                return;
            }
            uint pointNumberHint = (uint)result.Value;

            try
            {
                CogoPointCollection points  = _civildoc.CogoPoints;
                ObjectId            pointId =
                    points.GetPointByPointNumber(currentPointNumber);
                points.SetPointNumber(pointId, getNextPointNumberAvailable(pointNumberHint));
            }
            catch (ArgumentException ex)
            {
                _editor.WriteMessage(ex.Message);
            }
        }
コード例 #3
0
        private void renumberPoints(ObjectIdCollection pointIds, uint basePoint)
        {
            CogoPointCollection points = _civildoc.CogoPoints;
            uint suggested             = basePoint;

            foreach (ObjectId pointId in pointIds)
            {
                suggested = getNextPointNumberAvailable(suggested);
                points.SetPointNumber(pointId, suggested);
                suggested++;
            }
        }
コード例 #4
0
        public void CDS_NaiveRenumberPoint()
        {
            PromptIntegerResult result = _editor.GetInteger(
                "\nEnter point to renumber:");

            if (result.Status != PromptStatus.OK)
            {
                return;
            }
            uint currentPointNumber = (uint)result.Value;

            result = _editor.GetInteger("\nEnter new point number:");
            if (result.Status != PromptStatus.OK)
            {
                return;
            }
            uint newPointNumber = (uint)result.Value;

            CogoPointCollection points  = _civildoc.CogoPoints;
            ObjectId            pointId = points.GetPointByPointNumber(currentPointNumber);

            points.SetPointNumber(pointId, newPointNumber);
        }