AnsweredAssumed Answered

GetNormalVector of ISketchArc always returns (0,0,1) or (-0,-0,-1)

Question asked by Hiyel Kar on Feb 1, 2019
Latest reply on Feb 3, 2019 by Hiyel Kar



I would like to determine if a circle in a 2D sketch is horizontal or not (or in other words, if its sketch is on a plane parallel to the top plane or not). However no matter how the sketch is oriented, the normal vector returned from the arc/circle is the same. Here is what I'm doing:


Sub main()

Set swApp = Application.SldWorks
Set swModel = swApp.ActiveDoc
Set swSelMgr = swModel.SelectionManager
Set arc = swSelMgr.GetSelectedObject6(1, -1)
vector = arc.GetNormalVector
Debug.Print vector(0)
Debug.Print vector(1)
Debug.Print vector(2)

End Sub


I select an arc or a circle and run the macro. For an arc, it returns (-0,-0,-1), for a circle it returns (0,0,1).


Anyone knows how to get the correct vector?


Thanks in advance!