05-09-2019
12:35 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
05-09-2019
12:35 AM
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
Jhoel Forshav
Download my free Inventor Addin - Hole Projector
LinkedIn | Ideas | Contributions | Blog posts | Website