static List <AcDb.ObjectId> InsertAllParcel(BL blockLand, AcGe.Vector2d offset) { AcDb.Polyline2d curPolyline; AcGe.Point2dCollection points; List <AcDb.ObjectId> listObjectId = new List <AcDb.ObjectId>(); foreach (SR sr in blockLand.SR) { points = ServiceSimpleElements.Offset(ServiceIn4.GetPoints2dFromIn4Polygon(sr), offset); curPolyline = ServiceSimpleElements.CreatePolyline2d(points, true); listObjectId.Add(ServiceCAD.InsertObject(curPolyline)); } return(listObjectId); }
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(); }