Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

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

Date stamp with user's name

Status
Not open for further replies.

cudaracer

Electrical
Oct 9, 2002
22
My company has recently started to use the ddts.lsp routine to place the file path, date and time on drawings, they are now looking for a way to modify the lisp routine to include the users' login name also, The current routine is as follows:

;;; ***** DDTS.LSP *****
;;;
;;; Places Drawing name, Date and Time Stamp at lower left corner of drawing
;;;
(defun c:DDTS (/ CE AP CL DP DN CD MX HR MN LM LX DX TH DS MO YR TS TM UN TX OSM)
(setq OSM (getvar "OSMODE"))
(setvar "OSMODE" 0)
(setq CE (getvar "CMDECHO"))
(setvar "CMDECHO" 0)
(setq TS (getvar "TEXTSIZE"))
(setq AP "AM"
CL (getvar "CLAYER")
DP (getvar "DWGPREFIX")
DN (getvar "DWGNAME")
UN (GETENV "U")
CD (rtos (getvar "CDATE") 2 4)
MX (atoi (substr CD 5 2))
HR (atoi (substr CD 10 2))
MN (substr CD 12 2)
LM (getvar "LIMMIN")
LX (getvar "LIMMAX")
DX (distance LM LX)
TH (/ DX 552)
DS (polar LM (/ pi 5) (/ DX 60))
;;;DS (polar LM (/ pi 6) (/ DX 100)) [orig]
MO (nth MX '(nil "JAN" "FEB" "MAR" "APR" "MAY" "JUN"
"JUL" "AUG" "SEP" "OCT" "NOV" "DEC"))
)
(if (>= HR 12) (setq AP "PM"))
(if (>= HR 13) (setq HR (itoa (- HR 12))) (setq HR (itoa HR)))

(setq YR (strcat "DATE: " MO " " (substr CD 7 2) ", " (substr CD 1 4)))
(setq TM (strcat "DWG. NAME: " DP "" DN " " YR " TIME: " HR ":" MN " " AP))
(command ".LAYER" "T" "DATESTAMP" "")
(command ".LAYER" "N" "DATESTAMP" "C" "7" "DATESTAMP" "S" "DATESTAMP" "")
(setq TX (ssget "X" (list (cons 8 "DATESTAMP"))))
(command ".ERASE" TX ""
".STYLE" "STANDARD" "" "0" "1" "0" "N" "N" "N"
".TEXT" DS TH "0" TM
".LAYER" "S" CL ""
)
(setvar "CMDECHO" CE)
(setvar "TEXTSIZE" TS)
(print)
(print TM)
(setvar "OSMODE" OSM)
(command "qsave")
(princ)
)
They would like it to appear between the file name and time and I'm not certain what variable to use to pull the login name from the computer. Any help would be greatly appreciated.

Thanks,
Don
 
Replies continue below

Recommended for you

I forgot to mention, the reason that we don not use the plotstamp feature in Autocad is that they like having the name and date information physically in the file as a way to verify the markup matches the file.
Thanks again,
Don
 
Hi Don,

what about "rtext" from the Express Tools V 1-9???
We use it!

Lothar

ADT 2004
ACAD 2002
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor