Hi,
I have obtained the start and end point of a beam by getting its locatiocurve. Now how do I convert these start and and points x,y to northing easting.
Thanks & Regards
Solved! Go to Solution.
Solved by sanjaymann. Go to Solution.
I was able to convert the coordinates to northing easting[ survey points]. using the following code:
ProjectPosition projectPosition =Command.activeDoc.ActiveProjectLocation.get_ProjectPosition(XYZ.Zero);
// Create a translation vector for the offsets
XYZ translationVector = new XYZ(projectPosition.EastWest, projectPosition.NorthSouth, projectPosition.Elevation);
Transform translationTransform = Transform.get_Translation(translationVector);
// Create a rotation for the angle about true north
//const double angleRatio = Math.PI / 180; // angle conversion factor
Transform rotationTransform = Transform.get_Rotation(XYZ.Zero, XYZ.BasisZ, projectPosition.Angle);
// Combine the transforms
Transform finalTransform = translationTransform.Multiply(rotationTransform);
XYZ got = finalTransform.OfPoint(lp.Curve.get_EndPoint(0));
but when i annotate the beam manually there is a difference as you can see in the below screeshot:
While annotating I have picked the start center and end center of the beam. As you might have noticed there is difference in the x,y generated through program and N E annotated manually.
The x,y generated has to be equal to NE annotation. How do I get this. Guidance and help needed.
Thanks & Regards
Solved.
My Bad.
The code was working fine and gave accurate results The beam was drawn using side1 or side2 lateral justification and I was comparing the results with center justification.