Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations waross on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Coordinate points data in drafting from specified WCS

Status
Not open for further replies.

PatilR

Aerospace
Jan 30, 2015
12
Need Coordinate points data from a specified WCS (i.e. not from Absolute Coordinate system) in drafting as table if possible Parametric values of a pointset created in model

Thanks
 
Replies continue below

Recommended for you

Let me work on that and get back to you later today (I'm in the middle of a meeting right now ;-)

John R. Baker, P.E.
Product 'Evangelist'
Product Engineering Software
Siemens PLM Software Inc.
Digital Factory
Cypress, CA
Siemens PLM:
UG/NX Museum:

To an Engineer, the glass is twice as big as it needs to be.
 
OK, attached is an updated GRIP program which will save the data file with a '.txt' extension, but still in the 'C:\Temp' folder. When running the program, the data file's name will default to the name of the Part file with some additional added text, but the user can either accept the default name or enter one of his own. As before, after downloading the file, edit the file extension from '.zipper' to '.zip' before attempting to extract the files.

Let me know if this is working as you expected it to.

John R. Baker, P.E.
Product 'Evangelist'
Product Engineering Software
Siemens PLM Software Inc.
Digital Factory
Cypress, CA
Siemens PLM:
UG/NX Museum:

To an Engineer, the glass is twice as big as it needs to be.
 
 http://files.engineering.com/getfile.aspx?folder=2bf62d6f-f778-4d1e-90e3-057f596a5f30&file=Pts_to_txt_file-3.zipper
If you don't want to learn GRIP (and I can't imagine why anyone would want to learn GRIP, these days) then you can write the point file using a simple VB program that calls NX/Open functions. There are lots of examples around that show how to do this. Learning how to write a text file using VB is a useful skill that might come in handy elesewhere. If you can't find good examples, ask again, either here or at NXJournaling.com.

Alternatively, your NX/Open could automatically create the 150 "Measure Point" features, and you'd get assocoativity.
 
Hi John,

Thank you for the grip program. we need some changes in it, is it possible to compile once again
1). Is it possible to change the path (location) of .txt file. Manually can we set the path for saving the .txt files
2). Dont want the ** End of File ** line in last.
3). is it possible to create a VB program for it


Thanks & Regards
Patil
 
Here is a more modern approach ... it's a VB program that calls SNAP functions. So, it can display the standard Windows "Save As" dialog to let the user decide where to put the point file. And, since it's just VB, and it's simpler than the GRIP code, there are lots of people who know how to modify it. It could be changed (by someone other than me) to use NX/Open functions, instead of SNAP functions.


Code:
Option Infer On
Imports Snap, Snap.Create, Snap.UI, Snap.NX.ObjectTypes
Imports System.Windows.Forms

Public Class MyProgram

   Public Shared Sub Main()

      ' Create a selection dialog to slect multiple points
      Dim dialog = Selection.SelectObject("Select any object")
      dialog.SetFilter(Type.Point)
      dialog.AllowMultiple = True

      ' Display the dialog and get a result
      Dim result = dialog.Show()

      ' Exit if user clicked Cancel or Back button
      If result.Response = Response.Cancel Or result.Response = Response.Back Then Return

      'Create list of strings to hold point info
      Dim pointList = New List(Of String)

      ' Cycle through points, adding them to list
      For Each obj In result.Objects
         Dim pt = TryCast(obj, Snap.NX.Point)
         If pt IsNot Nothing Then
            pointList.Add(pt.Position.ToString("F12"))
         End If
      Next

      ' Display a Save As dialog
      Dim saveDialog As New System.Windows.Forms.SaveFileDialog()
      saveDialog.Filter = "txt files (*.txt)|*.txt|All files (*.*)|*.*"
      saveDialog.FilterIndex = 1

      ' Write out the point data
      If saveDialog.ShowDialog() = DialogResult.OK Then
         System.IO.File.WriteAllLines(saveDialog.FileName, pointList)
      End If
     
   End Sub
End Class
 
The errors are because you don't have a SNAP license. You'll need to replace the calls to the SNAP functions by calls to NX/Open functions.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor