Hello,
I got the code below from the following link:
# Load the Python Standard and DesignScript Libraries
import clr
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
#Reference the active Document and Application
doc = DocumentManager.Instance.CurrentDBDocument
view = UnwrapElement(IN[0])
TransactionManager.Instance.EnsureInTransaction(doc)
for v in view:
if v.CropBoxActive == True:
csm = v.GetCropRegionShapeManager()
csm.RemoveCropRegionShape()
TransactionManager.Instance.TransactionTaskDone()
OUT = 0
and its producing the following error:
Warning: IronPythonEvaluator.EvaluateIronPythonScript operation failed.
Traceback (most recent call last):
File “”, line 19, in
TypeError: iteration over non-sequence of type ViewSection
I’m using Revit 2020
I’d be most appreciative if you could assist as to why it is producing an error.