×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

NXOpen CreateHolePackageBuilder Class Help

NXOpen CreateHolePackageBuilder Class Help

NXOpen CreateHolePackageBuilder Class Help

(OP)
Dear Forum,

I've been developing an NXOpen function for creating couterbore holes on a pointset using the CreateHolePackageBuilder class in the namespace wrokpart.features.CreateHolePackageBuilder. The code works except inside of the logfile it is throwing an error "Failed to commit feature_builder because expected sketch not found" This is strange because the hole series gets instantiated btu this error is appearing within the log file. I've provided the code snippet for my function below.

Any ideas why this is happening and how to fix it?

Thanks.

CODE --> vb.net

Private Function CreateCounterBoreHole(ByVal iPointSet As Features.PointSet, ByVal iBody As Body) As Features.Feature

        Dim holePackageBuilder1 As Features.HolePackageBuilder
        holePackageBuilder1 = workpart.Features.CreateHolePackageBuilder(Nothing)

        holePackageBuilder1.Tolerance = 0.001
        holePackageBuilder1.HolePosition.DistanceTolerance = 0.001
        holePackageBuilder1.HolePosition.ChainingTolerance = 0.00095

        holePackageBuilder1.GeneralHoleForm = Features.HolePackageBuilder.HoleForms.Counterbored

        holePackageBuilder1.GeneralCounterboreDiameter.RightHandSide = "1.0625"

        holePackageBuilder1.GeneralCounterboreDepth.RightHandSide = "0.1"

        holePackageBuilder1.GeneralCounterboreHoleDiameter.RightHandSide = "0.75"

        holePackageBuilder1.GeneralCounterboreHoleDepth.RightHandSide = "1.5"

        holePackageBuilder1.GeneralTipAngle.RightHandSide = "118"

        holePackageBuilder1.StartExtensionEnabled = True

        holePackageBuilder1.HolePosition.SetAllowedEntityTypes(Section.AllowTypes.OnlyPoints)

        Dim features1(0) As Features.Feature
        Dim pointSet1 As Features.PointSet = iPointSet ' CType(workpart.Features.FindObject("PointSet(37)"), Features.PointSet)

        features1(0) = pointSet1
        Dim featurePointsRule1 As FeaturePointsRule
        featurePointsRule1 = workpart.ScRuleFactory.CreateRuleFeaturePoints(features1)

        holePackageBuilder1.HolePosition.AllowSelfIntersection(True)

        Dim rules1(0) As SelectionIntentRule
        rules1(0) = featurePointsRule1
        Dim nullNXObject As NXObject = Nothing

        Dim helpPoint As Point = iPointSet.GetEntities()(0)
        Dim helpPoint1 As Point3d = New Point3d(helpPoint.Coordinates.X, helpPoint.Coordinates.Y, helpPoint.Coordinates.Z) 'New Point3d(-10.4393096814239, 7.58722607614455, 6.63287328868582)
        holePackageBuilder1.HolePosition.AddToSection(rules1, nullNXObject, nullNXObject, nullNXObject, helpPoint1, Section.Mode.Create, False)

        holePackageBuilder1.BooleanOperation.Type = GeometricUtilities.BooleanOperation.BooleanType.Subtract

        Dim targetBodies9(0) As Body
        Dim body1 As Body = iBody ' CType(workpart.Bodies.FindObject("BLOCK(21)"), Body)

        targetBodies9(0) = body1
        holePackageBuilder1.BooleanOperation.SetTargetBodies(targetBodies9)

        holePackageBuilder1.ParentFeatureInternal = True

        Dim oHolefeature As Features.Feature = holePackageBuilder1.Commit()

        holePackageBuilder1.Destroy()

        Return oHolefeature

    End Function 

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources