Hi all,
I am trying to assign crop box to floor plan views using bounding boxes.
In the script below, I am using View properties in the API to apply the bounding box. However, it reflects “Attribute error” ‘list[object]’ object has no attribute ‘CropBoxActive’.
Any help to diagnose is appreciated.
# Enable Python support and load DesignScript library
import clr
clr.AddReference('ProtoGeometry')
from Autodesk.DesignScript.Geometry import *
clr.AddReference('RevitNodes')
import Revit
clr.ImportExtensions(Revit.Elements)
clr.AddReference('RevitAPI')
import Autodesk
from Autodesk.Revit.DB import *
clr.AddReference('RevitServices')
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager
doc = DocumentManager.Instance.CurrentDBDocument
# The inputs to this node will be stored as a list in the IN variables.
newBB = IN[0]
views = UnwrapElement(IN[1])
output = []
TransactionManager.Instance.EnsureInTransaction(doc)
views.CropBoxActive = True
views.CropBox = newBB
output.append(views)
# Place your code below this line
TransactionManager.Instance.TransactionTaskDone()
# Assign your output to the OUT variable.
OUT = output