Insert X Y into mtext format

Insert X Y into mtext format

Sgear
Advocate Advocate
772 Views
4 Replies
Message 1 of 5

Insert X Y into mtext format

Sgear
Advocate
Advocate

 

Hi

 

I am insert X Y into mtext how can I format X and Y  174.322867928177

 

 

Regards

Sgear

 

          Dim acDoc As Document = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument
            Dim acCurDb As Database = acDoc.Database

            Dim pPtRes As PromptPointResult
            Dim pPtOpts As PromptPointOptions = New PromptPointOptions("")
            '' Prompt for the start point
            pPtOpts.Message = vbLf & "Select point: "
            pPtRes = acDoc.Editor.GetPoint(pPtOpts)
            '   Dim ptStart As Point3d = pPtRes.Value
            Dim start_point As Point3d = pPtRes.Value

 

            Insert_mtext(start_point.X.ToString + ", " + start_point.Y.ToString, New Point3d(start_point.X, start_point.Y, 0))

 

 

0 Likes
Accepted solutions (2)
773 Views
4 Replies
Replies (4)
Message 2 of 5

Anonymous
Not applicable

You want to format a double value to a string with 12 digits?

Maybe NumberFormatInfo and NumberDecimalDigits will fit to your needs.

0 Likes
Message 3 of 5

Sgear
Advocate
Advocate
Accepted solution

 

 

Thanks henk.loonstra

 

will check this out with NumberFormatInfo and NumberDecimalDigits

was thinging how to get Latitude / Longitude with mouse click

 

Regards

Sgear

0 Likes
Message 4 of 5

Anonymous
Not applicable
Accepted solution

You have to convert from one coördinate system to another. Map 3D and Civil 3D have build-in functionality.

Maybe this articles from Kean Walmsley will shed some light on this topic:

http://through-the-interface.typepad.com/through_the_interface/2014/09/translating-between-autocad-d... 

0 Likes
Message 5 of 5

Sgear
Advocate
Advocate

Hi thanks for the help

 

Regards
Sgear

 

 

 

when I was reading Kean Walmsley web and search the forum I run into this 

http://forums.autodesk.com/t5/autocad-map-3d-developer/coordinate-conversion-using-the-net-api/td-p/...

0 Likes