Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

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

todays date journal

Status
Not open for further replies.

moog3

Marine/Ocean
Nov 29, 2022
60
0
0
AU
I've had this journal for years, and it's served me well.
It has options in the code for different output formats.
I now need it to output the date as 20/12/2022 which would be option (1) in the code
but....... it doesn't change the output from the option (2) which I've always used
Can someone help fix it?


' NX 4.0.0.25
' Journal created by Henry on Tue Mar 21 10:57:55 2006 FLE Standard Time
'

'TimeNoteString(1) writes 04.05.2007

'TimeNoteString(2) writes 07.06.07

'TimeNoteString(3) writes xxx

'TimeNoteString(4) writes 7. juuni 2007. a.

'TimeNoteString(5) writes 2007-06-07

'TimeNoteString(6) writes neljapäev, 7. juuni 2007

'TimeNoteString(7) writes 07. juuni 2007. a. 22:44

'TimeNoteString(8) writes 7. juuni 2007. a. 22:47

'TimeNoteString(9) writes 07. juuni 2007. a. 22:47

'TimeNoteString(10) writes 07. juuni 2007. a. 22:48

'TimeNoteString(11) writes neljapäev, 7. juuni 2007 22:48

'TimeNoteString(12) writes neljapäev, 7. juuni 2007 22:49

'TimeNoteString(13) writes 7. juuni 2007. a. 22:49:22



Option Strict Off

Imports System

Imports NXOpen




Module NXJournal


Sub Main



Dim theSession As Session = Session.GetSession()

Dim workPart As Part = theSession.Parts.Work


Dim displayPart As Part = theSession.Parts.Display






Dim markId1 As Session.UndoMarkId
markId1 = theSession.SetUndoMark(Session.MarkVisibility.Visible, "Edit Properties")


Dim TimeNote As DateTime
TimeNote = System.DateTime.Now()

Dim TimeNoteString as String() = TimeNote.GetDateTimeFormats()

workPart.SetAttribute("DATE", TimeNoteString(2))


'change the number in the line above to suit your format




End Sub

End Module
 
Replies continue below

Recommended for you

Cowski,
I'm a real hack at this..... i read the article, and just played with it, eventually i got it to work with this line..

workPart.SetAttribute("DATE", TimeNoteString(0))

Thanks
 
Status
Not open for further replies.
Back
Top