Orient 3D Views to Section Views

Hello,

I am creating 3D views in Revit and trying to orient them to each section view in the project. I am trying with the attached Dynamo graph.

It orients the 3D views fine but I cannot crop it out (front/back and top/bottom/left/right) to show the exact region.

Orient To View.dyn (13.6 KB)

Hi @theshysnail, try to use the View CropBox node from the GeniusLoci package, it works well on slanted sections as well:

2 Likes

It does not crop out the 3D view. It’s just oriented to the section view like before.

@theshysnail which version of Revit/ Dynamo you are using? If you notice that the node I am using is ViewS.SetCropBox, and it is working perfectly from my side…

Oh, you’re using the custom node from archi-lab. It works now. Thanks a lot.

1 Like

I’m wondering if you can help me resolve this problem with the list iteration.

import clr
clr.AddReference('ProtoGeometry')
from Autodesk.DesignScript.Geometry import *

#Import ToDSType(bool) extension method
clr.AddReference("RevitNodes")
import Revit
clr.ImportExtensions(Revit.Elements)
clr.ImportExtensions(Revit.GeometryConversion)

#Import DocumentManager and TransactionManager
clr.AddReference("RevitServices")
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager

from System.Collections.Generic import *

#Import RevitAPI
clr.AddReference("RevitAPI") 
import Autodesk
from Autodesk.Revit.DB import ReferencePointArray

view = UnwrapElement(IN[0])
vector = IN[1].ToRevitType()

doc = DocumentManager.Instance.CurrentDBDocument
uiapp = DocumentManager.Instance.CurrentUIApplication
app = uiapp.Application

TransactionManager.Instance.EnsureInTransaction(doc)

#apply lineweight override to elements in an input list

view.OrientTo(vector)
# "End" the transaction

TransactionManager.Instance.TransactionTaskDone()
OUT = doc.ActiveView

Created another post for the list input issue.

TypeError: iteration over non-sequence of type NoneType

Hey, I just noticed the orientation/section box is quite off and does not seem right for any 3D views. Any help?

Orientation and Section Box both are off. Even if I reverse the Plane.Normal vector in graph, section box is still off.