Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.
ianteneth
in reply to: ianteneth

 

Thanks to @JhoelForshav for helping me get the Extent object working in C#!

 

Now that I finally can determine the hole direction vector I am confused by what I get. Below is a code snippet that will display the normal vector of the sketch as well as the extent direction type of the hole.

 

Sub Main()
		
	Dim part As Inventor.PartDocument = ThisDoc.Document
	Dim hole As Inventor.HoleFeature = part.ComponentDefinition.Features.HoleFeatures(1)
	Dim axis As Inventor.UnitVector = hole.Sketch.PlanarEntityGeometry.Normal
	Dim direction As String = "Negative (Opposite sketch normal)"
If hole.Extent.Direction = PartFeatureExtentDirectionEnum.kPositiveExtentDirection Then direction = "Positive (Same as sketch normal)" end if MessageBox.Show("Hole Extent: " & direction _ & vbNewLine & "Sketch Normal Vector: X:" & axis.X & " Y:" & axis.Y _ & " Z:" & axis.Z) End Sub

 

 

The results of this (for the simple cube part below) can be seen in the image below. We can see that the sketch normal vector and the hole extent direction vector are in the same direction per the API documentation because the direction type is kPositiveExtentDirection. And that the sketch normal vector is in the direction of Positive Y.

 

Annotation 2019-05-09 202433.jpg

 

 

However, as you can see in this screenshot below, it appears that the hole extent direction vector is opposite of the sketch normal vector. The hole extent direction appears to go to the left (Negative Y-axis). Where as we already saw that the sketch normal vector is in the direction of Positive Y-axis (right).

 

Did I confuse my axes and signs or should the direction type for this hole be kNegativeExtentDirection?

 

Annotation 2019-05-09 202402.jpg