Code:
' NX 5.0.6.3
' Journal created by met on Tue Oct 14 14:41:22 2014 Mitteleuropäische Sommerzeit
'
Option Strict Off
Imports System
Imports NXOpenModule NXJournal
Sub Main()
Dim theSession As Session = Session.GetSession()
Dim workPart As Part = theSession.Parts.Work
Dim displayPart As Part = theSession.Parts.Display
theSession.ListingWindow.Open()
Dim Hole As Features.Feature = CreateHole(workPart, _
CType(workPart.Bodies.FindObject("EXTRUDE(11)"), Body), _
New Point3d(0, 40, 20), 6, 5)
End Sub
Function CreateHole(myPart As Part, myBody As Body, myPoint As Point3d, _
myDiameter As Double, myDepth As Double) As Features.Feature
Dim HolePoint As Point = myPart.Points.CreatePoint(myPoint)
Dim holePackageBuilder1 As Features.HolePackageBuilder
holePackageBuilder1 = myPart.Features.CreateHolePackageBuilder(Nothing)
holePackageBuilder1.HolePosition.AddSmartPoint(HolePoint, 1)
holePackageBuilder1.GeneralTipAngle.RightHandSide = "0"
holePackageBuilder1.GeneralHoleDiameter.RightHandSide = myDiameter
holePackageBuilder1.GeneralHoleDepth.RightHandSide = myDepth
Dim targetBodies5(0) As Body
targetBodies5(0) = myBody
holePackageBuilder1.BooleanOperation.SetTargetBodies(targetBodies5)
Dim Hole As Features.Feature = holePackageBuilder1.Commit()
Return Hole
End Function
End Module