×
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

XYZ spotweld points HELP

XYZ spotweld points HELP

XYZ spotweld points HELP

(OP)
I have been trying for weeks now to write a journal file that wille select all the spotweld points and input them into a txt file or a excel sheet, but having no luck. I there anyone out the that can help? I am using UGNX 8.

RE: XYZ spotweld points HELP

(OP)
unfortnally nothing as i read on forums they all say i need a grips program. i don't have a clue where to start.

RE: XYZ spotweld points HELP

What is your "spotweld point"? An associative point feature? A dumb point object? A custom object?

If it is a point object/feature, what differentiates it as a spotweld? object name? some attribute? other?

Can you post a small sample file along with what you would want to see as output?

www.nxjournaling.com

RE: XYZ spotweld points HELP

It appears that the "retained" features have all the info added to them as attributes.

Perhaps the following code will get you started:

CODE

Option Strict Off
Imports System
Imports NXOpen
Imports NXOpen.UF

Module Module1

    Sub Main()

        Dim theSession As Session = Session.GetSession()
        Dim theUfSession As UFSession = UFSession.GetUFSession()
        Dim workPart As Part = theSession.Parts.Work

        Dim lw As ListingWindow = theSession.ListingWindow
        lw.Open()

        For Each myFeature As Features.Feature In theSession.Parts.Work.Features.GetFeatures()

            If myFeature.FeatureType.ToUpper = "WELD_POINT" Then

                Dim weldID As String = ""
                Try
                    weldID = myFeature.GetStringAttribute("ID")
                Catch ex As NXException
                    Continue For
                End Try

                Dim weldX As Double
                Try
                    weldX = myFeature.GetRealAttribute("X_Pos")
                Catch ex As NXException
                    Continue For
                End Try

                Dim weldY As Double
                Try
                    weldY = myFeature.GetRealAttribute("Y_Pos")
                Catch ex As NXException
                    Continue For
                End Try

                Dim weldZ As Double
                Try
                    weldZ = myFeature.GetRealAttribute("Z_Pos")
                Catch ex As NXException
                    Continue For
                End Try

                lw.WriteLine("ID: " & weldID & ", " & weldX.ToString & ", " & weldY.ToString & ", " & weldZ.ToString)
                lw.WriteLine("")

            End If
        Next
        lw.Close()


    End Sub


    Public Function GetUnloadOption(ByVal dummy As String) As Integer

        'Unloads the image when the NX session terminates
        GetUnloadOption = NXOpen.Session.LibraryUnloadOption.AtTermination

        '----Other unload options-------
        'Unloads the image immediately after execution within NX
        'GetUnloadOption = NXOpen.Session.LibraryUnloadOption.Immediately

        'Unloads the image explicitly, via an unload dialog
        'GetUnloadOption = NXOpen.Session.LibraryUnloadOption.Explicitly
        '-------------------------------

    End Function

End Module 

www.nxjournaling.com

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