I am getting an exception thrown from trying to create a filled region; I would like some understanding to the cause, and idea for considering solutions to problem.
“Warning: IronPythonEvaluator.EvaluateIronPythonScript operation failed.
Traceback (most recent call last):
File “”, line 21, in
Exception: A managed exception was thrown by Revit or by one of its external applications.”
Is there a reason why you aren’t using the OOTB node for this?
It would be much more helpful to share an image of the graph and/or the actual graph. There are too many variables here to guess at.
I tried to at first, but every type of “regionType” would turn up an error.
Warning: One or more of the input types are not matching. Couldn’t find a version of ByCurves that takes arguments of type (Function,__array,Revit.Elements.FilledRegionType)
You don’t have a view. Document.ActiveView requires a doc input.
I also don’t remember if your boundary input has to be a closed polycurve or separate curves, but order would likely matter in the case of the latter.
The document was the issue for the OOTB node.
You need to make a curveloop with the API and retrieve a FilledRegionType.
# Import RevitAPI
from Autodesk.Revit.DB import *
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager
doc = DocumentManager.Instance.CurrentDBDocument
boundaryCurves = IN
filledRegionName = IN
viewId = doc.ActiveView.Id
for col in FilteredElementCollector(doc).OfClass(FilledRegionType):
if Element.Name.GetValue(col) == filledRegionName:
regionId = col.Id
filledCurves = CurveLoop()
for curve in boundaryCurves:
outRegion = FilledRegion.Create(doc, regionId, viewId, curveLoop)
OUT = outRegion
Thank you, this solved the issue, and gave me some more insight to the expecation of Revit’s wants for particular elements to satisfy its commands.