Hi
I have some views which have ‘crop view’ assigned. The crop region has been rotated and I’m trying to work out by how much so that I can sync this with a north point.
View direction (from Clockwork) returns I think the view plane - so a floor plan is 0,0,1. I think the parameter i need is ‘UpDirection’ but not sure how to retrieve it.
I though i could modify the Python script within the View.Direction custom node but it is returning different results.
import clr
clr.AddReference('RevitAPI')
from Autodesk.Revit.DB import *
clr.AddReference("RevitNodes")
import Revit
clr.ImportExtensions(Revit.GeometryConversion)
def ViewDirection(view):
if hasattr(view, "UpDirection"):
return view.UpDirection.ToVector()
else: return None
views = UnwrapElement(IN[0])
if isinstance(IN[0], list): OUT = [ViewDirection(x) for x in views]
else: OUT = ViewDirection(views)
Any suggestions?