BoundingBox node - Dynamo crashes

Hello all,

I want to create a solid from a revit profile (it is just a rectangle). Every time that I run the script after the node ‘BoundingBox.ToCuboid’ Dynamo crashes.
The python script that I use in order to get the curves from the revit profile is the following :

import clr
from Autodesk.DesignScript.Geometry import *

Import ToDSType(bool) extension method

import Revit

Import DocumentManager and TransactionManager

import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager

from System.Collections.Generic import *

Import RevitAPI

import Autodesk
from Autodesk.Revit.DB import *

doc = DocumentManager.Instance.CurrentDBDocument
uiapp = DocumentManager.Instance.CurrentUIApplication
app = uiapp.Application

type = UnwrapElement(IN[0].Family.Name)
name = UnwrapElement(IN[0].Name)

family = UnwrapElement(IN[0]).Family

famDoc = doc.EditFamily(family)

famCollector = FilteredElementCollector(famDoc)
sketch = famCollector.OfClass(Sketch)

for i in sketch:
cArray = list(i.Profile)
cArray[:] = [[Revit.GeometryConversion.RevitToProtoCurve.ToProtoType(y, True ) for y in x] for x in cArray]
OUT = cArray

Any idea?

Thank you!

My guess is that this is an issue with the geometry engine having a hard time making or displaying a cuboid with no height. Try pulling the minimum and maximum point instead, and use the XY values to build a rectangle which you can patch.