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?
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?
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.
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 ?
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.
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.
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
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.