/// <summary> /// Видаляє елементи вектору з данними виносу. /// </summary> private void DeleteDrawingStakeOut() { ServiceCAD.DeleteObject(this.lineID); ServiceCAD.DeleteObject(this.txtID); this.txtID = AcDb.ObjectId.Null; this.lineID = AcDb.ObjectId.Null; }
private void AddLengthLine() { //AcDb.DBText oText; AcDb.MText oMText; AcDb.Line lineCur = null; AcDb.ObjectId idLineCur; AcGe.Point2d startPoint = this.Parcel.Points.ToArray()[this.Parcel.Points.Count - 1]; AcGe.Point3d midPoint; foreach (AcGe.Point2d endPoint in this.Parcel.Points) { midPoint = new AcGe.Point3d((endPoint.X + startPoint.X) / 2, (endPoint.Y + startPoint.Y) / 2, 0); lineCur = new AcDb.Line(new AcGe.Point3d(startPoint.X, startPoint.Y, 0), new AcGe.Point3d(endPoint.X, endPoint.Y, 0)); lineCur.ColorIndex = 222; lineCur.LineWeight = AcDb.LineWeight.LineWeight030; idLineCur = ServiceCAD.InsertObject(lineCur); ServiceCAD.ZoomCenter(midPoint, 1); /* * oText = new AcDb.DBText(); * oText.Height = 2 * this.SettingsForm.ScaleDrawing; * oText.TextString = startPoint.GetDistanceTo(endPoint).ToString("0.00").Replace(",","."); * //oText.Layer = settingsDrawing.Plan.LengthLine.Layer; * * ServiceCAD.ManualInsertText(oText); */ oMText = new AcDb.MText(); oMText.TextHeight = 2 * this.SettingsForm.ScaleDrawing; oMText.Attachment = AcDb.AttachmentPoint.MiddleCenter; //oMText.Layer = settingsDrawing.Plan.LengthLine.Layer; oMText.Contents = startPoint.GetDistanceTo(endPoint).ToString("0.00").Replace(",", "."); ServiceCAD.ZoomCenter(midPoint, 1); ServiceSimpleElements.ManualInsertMText(oMText); ServiceCAD.DeleteObject(idLineCur); startPoint = endPoint; } }
private void AddNumdersPoints() { int iCurNumberPoint = 0; //AcDb.DBText oText; AcDb.MText oMText; AcDb.Circle circleCurPoint = null; AcDb.ObjectId idCircleCurPoint; foreach (AcGe.Point2d point in this.Parcel.Points) { iCurNumberPoint += 1; circleCurPoint = new AcDb.Circle( new AcGe.Point3d(point.X, point.Y, 0), new AcGe.Vector3d(0, 0, 1), 1.75 * this.SettingsForm.ScaleDrawing); circleCurPoint.ColorIndex = 222; circleCurPoint.LineWeight = AcDb.LineWeight.LineWeight030; idCircleCurPoint = ServiceCAD.InsertObject(circleCurPoint); /* * oText = new AcDb.DBText(); * oText.TextString = Convert.ToString(iCurNumberPoint); * oText.Height = settingsDrawing.Plan.NumberPoint.TextHeight * this.SettingsForm.ScaleDrawing; * //oText.Layer = settingsDrawing.Plan.NumberPoint.Layer; */ oMText = new AcDb.MText(); oMText.TextHeight = 2 * this.SettingsForm.ScaleDrawing; oMText.Attachment = AcDb.AttachmentPoint.MiddleCenter; //oMText.Layer = settingsDrawing.Plan.LengthLine.Layer; oMText.Contents = Convert.ToString(iCurNumberPoint); ServiceCAD.ZoomCenter(new AcGe.Point3d(point.X, point.Y, 0), 1); ServiceSimpleElements.ManualInsertMText(oMText); ServiceCAD.DeleteObject(idCircleCurPoint); } }
private void PurgeFromElementsBlockLand() { if (this.currentBlockLand != null) { this.currentBlockLand = null; } if (!this.idCurrentHatchParcel.IsNull) { ServiceCAD.DeleteObject(this.idCurrentHatchParcel); this.idCurrentHatchParcel = new AcDb.ObjectId(); } marker_reSart_allIdBlockLandParcel: foreach (AcDb.ObjectId objectId in allIdBlockLandParcel) { ServiceCAD.DeleteObject(objectId); allIdBlockLandParcel.Remove(objectId); goto marker_reSart_allIdBlockLandParcel; } }
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(); }