Microstation V8i ( error when calculating an area of a shape with a small area.

I am calculating the area of a grouped hole with the help of this command ComputeGroupedHoleArea (at the bottom of the page).

It works very well but now I came across an grouped hole with an element in it which has a very small area.

area = area - oEnumerator.Current.AsClosedElement.Area
Throws an error in the Do While block)

. Well...


does throw an error.

The .Area is where it goes wrong so the code is fine but the .Area itself is not.

After some investigation it turns out the area of the element was very small. The element was a triangle with the second point exactly between the other two.

When I used Microstation itself to calculate the area it said it could calculate it. Disappointed

When I used Microstation to calculate the area of the Grouped Hole it worked fine.

A way to let Microstation calculate the area outside VBA and return the value would be a solution?

Now I would like it very much if it would just return 0.

Try and Catch looked promising but that does not exist (yet) in VBA.

I read something about using On Error but It is a little bit out of my league (yet).

Does anyone has a solution for catching such an error and replace it with another value (0)?