Journal for X, Y, Z format
Journal for X, Y, Z format
(OP)
Hello,
Does anyone have a journal out there so when you select a point (via Info -> Point) the output would be x=5186.790 y=-856.760 z=714.2
Somehow take the output from info - point and convert it to above

Does anyone have a journal out there so when you select a point (via Info -> Point) the output would be x=5186.790 y=-856.760 z=714.2
Somehow take the output from info - point and convert it to above
John L.
NX Support
Win 7 64bit NX 7.5.4.4 TC 8.3.1.1





RE: Journal for X, Y, Z format
If so, that capability was added in XN 9.0 as the new 'Measure Point' function. Note that the expressions created, either a single 'Point' expression or individual X, Y and Z expressions, are associated with the 'Measure Point' feature which will update if the model is modified and the referenced 'Point' is moved as a result.
John R. Baker, P.E.
Product 'Evangelist'
Product Engineering Software
Siemens PLM Software Inc.
Industry Sector
Cypress, CA
Siemens PLM:
UG/NX Museum:
To an Engineer, the glass is twice as big as it needs to be.
RE: Journal for X, Y, Z format
Other than that, I don't see the difference between your example output and what the information window gives you...
www.nxjournaling.com
RE: Journal for X, Y, Z format
John L.
NX Support
Win 7 64bit NX 7.5.4.4 TC 8.3.1.1
RE: Journal for X, Y, Z format
John R. Baker, P.E.
Product 'Evangelist'
Product Engineering Software
Siemens PLM Software Inc.
Industry Sector
Cypress, CA
Siemens PLM:
UG/NX Museum:
To an Engineer, the glass is twice as big as it needs to be.
RE: Journal for X, Y, Z format
CODE
'April 3, 2014 'select points on screen, copy information to clipboard Option Strict Off Imports System Imports System.Collections.Generic Imports System.Windows.Forms Imports NXOpen Imports NXOpen.UF Module Module1 Sub Main() Dim theSession As Session = Session.GetSession() Dim theUfSession As UFSession = UFSession.GetUFSession If IsNothing(theSession.Parts.Work) Then 'active part required Return End If Dim workPart As Part = theSession.Parts.Work Dim pointValues As New List(Of String) Dim response1 As Integer = Nothing Dim mode1() As Integer = {0, 0} Dim pointDisplayMode As Integer = 0 Dim objectpoint(2) As Double Do theUfSession.Ui.LockUgAccess(NXOpen.UF.UFConstants.UF_UI_FROM_CUSTOM) response1 = theUfSession.Ui.PointSubfunction("Select Point", mode1, pointDisplayMode, objectpoint) theUfSession.Ui.UnlockUgAccess(NXOpen.UF.UFConstants.UF_UI_FROM_CUSTOM) If response1 = 5 Then Dim myPtVal As String = "X = " & objectpoint(0).ToString & " Y = " & objectpoint(1).ToString & " Z = " & objectpoint(2).ToString If pointValues.Contains(myPtVal) Then Exit Do Else pointValues.Add(myPtVal) End If End If Loop Until response1 <> 5 Dim myStringBuilder As New Text.StringBuilder For Each pt As String In pointValues myStringBuilder.Append(pt) myStringBuilder.AppendLine() Next Clipboard.SetText(myStringBuilder.ToString) 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 Modulewww.nxjournaling.com
RE: Journal for X, Y, Z format
Thanks Cowski, the journal is great.
John L.
NX Support
Win 7 64bit NX 7.5.4.4 TC 8.3.1.1
RE: Journal for X, Y, Z format
John R. Baker, P.E.
Product 'Evangelist'
Product Engineering Software
Siemens PLM Software Inc.
Industry Sector
Cypress, CA
Siemens PLM:
UG/NX Museum:
To an Engineer, the glass is twice as big as it needs to be.
RE: Journal for X, Y, Z format
Journal is very helpful. I've been looking something like this. Is it possible to get point WCS orientation and reduce number of decimal places to 2.
RE: Journal for X, Y, Z format
John R. Baker, P.E.
Product 'Evangelist'
Product Engineering Software
Siemens PLM Software Inc.
Industry Sector
Cypress, CA
Siemens PLM:
UG/NX Museum:
To an Engineer, the glass is twice as big as it needs to be.
RE: Journal for X, Y, Z format
Yes it is possible and the changes are pretty easy, which means it is a great time to jump in and get your hands dirty!
To get the desired number of decimal places, you can use a format string in the .ToString method. It will look something like this: [variable].ToString("0.00"). Add the format strings as desired in the following line:
CODE
In thread561-325985: Change Global Co-ordinates to Local Co-ordinates using NXOpen? you will find some code to convert absolute coordinates to local (and vice versa). The functions as written expect a Point3D object as input, which we don't use in the journal above. You will need to either create a Point3D object to pass into the function or change the function so it accepts the array of doubles that we do have (either will work).
Happy coding!
Post back with any specific questions.
www.nxjournaling.com