Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Datestamp modification

2 REPLIES 2
Reply
Message 1 of 3
Anonymous
142 Views, 2 Replies

Datestamp modification

I've got this datestamp for R14 that I would like to modify for A2k, to
include layout information. I did not create this, and my lisp is very
limited. It works fine on the first layout, but fails when I want to
include it on another layout. Maybe there's something newer and better out
there? Any help would be appreciated. Thanks

(defun c:datestmp ()
(command "UCS" "W")
(setvar "cmdecho" 0)
(setq oprec (getvar "luprec"))
(setvar "luprec" 4)
(setq ouns (getvar "lunits"))
(setvar "lunits" 2)
(setq inpt (getvar "limmin"))
(setq maxpt (getvar "limmax"))
(setq y1$ (cadr inpt))
(setq y2$ (cadr maxpt))
(setq _dwsc (/ (- y2$ y1$) 594.0))
(setq now (rtos (getvar "cdate")))
(setq u$er (getvar "loginname"))
(setq d$dir (getvar "dwgprefix"))
(setvar "luprec" oprec)
(setvar "lunits" ouns)
(setq yr (substr now 1 4))
(setq mth (substr now 5 2))
(setq dy (substr now 7 2))
(setq hr (substr now 10 2))
(setq mn (substr now 12 2))
(setq now (strcat yr "/" mth "/" dy "-" hr ":" mn))
(setq f$name (getvar "dwgname"))
(setq l_f$n (strlen f$name))
(setq d_limitr (substr f$name l_f$n 1))
(while (and (> l_f$n 1)(not (or (= d_limitr "\\")(= d_limitr "/"))))
(setq l_f$n (1- l_f$n)
d_limitr (substr f$name l_f$n 1))
)
(setq f$name (substr f$name l_f$n))
(if (null (tblsearch "block" "$d_stamp"))
(princ "\n...")
(command "rename" "B" "$d_stamp" "nd_stamp")
)
(if (null (tblsearch "block" "nd_stamp")) (progn
(setq rblk _dwsc)
(if (null rblk) (setq rblk 1))
(command "layer" "m" "0INXS" "")
(command "insert" "h:/acadrcpl/nd_stamp" inpt rblk rblk 0 F$NAME NOW
d$dir U$ER)
) (progn
(princ "\nUPDATING...")
(command "attedit" "y" "nd_stamp" "$d$dir" "" "w" inpt maxpt "v" "r"
d$dir "n")
(command "attedit" "y" "nd_stamp" "$f$name" "" "w" inpt maxpt "v"
"r" f$name "n")
(command "attedit" "y" "nd_stamp" "$_date$" "" "w" inpt maxpt "v"
"r" now "n")
(command "attedit" "y" "nd_stamp" "u$erna" "" "w" inpt maxpt "v" "r"
u$er "n")
))
(command "UCS" "P")
)
(prompt "loaded")
(c:datestmp)
2 REPLIES 2
Message 2 of 3
Martyn_Perrin
in reply to: Anonymous

In A2k I use remote text (express menu under text). This is the current annonation I have been using:

FILE: $(getvar,"dwgname") | FOLDER: $(getvar,"dwgprefix") | PLOT TIME: $(edtime,0,MON DD","YYYY - H:MMam/pm)

I have not figured out how to put the layout information in yet. Ensure that you d/l the rtext patch, if not it causes rotation problems in layout space.
Message 3 of 3
btlsp
in reply to: Anonymous

I have a date stamp...bt_dnd@hotmail.com

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost