I have a note on my drawing that displays the current date a drawing
was printed <SW-Short Date>, 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.
Jean Marc wrote:
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 <SW-Short Date>, but how can I do the current time ?
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.
SW Monkey wrote:
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
Brian Putnam wrote:
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.]
Public swApp As Object
Dim retval As Boolean
Dim bret As Boolean
Dim Doc As Object
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)
SW Monkey wrote:
Polytechforum.com is a website by engineers for engineers. It is not affiliated with any of manufacturers or vendors discussed here.
All logos and trade names are the property of their respective owners.