Is it possible to insert current time just like <SW-SHORT DATE> ?

I have a note on my drawing that displays the current date a drawing
was printed , but I would also like the current time it
was printed. Is this possible with a default note, or will it involve
inserting the time using a macro?
Reply to
SW Monkey
Loading thread data ...
I have a note on my drawing that displays the current date a drawing was printed , but I would also like the current time it was printed. Is this possible with a default note, or will it involve inserting the time using a macro?
Reply to
SW Monkey
"SW Monkey" a écrit dans le message de news: snipped-for-privacy@73g2000cwn.googlegroups.com...
I use the "footnote" (?) function in the print menu, and print date, time and file name of the printed doc.
Reply to
Jean Marc
SW Monkey,
Do you want a static date and time that represents the last time the document was printed on the electronic document itself or do you want the time the document was printed to only show on the paper print.
Regards, Corey
Jean Marc wrote:
de
Reply to
CS
We create PDFs of our drawings. What I would like is a note that displays the current date/time that the PDF was created. We use the SolidWorks "Save As PDF" option. I can get the current date on the drawing by putting , but how can I do the current time ?
Reply to
SW Monkey
SW Monkey, I have the following in the border of the drawing: $PRP:"SW-Folder Name"$PRP:"SW-File Name" $PRP:"SW-Last Saved Date" $PRP:"SW-Last Saved By"
It looks like this: S:\acaddwg\MANUALS\DWG\TBEI1520manual Wednesday, December 20, 2006 1:34:30 PM bputnam
I think this shows the last time it was saved, not when it was printed. For us, this is close enough.
Brian
SW M>
Reply to
Brian Putnam
Well, that could be used to fake the Print Date, by making a macro that saves the drawing, rebuilds it (to update the linked note) and then prints it. Kinda around-about, but I think it would do what you are asking.
Matt
Brian Putnam wrote:
Reply to
fcsuper
Monkey,
Ok, I come up with the code to add Time stamp to your drawings, with some help from my VAR and from SW API Help. To make this work, add an annotation text with a link to the custom property "Print Time" ($PRP:"Print Time"). Once this note is on your template, simply run this macro (assign it to a toolbar icon or shortcut key). When you run this macro, it will update the time/date stamp on your drawing, then print it to the default printer. [If you wish to make sure you use the same printer each time, you will need to modify the Print instruction (PrintOut2) to callout the specific printer.]
Option Explicit
Public swApp As Object Dim retval As Boolean Dim bret As Boolean Dim Doc As Object
Sub main()
Dim swApp As Object Set swApp = CreateObject("SldWorks.Application") Set Doc = swApp.ActiveDoc
retval = Doc.DeleteCustomInfo("Print Time") retval = Doc.AddCustomInfo("Print Time", "Text", Now)
retval = Doc.ForceRebuild3(False)
bret = Doc.PrintOut2(0, 0, 1, False, 0, 0, False, 0)
End Sub
-------------------
SW M> I have a note on my drawing that displays the current date a drawing
Reply to
fcsuper
UPDATE: I've uploaded this code (with each function explained) to my site at:
formatting link
Matt
fcsuper wrote:
Reply to
fcsuper
"fcsuper" a écrit dans le message de news: snipped-for-privacy@79g2000cws.googlegroups.com...
Thanks for the code, but I still think it is simpler to use the Header / Footer button in the print dialog box. (previous post)
Reply to
Jean Marc

PolyTech Forum website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.