0

If an Element is family instance then:

(FamilyInstance.Location as LocationPoint).Rotation;

I can easily get a rotation easily for family instance.

If I try for wall

Curve curve = ((Wall).Location as LocationCurve).Curve;

Or anything like that.

For example :

  1. In preceding image, trying to rotate wall to 90 Degree. normal wall

  2. In below Image, after rotating 90 Degree wall after rotation

Need to get the rotated angle of the wall.

Joey Phillips
  • 1,543
  • 2
  • 14
  • 22
Arvind Maurya
  • 910
  • 12
  • 25
  • So.. what are you trying to do? This seems like a very unclear question. From the title, I can assume. From your code, there is no description of much else. Please elaborate quite a bit more. – Jaskier Sep 12 '18 at 20:17
  • I placed a wall in Revit project and rotate wall by 90 degree, now i need to get the rotation angle of wall. – Arvind Maurya Sep 12 '18 at 20:20
  • @Symon , can you please have a look at the issue again, I have modified with example. – Arvind Maurya Sep 12 '18 at 20:34

1 Answers1

2

If your wall curve is a straight line, you can just grab the angle from the line: let V be the vector from the wall curve start to end point, and determine its angle to the X axis: angle = V.AngleTo(XYZ.BasisX).

Jeremy Tammik
  • 7,333
  • 2
  • 12
  • 17