×
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 VB Journal How to extrude an arc

NXOpen VB Journal How to extrude an arc

NXOpen VB Journal How to extrude an arc

(OP)
Hello to everyone,

I'm new in the NX Journaling and I'm trying to write down a code in Visual Basic language with NXOpen.
I managed to get two splines and one arc on NX10 with a journal but when I try to make an extrusion of it, I get an error.
This is a part of my actual code, where I define thw splines and the arc (after their splinebuilder and arcbuilder):

CODE -->

Dim spline_dx As NXOpen.Spline
spline_dx = studioSplineBuilderEx1.Curve()
Dim spline_sx As NXOpen.Spline
spline_sx = studioSplineBuilderEx2.Curve()
Dim arc As NXOpen.Arc
arc = associativeArcBuilder1.Commit()

Dim extrudeBuilder1 As NXOpen.Features.ExtrudeBuilder
extrudeBuilder1 = workPart.Features.CreateExtrudeBuilder(Nothing)
Dim section1 As NXOpen.Section
section1 = workPart.Sections.CreateSection(0, 0, 0)
extrudeBuilder1.Section = section1
extrudeBuilder1.AllowSelfIntersectingSection(True)
extrudeBuilder1.DistanceTolerance = linear_toll
extrudeBuilder1.Limits.StartExtend.Value.RightHandSide = "0"
extrudeBuilder1.Limits.EndExtend.Value.RightHandSide = "123.456"
section1.DistanceTolerance = linear_toll
extrudeBuilder1.Direction = direction_Z
section1.SetAllowedEntityTypes(NXOpen.Section.AllowTypes.OnlyCurves)

Dim curves1(0) As NXOpen.IBaseCurve
Dim spline1 As NXOpen.Spline = spline_dx
curves1(0) = spline1
Dim curveDumbRule1 As NXOpen.CurveDumbRule
curveDumbRule1 = workPart.ScRuleFactory.CreateRuleBaseCurveDumb(curves1)
section1.AllowSelfIntersection(True)
Dim rules1(0) As NXOpen.SelectionIntentRule
rules1(0) = curveDumbRule1
section1.AddToSection(rules1, spline1, Nothing, Nothing, origin, NXOpen.Section.Mode.Create, False)

Dim curves2(0) As NXOpen.IBaseCurve
Dim arc1 As NXOpen.Arc = arc
curves2(0) = arc1
Dim curveDumbRule2 As NXOpen.CurveDumbRule
'Here I get the issue:
curveDumbRule2 = workPart.ScRuleFactory.CreateRuleBaseCurveDumb(curves2)
section1.AllowSelfIntersection(True)
Dim rules2(0) As NXOpen.SelectionIntentRule
rules2(0) = curveDumbRule2
section1.AddToSection(rules2, arc1, Nothing, Nothing, origin, NXOpen.Section.Mode.Create, False)

Dim curves3(0) As NXOpen.IBaseCurve
Dim spline2 As NXOpen.Spline = spline_sx
curves3(0) = spline2
Dim curveDumbRule3 As NXOpen.CurveDumbRule
curveDumbRule3 = workPart.ScRuleFactory.CreateRuleBaseCurveDumb(curves3)
section1.AllowSelfIntersection(True)
Dim rules3(0) As NXOpen.SelectionIntentRule
rules3(0) = curveDumbRule3
section1.AddToSection(rules3, spline2, Nothing, Nothing, origin, NXOpen.Section.Mode.Create, False)

Dim feature1 As NXOpen.Features.Feature
feature1 = extrudeBuilder1.CommitFeature()
extrudeBuilder1.Destroy() 

I get an error message after executing the journal on the line: "curveDumbRule2 = workPart.ScRuleFactory.CreateRuleBaseCurveDumb(curves2)"

Is there someone who can help me?
Thank you in advance!
Best regards,

kalo86

RE: NXOpen VB Journal How to extrude an arc

What is the error message?

Have you recorded a journal and compared you code to what is recorded?

Mark Rief
NX CAM Customer Success
Siemens PLM Software

RE: NXOpen VB Journal How to extrude an arc

(OP)
Hi markrief,
My code derives from a recorded journal.
When I try to extrude a spline, it works.
The result does not change if I want to extrude 2 or more splines, all is working fine.
When I add an arc to the curve selection I get an error.
I need to figure out why I cannot add the arc to curve selection.

Best regards,

kalo86

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