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
www.nxjournaling.com
RE: XYZ spotweld points HELP
RE: XYZ spotweld points HELP
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
RE: XYZ spotweld points HELP
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 Modulewww.nxjournaling.com