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

Hi @ianteneth 

I think the extentdirection is relative to the sketchplane for the point/points defining your hole feature. Therefore i believe that if the direction is negative you need to flip the vector... Maybe something like this would work?

 

Dim oDoc As PartDocument = ThisDoc.Document
Dim oCompDef As PartComponentDefinition = oDoc.ComponentDefinition
Dim hole As HoleFeature = oCompDef.Features.HoleFeatures.Item(1)
Dim oTG As TransientGeometry = ThisApplication.TransientGeometry
'Get the normal for the sketchplane
Dim vector As UnitVector = hole.Sketch.PlanarEntityGeometry.Normal


Dim holeDir As PartFeatureExtentDirectionEnum
If hole.Extent.Direction = PartFeatureExtentDirectionEnum.kNegativeExtentDirection
	'If hole extent direction is negative then flip the normal
	Dim oMatrix = oTG.CreateMatrix
	oMatrix.Invert
	vector.TransformBy(oMatrix)
End If