I would like to orient an existing 3D view in a Revit project to an isometric southeast direction, for example, as the Home Orientation of the view cube of a 3D view.
It looks simple in Revit but I don’t find the way to do it using Dynamo.
If found the custom node “3DView Set Orientation” in the Package geniusloci, it works but I have to use an existing view as a reference to replicate the same orientation to a list of different 3D views. That means that I have to edit manually the orientation of one 3D view in Revit to make it work.
How can I set from Dynamo the orientation of a 3D view as the available in Revit: Orient to Direction, Orient to View, Orient to Plane…?
This node says it is based of the Ben Osborne script:
import clr clr.AddReference('ProtoGeometry') from Autodesk.DesignScript.Geometry import clr.AddReference("RevitNodes") import Revit clr.ImportExtensions(Revit.Elements) clr.AddReference("RevitAPI") import Autodesk clr.AddReference("RevitServices") import RevitServices from RevitServices.Persistence import DocumentManager from RevitServices.Transactions import TransactionManager The entries made in this node are stored as a list in the IN variables. doc = DocumentManager.Instance.CurrentDBDocument def ProcessList(_func, _list): return map( lambda x: ProcessList(_func, x) if type(x)==list else _func(x), _list ) def Unwrap(item): return UnwrapElement(item) if isinstance(IN, list): controlview = ProcessList(Unwrap, IN) else: controlview = [Unwrap(IN)] if isinstance(IN, list): views = ProcessList(Unwrap, IN) else: views = [Unwrap(IN)] TransactionManager.Instance.EnsureInTransaction(doc) for control in controlview: control.Unlock() viewSetting = control.GetOrientation() control.SaveOrientationAndLock() for view in views: view.Unlock() view.SetOrientation(viewSetting) view.SaveOrientationAndLock() TransactionManager.Instance.TransactionTaskDone() #Assign the output to the OUT variable. OUT = (controlview,views)
If somebody knows the solution it would be very helpful.