Module NXJournal
Sub Main
Dim theSession As Session = Session.GetSession()
' ----------------------------------------------
' Menu: Insert->Design Feature->Block...
' ----------------------------------------------
Dim nullFeatures_Feature As Features.Feature = Nothing
Dim features_BlockFeatureBuilder1 As Features.BlockFeatureBuilder
features_BlockFeatureBuilder1 = theSession.Parts.Work.Features.CreateBlockFeatureBuilder(nullFeatures_Feature)
Dim point3d1 As Point3d = New Point3d(0.0, 0.0, 0.0)
features_BlockFeatureBuilder1.SetOriginAndLengths(point3d1, "100", "100", "100")
Dim nullBody As Body = Nothing
features_BlockFeatureBuilder1.SetBooleanOperationAndTarget(Features.Feature.BooleanType.Create, nullBody)
Dim features_Feature1 As Features.Feature
features_Feature1 = features_BlockFeatureBuilder1.CommitFeature()
' ----------------------------------------------
' Menu: Insert->Design Feature->Hole...
' ----------------------------------------------
Dim features_HoleFeatureBuilder1 As Features.HoleFeatureBuilder
features_HoleFeatureBuilder1 = theSession.Parts.Work.Features.CreateHoleFeatureBuilder(nullFeatures_Feature)
features_HoleFeatureBuilder1.SetDepthAndTipAngle("50", "118")
Dim point3d2 As Point3d = New Point3d(52.9603562236931, 26.0351147684603, 100.0)
Dim iSurface1 As ISurface = CType(features_Feature1.FindObject("FACE 1"), ISurface)
features_HoleFeatureBuilder1.SetSimpleHole(point3d2, False, iSurface1, "25")
features_HoleFeatureBuilder1.CreateHole()
features_HoleFeatureBuilder1.ShowPositioningDimensions()
' ----------------------------------------------
' Dialog Begin Positioning
' ----------------------------------------------
features_HoleFeatureBuilder1.ApplyDimensions()
features_HoleFeatureBuilder1.HidePositioningDimensions()
Dim features_Feature2 As Features.Feature
features_Feature2 = features_HoleFeatureBuilder1.CommitFeature()
' ----------------------------------------------
' Menu: Tools->Journal->Stop
' ----------------------------------------------
End Sub
End Module |