| Author |
Message |
Eugene
Guest
|
Posted:
Tue Dec 07, 2004 12:17 am Post subject:
Format coodinate values per the Drawing Units precision sett |
|
|
I'm populating a txtbox with the coordinates of a selected point. What is the easiest way to format the number value per the Drawing Units setting?
Here is my code:
Private Sub tbCoords_Click()
Dim Pnt As Variant
Dim sPntX As String
Dim sPntY As String
Me.hide
Pnt = ThisDrawing.Utility.GetPoint(, "Select A Point")
sPntX = Pnt(0)
sPntY = Pnt(1)
tbMtxt.Text = "N = " & sPntY & " , " & "E = " & sPntX
Me.Show
End Sub
Best Regards,
Eugene
|
|
| Back to top |
|
 |
Jorge Jimenez
Guest
|
Posted:
Tue Dec 07, 2004 12:25 am Post subject:
Re: Format coodinate values per the Drawing Units precision |
|
|
unit=ThisDrawing.GetVariable("LUNITS")
precision=ThisDrawing.GetVariable("LUPREC")
sPntX= ThisDrawing.Utility.RealToString(Pnt(0), unit, precision)
sPntY= ThisDrawing.Utility.RealToString(Pnt(1), unit, precision)
--
Saludos, Ing. Jorge Jimenez, SICAD S.A., Costa Rica
"Eugene" <eburgy@entranco.com> wrote in message news:41b4af7c$1_2@newsprd01...
I'm populating a txtbox with the coordinates of a selected point. What is the easiest way to format the number value per the Drawing Units setting?
Here is my code:
Private Sub tbCoords_Click()
Dim Pnt As Variant
Dim sPntX As String
Dim sPntY As String
Me.hide
Pnt = ThisDrawing.Utility.GetPoint(, "Select A Point")
sPntX = Pnt(0)
sPntY = Pnt(1)
tbMtxt.Text = "N = " & sPntY & " , " & "E = " & sPntX
Me.Show
End Sub
Best Regards,
Eugene |
|
| Back to top |
|
 |
Eugene
Guest
|
Posted:
Tue Dec 07, 2004 12:55 am Post subject:
Re: Format coodinate values per the Drawing Units precision |
|
|
Worked great, thanks!
-Eugene
"Jorge Jimenez" <unknown@nospam.com> wrote in message news:41b4b218$1_2@newsprd01...
unit=ThisDrawing.GetVariable("LUNITS")
precision=ThisDrawing.GetVariable("LUPREC")
sPntX= ThisDrawing.Utility.RealToString(Pnt(0), unit, precision)
sPntY= ThisDrawing.Utility.RealToString(Pnt(1), unit, precision)
--
Saludos, Ing. Jorge Jimenez, SICAD S.A., Costa Rica
"Eugene" <eburgy@entranco.com> wrote in message news:41b4af7c$1_2@newsprd01...
I'm populating a txtbox with the coordinates of a selected point. What is the easiest way to format the number value per the Drawing Units setting?
Here is my code:
Private Sub tbCoords_Click()
Dim Pnt As Variant
Dim sPntX As String
Dim sPntY As String
Me.hide
Pnt = ThisDrawing.Utility.GetPoint(, "Select A Point")
sPntX = Pnt(0)
sPntY = Pnt(1)
tbMtxt.Text = "N = " & sPntY & " , " & "E = " & sPntX
Me.Show
End Sub
Best Regards,
Eugene
|
|
| Back to top |
|
 |
Tony Tanzillo
Guest
|
Posted:
Tue Dec 07, 2004 3:53 am Post subject:
Re: Format coodinate values per the Drawing Units precision |
|
|
Use -1 for the units and precision, and it will use
the current values of LUNITS and LUPREC.
--
http://www.caddzone.com
AcadXTabs: MDI Document Tabs for AutoCAD 2004/2005
http://www.acadxtabs.com
"Eugene" <eburgy@entranco.com> wrote in message news:41b4af7c$1_2@newsprd01...
I'm populating a txtbox with the coordinates of a selected point. What is the easiest way to format the number value per
the Drawing Units setting? |
|
| Back to top |
|
 |
|
|
|
|