export to point coordinates excel

Hello there,

I want to put the dot on the model cross-sectional view lines on the NX modeling page and to excel the X, Y, Z coordinate information of this point. Example macros are doing through drafting, but there is none on the Model page. Can you help me?
thank you.

By the "cross-sectional view lines", do you mean that you are using the "clip section" tool? If so, you'll need to save a copy of the section curves before you can place points on them. The view section tool doesn't create true edges that you can use in other operations.

I am using NX 8. I often have situations where I have to get XYZ coordinate points for hundreds of point locations on a model and transfer those points to an excel spread sheet. up until now I have done it manually using "information, point" for each one and then I enter it manually into Excel.

I want to transfer the X-Y-Z coordinates of all the points I put on the model to excel. I'm adding a sample macro to make it clear. This macro results in the imformation window writes. I want to print to excel page not to imformation window.

Option Strict Off
Imports System
Imports NXOpen
Imports NXOpen.UF

Module PointsInformation

' Explicit Activation
' This entry point is used to activate the application explicitly
Sub Main()

Dim theSession As Session = Session.GetSession()
Dim ufs As UFSession = UFSession.GetUFSession()
Dim response2 As Selection.Response = Nothing
Dim pnt2() As Double = {0.0, 0.0, 0.0}
Dim selectedObjects() As NXObject

theSession.ListingWindow.Open

Start1:
Start2:
response2 = select_a_Point(selectedObjects)
If response2 = Selection.Response.Back Then GoTo Start1 ' Select a new face
If response2 = Selection.Response.Cancel Then GoTo End1

Dim info As String = "Number of selected objects = "
info = String.Concat(info, selectedObjects.Length)
theSession.ListingWindow.WriteLine(info)

Dim sda As Point
For Each sda In selectedObjects
ufs.Curve.AskPointData(sda.Tag, pnt2)
theSession.ListingWindow.WriteLine("X," & pnt2(0).ToString("N14") & " Y," & pnt2(1).ToString("N14") & " Z,"& pnt2(2).ToString("N14"))
Next

GoTo Start2 ' Continue selecting points for current face

End1:
End Sub

Public Function GetUnloadOption(ByVal dummy As String) As Integer

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

'----Other unload options-------
'Unloads the image when the NX session terminates
'GetUnloadOption = NXOpen.Session.LibraryUnloadOption.AtTermination

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

End Function

Function select_a_Point(ByRef selectedObjects As NXObject())
Dim ui As UI = ui.GetUI()
Dim mask(0) As Selection.MaskTriple
With mask(0)
.Type = UFConstants.UF_point_type
.Subtype = UFConstants.UF_point_subtype
.SolidBodySubtype = 0
End With

Try

Dim resp As Selection.Response = _
ui.SelectionManager.SelectObjects("Select Points", "Select Points", _
Selection.SelectionScope.AnyInAssembly, _
Selection.SelectionAction.ClearAndEnableSpecific, _
False, False, mask, selectedObjects)

If resp = Selection.Response.Cancel Or _
resp = Selection.Response.Back Then
Return Selection.Response.Cancel
Else
Dim info As String = "Number of selected objects = "
info = String.Concat(info, selectedObjects.Length)
System.Diagnostics.Trace.WriteLine(info)
Return Selection.Response.Ok
End If

Catch e As Exception
System.Diagnostics.Trace.WriteLine("Problems selecting objects.")
System.Diagnostics.Trace.WriteLine(e.ToString)
End Try
End Function

End Module

The code in the following post shows how to open/create an Excel file and write information to the sheet:
http://nxjournaling.com/comment/4964#comment-4964

You can adapt this to write your point information instead of the zone information.