private void PlaceProfileStationText() { for (int i = 0; (i * 100) <= (Length - 50); i++) { MText m = new MText() { Attachment = AttachmentPoint.BottomCenter, Contents = FormatStation(i * 100), TextHeight = 2.5, Location = new Point3d(InsertionPoint.X + (i * 100), InsertionPoint.Y + (VerticalScale * HorizontalLineCount + 2), InsertionPoint.Z), }; GridObjCollection.Add(m); } }
public void PlaceGridElevationText() { MText mText = new MText() { TextHeight = 3.5, Location = new Point3d(LeftBottomPt.X - 1, LeftBottomPt.Y, LeftBottomPt.Z), Layer = "TEXT-2", Attachment = AttachmentPoint.MiddleRight }; Transaction tr = Application.DocumentManager.MdiActiveDocument.Database.TransactionManager.StartTransaction(); using (tr) { TextStyleTable txtBlockTable = tr.GetObject(Application.DocumentManager.MdiActiveDocument.Database.TextStyleTableId, OpenMode.ForRead) as TextStyleTable; mText.TextStyleId = txtBlockTable["B"]; } int i = -30; int x = 0; while (i < 5) { MText mt = (MText)mText.Clone(); mt.Contents = FormatGridElevataion(i + 5); mt.Location = new Point3d(mText.Location.X, mText.Location.Y + (VerticalScale * x * 5), mText.Location.Z); GridObjCollection.Add(mt); i += 5; x++; } i = -30; x = 0; MText mTextEnd = (MText)mText.Clone(); mTextEnd.Location = new Point3d(LeftBottomPt.X + (Length + 1), LeftBottomPt.Y, LeftBottomPt.Z); while (i < 5) { MText mt = (MText)mTextEnd.Clone(); mt.Contents = FormatGridElevataion(i + 5); mt.Location = new Point3d(mTextEnd.Location.X, mTextEnd.Location.Y + (VerticalScale * x * 5), mTextEnd.Location.Z); mt.Attachment = AttachmentPoint.MiddleLeft; GridObjCollection.Add(mt); i += 5; x++; } }