This will label mtext 100 & 102 at the selected screen points with the
rotation of the axis from pnt & pnt2
hope this helps
John
Sub labeltext()
Dim pt1 As Variant
Dim Pt2 As Variant
Dim Leftendelevation As Double
Dim Rightendelevation As Double
Dim mtxtlabel As AcadMText
Dim dblrot As Double
pt1 = ThisDrawing.Utility.GetPoint(, "PICK FIRST RUNWAY END: LEFT TO RIGHT
")
' Get the value
Leftendelevation = 100#
Pt2 = ThisDrawing.Utility.GetPoint(pt1, "PICK SECOND RUNWAY END: ")
' Get the station
Rightendelevation = 102#
dblrot = ThisDrawing.Utility.AngleFromXAxis(pt1, Pt2)
Set mtxtlabel = ThisDrawing.ModelSpace.AddMText(pt1, dblWidth,
Leftendelevation)
mtxtlabel.Height = 5
mtxtlabel.Rotation = dblrot
Set mtxtlabel = ThisDrawing.ModelSpace.AddMText(Pt2, dblWidth,
Rightendelevation)
mtxtlabel.Height = 5
mtxtlabel.Rotation = dblrot
End Sub
wrote in message
news:[email protected]...
I need to be able to place text in Autocad while controlling the angle and
justification. And I am havig trouble doing both. I have known coordinates
to place the text. Can someone show me an example?