×
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

how can i put a sphere of the same size on multiple points quickly

how can i put a sphere of the same size on multiple points quickly

how can i put a sphere of the same size on multiple points quickly

(OP)
i found an old thread that has a journal to put a sphere of the specified size on multiple points but when i try to run it in nx9.0 it asks me for the sphere diameter and then it does nothing it acts like it is done running but no spheres are created on the points?

here is the code that i found in the old thread

Option Strict Off
Imports System
Imports NXOpen
Imports NXOpenUI

Module Module1
Dim s As Session = Session.GetSession()
Dim ui As UI = UI.GetUI()
Dim disppart As Part = s.Parts.Display
Sub Main()

Dim pnts As PointCollection = disppart.Points
Dim dia1 As Double = NXInputBox.GetInputNumber("Enter Sphere Diameter")
For Each pnt As Point In pnts
createSphere(pnt, dia1)
Next

End Sub
Public Sub createSphere(ByVal pnt As Point, ByVal dia1 As Double)

Dim nullFeatures_Sphere As Features.Sphere = Nothing
Dim sphereBuilder1 As Features.SphereBuilder
sphereBuilder1 = disppart.Features.CreateSphereBuilder(nullFeatures_Sphere)
sphereBuilder1.CenterPoint = pnt
sphereBuilder1.Diameter.RightHandSide = dia1.ToString
Dim nXObject1 As NXObject
nXObject1 = sphereBuilder1.Commit()
sphereBuilder1.Destroy()

End Sub

Public Function GetUnloadOption(ByVal dummy As String) As Integer

GetUnloadOption = NXOpen.Session.LibraryUnloadOption.Immediately

End Function

End Module

RE: how can i put a sphere of the same size on multiple points quickly

I'm using NX 9.0.3.4; the journal posted above works. What value are you entering for the sphere diameter? Perhaps try a larger value so the spheres are easier to see?

www.nxjournaling.com

RE: how can i put a sphere of the same size on multiple points quickly

(OP)
I use a value of 8 really weird it is working now.

RE: how can i put a sphere of the same size on multiple points quickly

(OP)
thank you

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