Is their a way to modify this python script to output the newly created section box instead of Success?
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
#The inputs to this node will be stored as a list in the IN variable.
dataEnteringNode = IN
bbox=IN[0]
doc=DocumentManager.Instance.CurrentDBDocument
myview=doc.ActiveView
try:
TransactionManager.Instance.EnsureInTransaction(doc)
newmax=UnwrapElement(bbox.MaxPoint).ToRevitType()
newmin=UnwrapElement(bbox.MinPoint).ToRevitType()
newbox=BoundingBoxXYZ()
newbox.Max=newmax
newbox.Min=newmin
z=myview.SetSectionBox(newbox)
TransactionManager.Instance.TransactionTaskDone()
OUT = "Success!"
except:
OUT=“Failed miserably…”