×
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

Journal to select endpoints

Journal to select endpoints

Journal to select endpoints

(OP)
I'd like to create a journal in NX 7.5 that makes several arcs and then connects their endpoints to create a profile. I wrote a journal to create the arcs (simplified version below, the final version will have hundreds) but since I don't know exact coordinates of the arc endpoints, I haven't figured out a way to create lines connecting the arcs. Is there a way to designate the endpoint of an arc in a journal without the user selecting it? Thanks!

Option Strict Off
Imports System
Imports NXOpen

Module NXJournal
Sub Main

Dim theSession As Session = Session.GetSession()
Dim workPart As Part = theSession.Parts.Work
Dim displayPart As Part = theSession.Parts.Display

Dim angleStart As Double
angleStart = 0

Dim ptCenter As New Point3d(0, 0, 0)

Dim arcStep As Double
arcStep = 0.4

Do

DrawArc(angleStart, angleStart + arcStep, 4, ptCenter)

angleStart = angleStart + arcStep + 0.2

DrawArc(angleStart, angleStart + arcStep, 3, ptCenter)

angleStart = angleStart + arcStep + 0.2
arcStep = arcStep + 0.1

Loop Until angleStart > Math.pi

End Sub

Sub DrawArc(ByVal arcStart As Double, ByVal arcEnd As Double, ByVal radius As Double, ByVal ptCenter As Point3d)

Dim theSession As Session = Session.GetSession()
Dim workPart As Part = theSession.Parts.Work
Dim displayPart As Part = theSession.Parts.Display

Dim nxMatrix1 As NXMatrix = CType(workPart.NxMatrices.FindObject("WCS"),NXMatrix)

Dim arc1 As Arc
arc1 = workPart.Curves.CreateArc(ptCenter, nxMatrix1, radius, arcStart, arcEnd)

End Sub

End Module

RE: Journal to select endpoints

(OP)
That's amazing, thank you so much!

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