TIP: Click on subject to list as thread! ANSI
echo: a_cad
to: MARK PEDERSEN
from: CHRIS EHLY
date: 1996-08-12 09:29:00
subject: Display file path on draw

Hi MARK!
On 08-1096 @ 11:06, MARK PEDERSEN said to AUTOLISP USERS:
MP>I have seen Autocad drawings with the filename and path printed on the
MP>caorner of a drawing.  Can anyone tell me how I can do this with
MP>release 12. Is this an Autolisp routine or an add on that can be
MP>purchased. Thanks, any help will be appreciated.
I got this (there are alot of different lisp routines out there that do the 
same thing) from an internet site (have no idea where) but I'll post it for 
you, non-the-less.
tear line
--------------------------------------------------------------------------- 
;;;                   Newport News, VA  23606 ;;;                   Voice: 
(804) 930-8548 ;;;                   Fax:   (804) 930-8548 ;;;                
   Email: Klockwork@aol.com ;;;                   Dexter F. Klock ;;; ;;;     
              Date 6/15/95 ;;; ;;;STAMP.LSP is a routine that will stamp a 
drawing with the ;;;current drawing name, date and time of last save.  The 
plot number, ;;;and time of plot can be added to this program. The problem 
with the ;;;plot stamp is that the dialog box does not appear.  Once this 
;;;problem is overcome a new release will be distributed. ;;;The program 
stamps the drawing each time there is a save, ;;;qsave, and end. When the 
drawing is saved  only the ;;;name and time of save is updated. ;;; ;;;The 
stamp is located in paper or model space on a layer called dtstamp.  ;;;The 
routine prompts you for the stamp location on the drawing. ;;;The program 
needs the file called SVE_STMP.DWG located within ;;;the ACAD enviroment.  
This lisp routine also needs to be located ;;;within the ACAD enviroment.  
Please also add the following lines ;;;to your ACAD.LSP file.  If the 
ACAD.LSP file does not exist please ;;;create one and enter the following 
lines.  A good location for all ;;;of these files is in the c:\acad*\support 
subdirectory. Where * ;;;notates which subdirectory where ACAD.EXE resides on 
your hard drive. ;;; ;;;***************** ACAD.LSP FILE 
******************************* ;;; ;;;(defun S::STARTUP () ;;; (load 
"stamp") ;;;) ;;; ;;;**************** ACAD.LSP FILE END 
**************************** ;;; ;;;If there are any questions regarging use 
of this routine please ;;;call Dexter Klock at Klockwork, Inc. noted in the 
above address, ;;;phone, and Email address.  Good luck! ;;; ;;; ;;; echoff = 
turns screen echo off lisp transparent ;;;  echon = turns screen back to 
default acad settings, ;;;      lisp not transparent ;;; (defun ECHOFF()
   (setq cmdech (getvar "CMDECHO"))
   (setq menuech (getvar "MENUECHO"))
   (setq expertech (getvar "EXPERT"))
   (setvar "CMDECHO" 0)
   (setvar "MENUECHO" 3)
   (setvar "EXPERT" 5)
   (princ)
);defun echoff
(defun ECHON()
   (setvar "CMDECHO" cmdech)
   (setvar "MENUECHO" menuech)
   (setvar "EXPERT" expertech)
   (princ)
);defun echon
;;;
;;;
;;;      REDEFINE THE SAVE, _SAVE, QSAVE, _QSAVE, END, _END ;;; (echoff) 
(command "undefine" "save") (command "undefine" "_save") (command "undefine" 
"qsave") (command "undefine" "_qsave") (command "undefine" "end") (command 
"undefine" "_end") (command "undefine" "new") (command "undefine" "_new") 
(echon) (princ) ;;; ;;; ;;;dxf converts entity list and strips out variable 
from DXF code ;;; (defun dxf (code elist)
   (cdr (assoc code elist))
);defun  dxf
;;;
;;;routine to insert the date stamp attribute block ;;; ;;; (defun blkins ( / 
pspace inspoint nlay)
   (echoff)
;;;look for a block named "SVE_STMP" inserted on the DTSTAMP layer
   (if (= nil (ssget "X" '((0 . "INSERT")(8 . "DTSTAMP")(2 . "SVE_STMP"))))
      (progn
         (setq pspace (getvar "tilemode"))
         (while (not (and ;
                  (setq tmode (strcase (getstring "Insert stamp in paper 
space  or model space : ")))
                  (cond ;
                     ((= tmode "P")(setq tmode 0))
                     ((= tmode "M")(setq tmode 1))
                     (tmode (prompt "Error on input.\n"))
                  );cond
               );and
            );not
         );while
         (setq nlay (getvar "clayer"))
         (setvar "tilemode" tmode)
         (command "layer" "m" "dtstamp" "c" "red" "" "")
         (setq inspoint (getpoint "Pick location for drawing stamp: "))
         (if (= tmode 1)(setq inscale (getvar "DIMSCALE"))(setq inscale 1))
         (command "insert" "sve_stmp"  inspoint inscale "" "")
         (setvar "clayer" nlay)
         (setvar "tilemode" pspace)
      );progn
   );if
   (echon)
); defun blkins
;;
;;define date and time
;;
(defun date_time( / ndate year month day hour minute ampm tmdtstamp)
   (setq ndate (rtos (getvar "cdate") 2 4)
      year (substr ndate 1 4)
      month (substr ndate 5 2)
      day (substr ndate 7 2)
      hour (substr ndate 10 2)
      minute (substr ndate 12 2)
   );setq
;;
;;Figure AM/PM
;;
   (setq ihour (atoi hour))
   (if (< ihour 12) (setq ampm "AM") (setq ampm "PM")) ;; ;;Convert from 
military to conventional time ;;
   (if (< (atoi hour) 10) (setq hour (substr hour 2 1)))
   (if (> (atoi hour) 12) (setq hour (itoa (- (atoi hour) 12)))) ;; ;;convert 
numeric date to alpha date ;;
   (if (< (atoi day) 10) (setq day (substr day 2 1)))
   (cond
      ((= "12" month) (setq month "December"))
      ((= "11" month) (setq month "November"))
      ((= "10" month) (setq month "October"))
      ((= "09" month) (setq month "September"))
      ((= "08" month) (setq month "August"))
      ((= "07" month) (setq month "July"))
      ((= "06" month) (setq month "June"))
      ((= "05" month) (setq month "May"))
      ((= "04" month) (setq month "April"))
      ((= "03" month) (setq month "March"))
      ((= "02" month) (setq month "February"))
      ((= "01" month) (setq month "January"))
   );cond
;;
;;Concactinate string for time and date stamp ;;
   (setq tmdtstamp month
      tmdtstamp (strcat tmdtstamp " ")
      tmdtstamp (strcat tmdtstamp day)
      tmdtstamp (strcat tmdtstamp ", ")
      tmdtstamp (strcat tmdtstamp year)
      tmdtstamp (strcat tmdtstamp " at ")
      tmdtstamp (strcat tmdtstamp hour)
      tmdtstamp (strcat tmdtstamp ":")
      tmdtstamp (strcat tmdtstamp minute)
      tmdtstamp (strcat tmdtstamp " ")
      tmdtstamp (strcat tmdtstamp ampm)
   );setq
);defun
;;;
;;;
;;; Stamp is the routine to stamp the drawing with the date, time and drawing 
;;; name. ;;; (defun stamp ( /  name prefix tmdtstamp txthgt pspace nlay old 
new en ed)
   (echoff)
   (blkins)
;;
;;Get drawing name only
;;
   (setq name (getvar "dwgname"))
   (setq prefix (getvar "dwgprefix"))
   (if (> (strlen name) (strlen prefix)) (setq name (substr name (+ (strlen 
prefix) 1))))
   (setq name (strcat "Drawing name: " name)
      name (strcat name ".DWG")
   );setq
;;
;;Change attribute with current date time and drawing name. ;;
   (setq en (tblsearch "block" "sve_stmp"))
   (setq en (entget (dxf -2 en)))
   (setq ed en)
   (setq old (assoc 1 ed))
   (setq new (cons 1 name))
   (setq ed (subst new old ed))
   (entmod ed)
   (setq en (entget (entnext (dxf -1 en))))
   (setq old (assoc 1 en))
   (setq tmdtstamp (strcat "Saved on: " (date_time)))
   (setq new (cons 1 tmdtstamp))
   (setq en (subst new old en))
   (entmod en)
   (command "regen")
   (echon)
);defun stamp
;;;
;;; Plot stmap function
;;;
(defun c:plotter( / en old new num)
   (echoff)
   (blkins)
;;;
;;;Plot number of plots
;;;
   (setq en (tblsearch "BLOCK" "SVE_STMP")
      en (entget (dxf -2 en))
      en (entget (entnext (dxf -1 en)))
      en (entget (entnext (dxf -1 en)))
      old (assoc 1 en)
      num (itoa (+ (atoi (substr (dxf 1 en) 16)) 1))
      num (strcat "This is plot #: " num)
      new (cons 1 num)
      en (subst new old en)
   );setq
   (entmod en)
;;;
;;;Plot date and time
;;;
   (setq en (tblsearch "BLOCK" "SVE_STMP")
      en (entget (dxf -2 en))
      en (entget (entnext (dxf -1 en)))
      en (entget (entnext (dxf -1 en)))
      en (entget (entnext (dxf -1 en)))
      old (assoc 1 en)
      tmdtstamp (strcat "Plotted on: " (date_time))
      new (cons 1 tmdtstamp)
      en (subst new old en)
   );setq
   (entmod en)
   (command "REGEN")
   (echon)
   (princ)
);defun plotter
;;;
;;;
;;;
(defun c:save ()
   (echoff)
   (stamp)
   (command ".save")
   (echon)
   (princ)
)
(defun c:_save ()
   (echoff)
   (stamp)
   (command "._save")
   (echon)
   (princ)
)
(defun c:qsave ()
   (echoff)
   (stamp)
   (command ".qsave")
   (echon)
   (princ)
)
(defun c:_qsave ()
   (echoff)
   (stamp)
   (command "._qsave")
   (echon)
   (princ)
)
(defun c:end ()
   (echoff)
   (stamp)
   (command ".end")
   (echon)
   (princ)
)
(defun c:_end ()
   (echoff)
   (stamp)
   (command "._end")
   (echon)
   (princ)
)
(princ)
(defun c:new ()
   (echoff)
   (stamp)
   (command ".new")
   (echon)
   (princ)
)
(defun c:_new ()
   (echoff)
   (stamp)
   (command "._new")
   (echon)
   (princ)
)
(princ)
-------------------------------------------------------------------------- 
tear line.
Good luck,
_Chris Ehly___virtual!chris.ehly@pebble.cts.com___
===
* CMPQwk #1.42* UNREGISTERED EVALUATION COPY
--- InterEcho 1.10
---------------
* Origin: The Virtual Dimension Graphics BBS, Oceanside CA, USA (1:202/405)

SOURCE: echomail via exec-pc

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.