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
Thanks
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 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