Revit API Forum
Welcome to Autodesk’s Revit API Forums. Share your knowledge, ask questions, and explore popular Revit API topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Northing Easting

2 REPLIES 2
SOLVED
Reply
Message 1 of 3
sanjaymann
1084 Views, 2 Replies

Northing Easting

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

 

2 REPLIES 2
Message 2 of 3
sanjaymann
in reply to: sanjaymann

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:

loc

 

 

 

 

 

 

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

Message 3 of 3
sanjaymann
in reply to: sanjaymann

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.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Rail Community