Hole wizard API returning unexpected results ?!

Hi,

Before I go bald from pulling my own hair out, I need to ask question about the hole wizrd API.

To setup the question, I have created some simple solids to test with that are nothing more than an extrusion with two hole (blind) made by the hole wizard.

In my addin, I select the feature from the tree, do the required checking of object type (22) , get the feature definition to a WHfeaturedata2 (abbrev.), then go a getsketchpoints and finally use the sketchpoint.X and sketchpoint.Y values.

(SW 10 SP 0).

On the front face everything works out great. all values including depth and diameter are perfect.

The hole on the backside through is the mystery.  X comes back as the negative value of the correct number (y is correct).

What gives ???  At first I though the dimension were referential but since it is not happening to the front hole that can't be it.

Here the code snippet ...   and thanks in advance

Dim swFeat As Feature

swFeat = Entity

Dim FeatureData As WizardHoleFeatureData2

FeatureData = swFeat.GetDefinition

Dim vPtArr As Object

Dim pt As Object

Dim swSketchPoint As SketchPoint = Nothing

vPtArr = FeatureData.GetSketchPoints

System.Diagnostics.Debug.WriteLine( "DEPTH = " & FeatureData.HoleDepth & " DIAMETER = " & FeatureData.HoleDiameter)

For Each pt In vPtArr

swSketchPoint = pt

Next

holeparams(0) = swSketchPoint.X

holeparams(1) = swSketchPoint.Y

........

Ok, lets change the question ....  What I need to do is to get the absolute coordinates of the top of the hole (center).

What I have found out is that there is a different origin used when the holw wizard creates a hole.  I don't how or where to get that information.

Message was edited by: Allan Sauder

.......

Another refinement .....

I just figured out what I thought was a 3D hole was a 2D hole.  So now the question is,

"How to I determine whether a hole wizard feature is defined as 2D or 3D AND if it is 2D, how do I determine the read 3D coordinates of the center of the hole?"

Thanks again ...

SolidworksApi macros