Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
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