Thanks for providing the files. The problem was caused by duct insulation with zero volume, which subsequently have invalid bounding boxes. As the LinkElement constructor requires valid bounding boxes for instantiation, the category element collection fails. Only successful category collections return elements, which explains why you might have seen different results in comparison to the Spring node (it wont be affected by this problem as it doesn’t need to extract bounding boxes nor instantiate new elements).
You can even see the same exception by collecting the linked Duct Insulation elements (using Springs for example), then use the OOTB Element.BoundingBox node on the problem element:
To solve it, I’ve applied an update to the LinkElement class so it can handle null bounding boxes and you can get these updates by upgrading to BimorphNodes v2.2.3, now available on the Dynamo Package Manager. Incidentally this update fixes a broader issue with the
LinkElement.OfCategory node that caused it fail when collecting valid elements with no bounding box, such as views.
In v2.2.3 the node is working consistently and returning the same number of elements (40k elements in your case) as the Spring node.
The crashing problem is highly likely to be related to this issue - solving X solves Y. All I’ve done is add some exception handling to the
Element.IntersectsElement node so it bypasses any LinkElements with a null bounding box (as there’s nothing to clash). The change has had no detrimental effect on the clash result, and I’ve verified this against Revit’s IC to ensure the results are identical, and they are (indicates the IC must also bypass invalid elements).
Subsequently, I’m not experiencing any crashes performing the same clash test with your model and graph (138,148,664 possible clashes). The clash test executes reliably and might even give you time to get a coffee, but only if the coffee machine is on your desk:
Revit IC Tool: 3min 23.04s
BimorphNodes: 2min 23.6s (30% faster)
Tested on: Win 10, Revit 2017.2, Dynamo 1.3.2, Dell Precision 5520, i7-7820HQ 2.9GHz, 32GB DDR4, 256 SSD