more journal help please
more journal help please
(OP)
Hi all,
Just getting into these journals and there's a standard one that seems to come with NX. It's file to points. Now i've been playing with it but not sure if it's possible.
To use the file the text needs to be:
0,0,0
1,0,0
1,1,0
0,1,0
this creates the corners of a box, however you can't use decimal places. Is there a way to edit the attached code to do this? I have text files that read:
-273.811432 3097.611816 -268.873260
-273.508575 3096.599121 -268.920746
-273.245361 3095.709717 -268.902283
-272.955902 3094.736816 -268.915466
-272.670044 3093.780273 -268.955780
etc. Can this could be edited to suit this type of thing?
Thanks in advance.
Just getting into these journals and there's a standard one that seems to come with NX. It's file to points. Now i've been playing with it but not sure if it's possible.
To use the file the text needs to be:
0,0,0
1,0,0
1,1,0
0,1,0
this creates the corners of a box, however you can't use decimal places. Is there a way to edit the attached code to do this? I have text files that read:
-273.811432 3097.611816 -268.873260
-273.508575 3096.599121 -268.920746
-273.245361 3095.709717 -268.902283
-272.955902 3094.736816 -268.915466
-272.670044 3093.780273 -268.955780
etc. Can this could be edited to suit this type of thing?
Thanks in advance.





RE: more journal help please
Try temporarily changing your regional settings to English(US) and run the journal again. If it works this time, we can modify the journal to accommodate your computer settings.
www.nxjournaling.com
RE: more journal help please
Thanks for the advice
RE: more journal help please
CODE
Imports System Imports System.IO Imports System.Windows.Forms Imports NXOpen Module Test Sub Main Dim USculture As system.globalization.CultureInfo = New System.Globalization.CultureInfo("en-US") Try Dim openFileDialog1 As New OpenFileDialog() openFileDialog1.Filter = "txt files (*.txt)|*.txt|All files (*.*)|*.*" openFileDialog1.FilterIndex = 1 openFileDialog1.RestoreDirectory = True If openFileDialog1.ShowDialog() = DialogResult.OK Then Dim session As Session = Session.GetSession() Dim sr As StreamReader = new StreamReader(openFileDialog1.FileName) Dim line As String Try line = sr.ReadLine() While Not line is Nothing Dim pt As Point3d Dim delim As Char () = { ","C } Dim strings As String () = line.Split(delim) pt.x = Double.Parse(strings(0), USculture) pt.y = Double.Parse(strings(1), USculture) pt.z = Double.Parse(strings(2), USculture) Dim p As Point p = session.Parts.Work.Points.CreatePoint(pt) p.SetVisibility(SmartObject.VisibilityOption.Visible) line = sr.ReadLine() End While Finally sr.Close() End Try End If Catch E As Exception MessageBox.Show(E.Message) End Try End Sub End Modulewww.nxjournaling.com