Thanks Jeremy for the fast response. The family is a manufacturer provided mechanical equipment. It is quite complex on the geometry side. It contains various extrusions, and CAD elements with other CAD elements nested within. All in all, while analyzing the geometry it probably contains about 20,000 linear references in the form of either edges, or lines. If I had to guess, the offending solid is probably from one of these CAD imports within the family. I'm happy to attach that family for further study, but it is not necessary to have a resolution on my end. I'm thinking of just making a simple helper method that tries to run a generic SolidCurveIntersection within a try/catch. If an exception is caught, I will not run my more expensive (and real) SolidCurveIntersection method.
Here is that helper method:
private static bool EnsureEnclosedSolid(Solid solid, Curve curve)
{
try
{
SolidCurveIntersection intersection = solid.IntersectWithCurve(curve, new SolidCurveIntersectionOptions());
}
catch { return false; }
return true;
}
What do you think about this? I'm not sure it can be improved any, but am open to suggestions.
On the analysis side of things. My method of obtaining the solid is pretty standard as far as I'm concerned. My options class looks like this:
Options opt = new Options()
{
ComputeReferences = false,
IncludeNonVisibleObjects = false,
View = doc.ActiveView
};
And I am obtaining the solid either through:
GeometryElement gElem = gi.GetInstanceGeometry();
or from the GeometryObject directly if it happens to be a solid.
I can confirm that the offending solid is coming from the GeometryInstance obtained from :
GeometryElement gElem = gi.GetInstanceGeometry();
I think for my use, this scenario may by be a fringe case. So i'm not too concerned about it. It would be interesting to know why it is happening, but not critical.
Thanks for your help and input
-Pat