- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Question: How can I get a unit vector representing the direction of a hole from the centerpoint through the center axis in the direction that it is extruded?
I am on Inventor Professional 2019.4 writing a C# application. I am trying to translate a point from the centerpoint (Hole.HoleCenterPoints) of a hole to the midpoint (half of the hole depth) of a hole. Therefore I need to get a unit vector that starts at the centerpoint of a hole and goes in the direction that the hole is extruded in. One of my current methods involves the following code:
vector = hole.Sketch.PlanarEntityGeometry.Normal;
This code technically works as it gets a vector normal to the sketch that the hole centerpoint is drawn on. However, the direction of this vector isn't related to the extruded or extent direction of the hole. And this code is specifically for when the underlying geometry of the hole is based on the SketchPoint object.
I looked into the extent property of the hole (Hole.Extent) and accidentally found a direction property (Hole.Extent.Direction). However, this is not accessible in the API and I am not certain it will give me the information I need. The holes can be through holes so I cannot do anything fancy with the end face property (Hole.EndFaces). These holes can also be at any orientation. Anyone have any ideas?
Solved! Go to Solution.