Retrieving UCS coordinates

Retrieving UCS coordinates

OceanaPolynom
Advocate Advocate
954 Views
4 Replies
Message 1 of 5

Retrieving UCS coordinates

OceanaPolynom
Advocate
Advocate

Hello

I have  drawing which uses a USC.  I need to get the USC coordinates of the objects in the drawing.  Using ThisDrawing.Utility.GetEntity gets the World coordinates only.  Is there another solution?

John

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

grobnik
Collaborator
Collaborator
Accepted solution

Hi @OceanaPolynom 

Here a post where explains how to translate point from wcs to ucs using .TranslateCoordinates

https://forums.autodesk.com/t5/vba/translate-point-from-wcs-to-ucs-using-translatecoordinates/m-p/84...

 

Probably could help you more, finding your object coordinates, and translating referring to UCS.

0 Likes
Message 3 of 5

OceanaPolynom
Advocate
Advocate
Accepted solution

Hello

My situation was somewhat dissimilar.  Here is what worked.

 Private Sub CommandButtonTranslate_Click()
 	Dim pointcoords(0 To 2) As Double
 	'419.984252968843,235.684028561105,61.59
 	pointcoords(0) = 419.984252968843
 	pointcoords(1) = 235.684028561105
 	pointcoords(2) = 61.59
 	Dim point_translated As Variant
 	Dim pointUCS As Variant
 	pointUCS = ThisDrawing.Utility.TranslateCoordinates(pointcoords, acWorld, acUCS, False)
 	' Display the coordinates of the point
 	MsgBox "The point has the following coordinates:" & vbCrLf & _
	"WCS: " & pointcoords(0) & ", " & pointcoords(1) & ", " & pointcoords(2) & vbCrLf & _
	"UCS: " & pointUCS(0) & ", " & pointUCS(1) & ", " & pointUCS(2), , "TranslateCoor"
End Sub

 The attached file is in a UCS where the cross section is perpendicular to the line.  The point is in World coordinates.

The point is the Center Point of one of the 8 arcs forming the cross section.  The translated position can be checked in AutoCad and is correct.

0 Likes
Message 4 of 5

grobnik
Collaborator
Collaborator

@OceanaPolynom 

Hi, thank you for your reply, and solved "flag", but really I didn't understand if your issue has been solved or not ?

You attached a part of code, where you indicated as worked ?! so means you solve your issue.

In any case let us know, probably, now with a code and an example dwg we can investigate more.

Thank you.

0 Likes
Message 5 of 5

OceanaPolynom
Advocate
Advocate

Hello

I am a construction surveyor, we are about to begin constructing a tunnel. The cross sectional shape of the tunnel is composed of 8 circular arcs and 2 short line segments.  The design is on national grid coordinates, this will be the World Coordinate System in AutoCad.  In the attached dwg file the design cross section is located perpendicular to the design center line so that it creates a plane where the first element of a point, P(0), is always equal to 0.  That is the UCS in AutoCad.  During tunnel excavation it is necessary to measure the excavation and compare it to the design.  Points are measured around a cross section.  A report must be created showing the distance from each measured point to the closest location on the appropriate arc segment as well as the distance the measured point is from the plane of the cross section.  These calculations must be done on the UCS.  The measured points will be on the national grid and therefore must be converted to the correct UCS.  I am currently working on a solution to drawing the reports.  I will be glad to post it when it works.

John

0 Likes