Hi
Can some one help me with the python in this please?.
I would like to batch create a number of views and set view templates to show construction stages. I’ve looked around, but only found this python that works on the active view. Is there a way to feed in the view I created?.
import clr
clr.AddReference(‘RevitAPI’)
from Autodesk.Revit.DB import *
clr.AddReference(“RevitNodes”)
import Revit
clr.ImportExtensions(Revit.GeometryConversion)
clr.ImportExtensions(Revit.Elements)
clr.AddReference(“RevitServices”)
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager
BB = IN[0]
doc = DocumentManager.Instance.CurrentDBDocument
view = doc.ActiveView
try:
TransactionManager.Instance.EnsureInTransaction(doc)
newmax = UnwrapElement(BB.MaxPoint).ToRevitType()
newmin = UnwrapElement(BB.MinPoint).ToRevitType()
newbox = BoundingBoxXYZ()
newbox.Max = newmax
newbox.Min = newmin
z = view.SetSectionBox(newbox)
TransactionManager.Instance.TransactionTaskDone()
OUT = "Success!"
except:
OUT = “Failed!”