본문 바로가기
autocad

Date and Time Stamping

by kmlab 2022. 7. 14.

from AfraLISP

 

Date and Time Stamping | AfraLISP

Date and Time Stamping by Kenny Ramage When you plot a drawing (or insert an Xref, etc), it's nice to have the Date and Time of the plot stamped on the plotted drawing. This is easily done manually, but wouldn't it be nice to use AutoLisp and have the Time

www.afralisp.net

(defun TODAY ( / d yr mo day)
     (setq d (rtos (getvar "CDATE") 2 6)
;          yr (substr d 3 2)
          yr (substr d 1 4)
          mo (substr d 5 2)
          day (substr d 7 2)
     );setq
;     (strcat day "/" mo "/" yr)
     (strcat yr "-" mo "-" day)
);defun
;;;*-------------------------------------------
(defun TIME ( / d hr m s)
     (setq d (rtos (getvar "CDATE") 2 6)
          hr (substr d 10 2)
          m (substr d 12 2)
          s (substr d 14 2)
     );setq
     (strcat hr ":" m ":" s)
);defun
;;;*-------------------------------------------

(TODAY)
(TIME)

반응형

'autocad' 카테고리의 다른 글

Change Fonts of All Styles to "simplex.shx,whgtxt.shx"  (0) 2022.12.01
STAIR CALCULATOR  (1) 2022.09.30
TEXT MOVE TO MID POINT, ROTATE 0, JUSTIFY MIDDLE  (0) 2022.07.08
VPORTS SCRIPT  (0) 2022.07.05
PLOT PDF by ATTRIB(update20220616)  (0) 2022.06.16