Auto Date?
Auto Date?
(OP)
I am working on border templetes for file we get from G.M. These are to be used for quoting purposes and do not need to be very complicated. However, there is some information in the title block that needs to be included and I am trying to automate the process. I have been able to include part attribute like part number and name, but I can not find a way to include the current date. Is this even possible?





RE: Auto Date?
If you wish, I could supply a code segment (in GRIP) that would extract the current date and write it into an attribute which could then be linked to a note in a drawing border.
John R. Baker, P.E.
Product 'Evangelist'
UGS NX Product Line
SIEMENS
UGS PLM Software
Cypress, CA
http://www.siemens.com/ugs
http://www.plmworld.org/museum/
RE: Auto Date?
RE: Auto Date?
' NX 4.0.0.25
' Journal created by Henry on Tue Mar 21 10:57:55 2006 FLE Standard Time
'
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
' ----------------------------------------------
' Menu: File->Properties
' ----------------------------------------------
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(1))
theSession.Parts.Work.SetAttribute("FILENAME",theSession.Parts.Work.Leaf)
' ----------------------------------------------
' Menu: Tools->Journal->Stop
' ----------------------------------------------
End Sub
End Module
To get suitable Date format play with TimeNoteString(X).
You can run this journal from toolbar icon.
Henry
RE: Auto Date?
What types of formats can you have for the date? We typically have 06Jun07 format. Do you know if that code can display that?
I think this is pointing me in the right direction for our title blocks. I would love to have a generic format block that has attributes tied to it, run this journal, and it fills it all out.
Thank you again.
Justin Ackley
Designer
jackley@gmail.com
RE: Auto Date?
RE: Auto Date?
Note that you don't have to manually type this out each time as there is an option in the full Text Editor to create notes linked to Attributes and Expression by selecting the 'Relationships' tab on the dialog.
John R. Baker, P.E.
Product 'Evangelist'
UGS NX Product Line
SIEMENS
UGS PLM Software
Cypress, CA
http://www.siemens.com/ugs
http://www.plmworld.org/museum/
RE: Auto Date?
TimeNoteString(1) writes 04.05.2007
TimeNoteString(2) writes 07.06.07
TimeNoteString(3) writes 2007-06-07
TimeNoteString(4) writes 7. juuni 2007. a.
TimeNoteString(5) writes 07. juuni 2007. a.
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
It might depend your computer Regional setting.
Henry
RE: Auto Date?
I wondering if it´s possible to create an attribute with the scale of the view inserted in 2d drawing using journal file?
I have an other question:
I draw molds, an it´s usual that in the same assembly I have many time the same part.
My problem is when I draw this part 2D drawing I need to indicate the quantity existing in part.
Since it´s a sub assembly file and quantity only apears on top assembly, is there a way to use journal file to create an attribute with the quantity of this file existing on top
It would help me a lot avoiding mistakes.
thanks a lot
RE: Auto Date?
I think you want to the functionality described in the following professional utility :
http:
Regards ,
RE: Auto Date?
Dieman 44, You wrote that your were able to include part attribute like part number and name automaticly .
Can you tell me how?
Thanks in advance
RE: Auto Date?
This time I´ll have to ask a favor to Aikon:)
I apply your journal file and it´s really helpfull.
My (problem) is that my cad file in 2D drawing are all name like that: refnumber-componentname-2D
Is there a way to eliminate the "-2D" in the attribute create by journal file.
Thanks a lot
RE: Auto Date?
Thanks
RE: Auto Date?
This works for me only with G.M. files. They include these attributes in most of their files. All you need to do is format your tile block to include which <W@'attribute'> you want.