Example #1
0
        private void AutoSearchingStationAndOrientationForPoint(StakeOutParcelPoint stakeOutPoint)
        {
            int indexRow = this.currentParcel.StakeOutParcelPoints.FindIndex(x => x.Equals(stakeOutPoint));

            if (stakeOutPoint.AutoSetStationAndOrientation(this.basePoints))
            {
                this.dataGridView_StakeOut[2, indexRow].Value = stakeOutPoint.PointStation.Name;
                this.dataGridView_StakeOut[3, indexRow].Value = stakeOutPoint.PointOrientation.Name;
            }
        }
Example #2
0
        private void ComboBoxNumberParcel_SelectedIndexChanged(object sender, EventArgs e)
        {
            this.Text          = this.comboBoxNumberParcel.SelectedItem.ToString();
            this.currentParcel = ServiceIn4.GetParcelForCadarstralNumber
                                     (this.currentBlockLand, this.comboBoxNumberParcel.SelectedItem.ToString());
            if (!this.idCurrentHatchParcel.IsNull)
            {
                ServiceCAD.DeleteObject(this.idCurrentHatchParcel);
                ServiceCAD.DeleteObjects(this.idNeighborsCurrenParcel);
            }

            serviceParcel = new ServiceParcel(this.currentParcel, this.formSettings);

            AcGe.Point2dCollection pointsCurrentHatchParcel =
                ServiceSimpleElements.Offset(this.currentParcel.Points, this.offsetBlockLandView);
            AcDb.ObjectId idPolyline2d =
                ServiceCAD.InsertObject(ServiceSimpleElements.CreatePolyline2d(pointsCurrentHatchParcel, true));
            AcDb.Hatch curHatch =
                ServiceSimpleElements.CreateHatch(new AcDb.ObjectIdCollection(new AcDb.ObjectId[] { idPolyline2d }));
            this.idCurrentHatchParcel =
                ServiceCAD.InsertObject(curHatch);
            ServiceCAD.DeleteObject(idPolyline2d);


            // =======================================================

            if (this.currentParcel.StakeOutParcelPoints != null)
            {
                this.currentParcel.StakeOutParcelPoints.Clear();
            }

            StakeOutParcelPoint stakeOutParcelPoint;

            this.dataGridView_StakeOut.ClearSelection();
            this.dataGridView_StakeOut.Rows.Clear();

            int indexPoint = 0;

            object[] row = new object[2];

            foreach (AcGe.Point2d point in this.currentParcel.Points)
            {
                indexPoint++;

                stakeOutParcelPoint = new StakeOutParcelPoint
                {
                    ScaleDrawing = this.drawingSettings.Scale.Value,
                    Name         = indexPoint.ToString(),
                    Coordinates  = point
                };

                this.currentParcel.StakeOutParcelPoints.Add(stakeOutParcelPoint);
                row[0] = false;
                row[1] = indexPoint.ToString();

                this.dataGridView_StakeOut.Rows.Add(row);
            }

            SetColPointStationAndOrientationItems();
            AutoSearchingStationAndOrientationForAllPoints();

            this.dataGridView_StakeOut.Update();

            ReLoad_treeViewParcel();
        }